jeudi 7 février 2019

what is the type of flatbuffer in call to UnPackTo

I just started to understand how flatbuffers work. The document is good. In the section for usage in c++ i see following example

// Autogenerated class from table Monster.
MonsterT monsterobj;

// Deserialize from buffer into object.
UnPackTo(&monsterobj, flatbuffer);

// Update object directly like a C++ class instance.
cout << monsterobj->name;  // This is now a std::string!
monsterobj->name = "Bob";  // Change the name.

// Serialize into new flatbuffer.
FlatBufferBuilder fbb;
Pack(fbb, &monsterobj);

My question is what is the type of flatbuffer? no where in the document it mentioned. Is it the binary buffer either read from file or received over network?

This is the link from where i copied the above sample code.

https://google.github.io/flatbuffers/flatbuffers_guide_use_cpp.html

Aucun commentaire:

Enregistrer un commentaire