Reading in the Basics of the protocol buffer: C ++ , nothing was found, which corresponds to the situation :; followed by .proto processing with --cpp_out
,
message A { required int32 foo = 1; } message B { optional A data = 1; }
no explicit looking accessory / setter is created to set a custom optional field (including the "nested types" section, which I'm too lazy to put here):
So how to set B :: A to some instance of A in C ++?
TEST FILES :. proto generated results:. h , .cc and some . java
Update: in Java, nested fields are set via Builder: see the link above, for example (look for setData).
source share