GetField in flatBuffer

77 views
Skip to first unread message

1 gvlab

unread,
Jan 19, 2015, 9:31:46 PM1/19/15
to flatb...@googlegroups.com
Dear all

 I have a noob question , please explain to me

I have read this code . GetField is the member function of flatBuffer .

Please explain to me about these number "6" and "0" . The best way we will choice for that number 


int64_t val() const { return GetField<int64_t>(6, 0); }

and

const flatbuffers::String *id() const { return GetPointer<const flatbuffers::String *>(4); }


Thanks you very much

Wouter van Oortmerssen

unread,
Jan 21, 2015, 1:10:50 PM1/21/15
to 1 gvlab, flatb...@googlegroups.com
These are implementation details. A full description is here: http://google.github.io/flatbuffers/md__internals.html

6 (and 4) are vtable offsets where the field offset is stored.

0 is the default value for that field, which is returned if the field is not present. The string doesn't have one since it is always NULL.

--
You received this message because you are subscribed to the Google Groups "FlatBuffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages