You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am getting Notnested assertion when i try to serialization of vector of vectors
Here is my serialization code Not sure what went wrong.
const auto bufferSize = static_cast<uint32_t>(bufferEnd - bufferStart);
flatbuffers::FlatBufferBuilder builder;
bool isSerialised = false;
try
{
const AABMessageNewBaseTablesNotification& msg = dynamic_cast<const AABMessageNewBaseTablesNotification&>(message);
// Move the creation of sub-objects above the FlatBufferBuilder construction
std::vector<flatbuffers::Offset<AAB::UpdatedBDTList>> updatedBDTListVector;
const auto& updatedBDTList = msg.GetUpdatedBDTList();
for (const auto& pair : updatedBDTList)
{
auto TableList = VectorToFlatBufferVector(pair.second, builder);
auto ServiceName = builder.CreateString(pair.first);
updatedBDTListVector.push_back(AAB::CreateUpdatedBDTList(builder, ServiceName, TableList));
}
AAB::AABMessageNewBaseDataTablesNotificationBuilder messageBuilder(builder);
messageBuilder.add_type(msg.Type());
messageBuilder.add_version(msg.Version());
messageBuilder.add_updatedBDTList(builder.CreateVector(updatedBDTListVector));
auto messageOffset = messageBuilder.Finish();
builder.Finish(messageOffset);
auto size = builder.GetSize();
messageSize = size;
if (size <= bufferSize) {
auto span = builder.GetBufferPointer(); // Use GetBufferPointer instead of GetBufferSpan
std::copy(span, span + size, bufferStart);
isSerialised = (size != 0);
}
}
catch (const std::bad_cast&)
{
}
builder.Clear();
return isSerialised;
Thank you for submitting an issue!
Please make sure you include the names of the affected language(s), compiler version(s), operating system version(s), and FlatBuffers version(s) in your issue title.
This helps us get the correct maintainers to look at your issue. Here are examples of good titles:
Crash when accessing FlatBuffer [C++, gcc 4.8, OS X, master]
Flatc converts a protobuf 'bytes' field to 'string' in fbs schema file [all languages, FlatBuffers 1.4]
Include other details as appropriate.
Thanks!
The text was updated successfully, but these errors were encountered:
I am getting Notnested assertion when i try to serialization of vector of vectors
Here is my serialization code Not sure what went wrong.
Thank you for submitting an issue!
Please make sure you include the names of the affected language(s), compiler version(s), operating system version(s), and FlatBuffers version(s) in your issue title.
This helps us get the correct maintainers to look at your issue. Here are examples of good titles:
Include other details as appropriate.
Thanks!
The text was updated successfully, but these errors were encountered: