I'm having a problem working out how to assign a nested object's value
in C++ (my Java version works fine).  E.g. in the proto file for my
car object I define:

  import "mycustomengine.proto";
  message MyCar {
  optional string name = 1;
  optional string model = 2;
  optional MyCustomEngine customengine  = 3;

Note I have assigned there to only be 0 or 1 MyCustomEngines to a Car
object.  Now in my code, I've already created an instance of
MyCustomEngine, e.g.:

  my::objects::MyCustomEngine myCustomEngine;
  myCustomEngine.set_name("hey, this is my custom engine!");

Now I create my Car object....

  my::objects::MyCar myCar;
  myCar.set_name("Ford");
  myCar.set_model("Fiesta");

But now I'm stuck on how to assign the myCustomEngine instance to the
myCar instance?  There appears to be no method such as
"myCar.set_customengine(myCustomEngine)".  So any ideas on how to do
this?

--

You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to proto...@googlegroups.com.
To unsubscribe from this group, send email to 
protobuf+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en.


Reply via email to