Mutating vector in flatbuffer

513 views
Skip to first unread message

Gaurav Jain

unread,
Mar 16, 2016, 5:20:26 AM3/16/16
to FlatBuffers
Is there way to mutate number of elements in a vector inside flatbuffer?
I know there is way to mutate element value at certain offset, but didn't find any to modify the number of elements in a vector. Lets say to add certain elements or delete some of them

Wouter van Oortmerssen

unread,
Mar 16, 2016, 1:05:25 PM3/16/16
to Gaurav Jain, FlatBuffers
There is, using reflection (see reflection.h). This is however slower, very special purpose functionality that you should only use if reconstructing the buffer is not an option.

On Wed, Mar 16, 2016 at 2:20 AM, Gaurav Jain <gaurav03...@gmail.com> wrote:
Is there way to mutate number of elements in a vector inside flatbuffer?
I know there is way to mutate element value at certain offset, but didn't find any to modify the number of elements in a vector. Lets say to add certain elements or delete some of them

--
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.

min...@vng.com.vn

unread,
Aug 12, 2016, 2:58:49 AM8/12/16
to FlatBuffers, gaurav03...@gmail.com
How can I do it in java @Wouter?

Thanks,
MinhPham

Wouter van Oortmerssen

unread,
Aug 12, 2016, 1:44:26 PM8/12/16
to min...@vng.com.vn, FlatBuffers, Gaurav Jain
There's currently no way to mutate non-scalars directly inside an already constructed FlatBuffer in Java. You'd have to construct a new one.

To unsubscribe from this group and stop receiving emails from it, send an email to flatbuffers+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages