I have a Player
structure which holds a list of pointers to its closest neighbors. The structure might look as follows in C++:
struct Player {
string handle;
vector<Player*> neighbors;
};
I want to use protobuf to serialize instances of this class. How would I write a message definition to represent the above structure?
I think this would do the trick:
message Player
{
required string handle = 1;
repeated Player neighbors = 2;
}
I compiled the definition with protobuf-c and it seems to be working.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With