Commits


hwse authored and GitHub committed f350a8fbdd2
AVRO-3984 [C++] Improve code generated for unions (#3047) * AVRO-3984 [C++] Getters created by avrogencpp return a reference instead of a value to avoid calling copy constructor of large classes * AVRO-3984 [C++] Add getter for generated unions that returns a mutable reference. This allows the user to modify values in union branches after creation (#3047) * AVRO-3984 [C++] Add move setters for generated unions to provide a more efficient way to set a value (#3047) * AVRO-3984 [C++] Use std::move in decode implementation of codec_traits for unions to avoid a copy (#3047) * AVRO-3984 [C++] Generate an enum for each union type that maps the branch names to the corresponding index. This allows the user to avoid checks against "magic numbers" (#3047) * AVRO-3984 [C++] Add additional checks for the union branch in testUnionMethods test (#3047) * AVRO-3984 [C++] Add additional branch() method that returns the Branch enum directly, this avoids a manual static_cast (#3047) --------- Co-authored-by: hwse <a35winuuvvbpa@mailbox.org>