Questions tagged [flatbuffers]

FlatBuffers is a serialization library by Google. It is particularly suitable for games and other memory-constrained applications.

FlatBuffers is a serialization library by Google.

Rather than unpacking the data, it allows the user to directly access the serialized data, thus reducing the memory requirements. For that reason, it is particularly suitable for games and other memory constrained applications.

384 questions
0
votes
1 answer

Padding extra bytes to flatbuffer's buffer pointer which is to be sent over the network

Please look up this code for context. auto normalized_log = CreateNormalizedLog(builder, pairs); builder.Finish(normalized_log); auto buffPtr = builder.GetBufferPointer(); SendUdpPacket(&ipInfo, reinterpret_cast(ipInfo.hdle), buffPtr,…
randomgood
  • 546
  • 1
  • 6
  • 19
0
votes
1 answer

encapsulate an old buffer in a new one

So I have this sort of scheme: table Request { a:Sample; b:Sample; } Where table Sample has multiple string vectors and instances of it are pretty big. I have a lot of files on my filesystem with Sample instances, which took me some time to…
assafmo
  • 1,047
  • 3
  • 15
  • 32
0
votes
1 answer

FlatBuffers BufferHasIdentifier return false

I am trying to transfer data through TCP with Flatbuffers, The server is java but the client is C#, which complicates it heavily. The schema i am using is: namespace NetObjects; union NetParameters { NetLogin, NetRegister } table NetMessage { …
Lundira
  • 169
  • 3
  • 12
0
votes
0 answers

FlatBuffers: object serialization must not be nested

I am creating a flatbuffer like this: FlatBufferBuilder fbb = new FlatBufferBuilder(1); SaveSchema.startLogin(fbb); SaveSchema.addEmail(fbb, fbb.createString("EMAILCHE")); int offset = SaveSchema.endLogin(fbb); …
Lundira
  • 169
  • 3
  • 12
0
votes
1 answer

flatc (flatbuffer) compiler doesnot handle nested namespace in correct manner

I am providing following proto file to flatbuffer compiler to generate .fbs file. File: test.proto message A { optional int32 afoo = 1; message B { optional int32 bfoo_ = 1; } optional B bfoo= 2; } message C…
0
votes
1 answer

Reading a flat buffer always gives a EOF Exception after last line

Here is the code i have for reading a flat buffer file. I always get a EOF exception . How do i get rid of that exception... File file = new File("/Users/samarnath/RmsOne/CreateFlatBuffer/src/com/rms/objects/SingleCoverRiskPolicy.fb"); …
user3897533
  • 417
  • 1
  • 8
  • 24
0
votes
1 answer

Can't find FinishMonsterBuffer() method

I created a table following the flatbuffers tutorial and compiled it to C++ code. Say, its name is Doc. In the tutorial, it is said: Regardless of whether you used CreateMonster or MonsterBuilder, you now have an offset to the root of your data,…
Lion
  • 965
  • 10
  • 21
0
votes
1 answer

flatbuffers: Is it possible to delete a buffer via root-pointer

I'm starting to use the flatbuffer library. But there is a thing that feels uncomfortable for me, when it comes to delete a buffer. I don't know ho to delete buffer via it's root-pointer-element. If this were possible the root-pointer could take the…
user1235183
  • 3,002
  • 1
  • 27
  • 66
0
votes
0 answers

Flatbuffer generated files - #include import style

Can the flatbuffer compiler generate output that uses system-style #includes? #ifndef FLATBUFFERS_GENERATED_MYCLASS_MOBILECONFIG_H_ #define FLATBUFFERS_GENERATED_MYCLASS_MOBILECONFIG_H_ #include "flatbuffers/flatbuffers.h" For use with my build…
Robert Karl
  • 7,598
  • 6
  • 38
  • 61
-1
votes
1 answer

Accessing FlatBuffers records when dealing with arrays

I am trying to understand how to access (multiple) records on FlatBuffers The examples that are available are all dealing with a single record. The google example deals with 1x monster record and nothing else. I have seen an example that discusses…
Matthew L.
  • 37
  • 4
-1
votes
1 answer

what is a good way to efficiently store a list of c++ objects from different classes using Flatbuffers?

I have a list of c++ objects derived from different classes. I would like to use Flatbuffers to persist/restore them. An obvious way to do this is with a union, but i do not want to waste bytes or use a vector of pointers to a superclass (assuming…
James Fremen
  • 2,170
  • 2
  • 20
  • 29
-1
votes
1 answer

Getting type of serialized flatbuffer

I am looking for a way to tell what kind of object is in serialized form. The reason is, that I want to use object API on some of the objects, and standard flatbuffers on other. Is there any way to do it without creating another base object for both…
Black
  • 312
  • 2
  • 15
-1
votes
3 answers

Is two static_cast better than reinterpret_cast?

I work with flatbuffers and need to write data to file. Flatbuffer struct returns uint8_t*, but std::ofstream::write takes char* as a parameter. Could you tell me which approach using two static_casts or reinterpret_cast better and why? …
-1
votes
2 answers

Flatbuffer mutate doesn't change bytes

I am running into a problem mutating a flatbuffer from bytes. According to the flatbuffer documentation (https://github.com/google/flatbuffers/blob/master/docs/source/Tutorial.md), you can mutate fixed size fields, such as an int32. And as you can…
thebiggestlebowski
  • 2,610
  • 1
  • 33
  • 30
-1
votes
1 answer

Flatbuffers: How to allow multiple types for a single field

I'm writing a communication protocol schema for a list of parameters which can be of multiple values: uint64, float64, string or bool. How can I set a table field to a union of multiple primitive scalar & non-scalar primitive type? I've already…
1 2 3
25
26