The Wayback Machine - https://web.archive.org/web/20200611053208/https://github.com/google/flatbuffers/issues/5786
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Example/documentation not available for array of tables in C++ ? #5786

Open
jjn555 opened this issue Mar 2, 2020 · 3 comments
Open

Example/documentation not available for array of tables in C++ ? #5786

jjn555 opened this issue Mar 2, 2020 · 3 comments

Comments

@jjn555
Copy link

@jjn555 jjn555 commented Mar 2, 2020

I have this schema I want to implement but I am finding it very difficult to find documentation to perform the serialization and deserialization for C++. The existing tutorial and documentation do not seem to describe this scenario which I am assuming is quite common. Can someone point me to any example or documentation that describes this?

tb.fbs:

namespace TB;

table Proj {
idx:int64 = 0;
title:string;
}

table ProjList {
PList:[Proj];
}

root_type ProjList;

@jjn555 jjn555 changed the title example/documentation for array of tables in C++ Example/documentation available for array of tables in C++ ? Mar 2, 2020
@jjn555 jjn555 changed the title Example/documentation available for array of tables in C++ ? Example/documentation not available for array of tables in C++ ? Mar 2, 2020
@aardappel
Copy link
Collaborator

@aardappel aardappel commented Mar 2, 2020

@jjn555
Copy link
Author

@jjn555 jjn555 commented Mar 3, 2020

Thank you for pointing that out.
weapons:[Weapon]; is the kind of example I was looking for and I had missed it when I skimmed through it initially. Also, if I had another table, say
table Task {
idx:int64 = 0;
title:string;
}

since there is only one root_type entry, does it matter if I serialize/deserialize multiple arrays like this:
table ProjList {
PList:[Proj];
}
table TaskList {
TList:[Task];
}

instead of combining like this:
table MyList {
PList:[Proj];
TList:[Task];
}

@aardappel
Copy link
Collaborator

@aardappel aardappel commented Mar 5, 2020

You're likely better off combining, will give you more flexibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
2 participants
You can’t perform that action at this time.