So I have a schema comprised of a table with two entries.
the builder works fine and compiles ok. verifier passes at both ends I fill the loop by reading a different type of table it gets someVal from the table and inserts it. iterator is assigned to the column using a counter. then I verify and check the table the data looks like it is correct, then we write out the binary buffer.
flatbuffers::FlatBufferBuilder builder;
std::vector<uint8_t> vals;
std::vector<uint32_t> indices;
int tCount = object->GetTableCount();
uint32_t iCount = 0;
std::cout << "Evaluating " << tCount << " Tables" << std::endl;
// evaluate every table
for (int p = 0; p < tCount; p++)
{
int nVals = table->GetObjectsInTable(t);
// now evaluate all values in the table
for (int v = 0; v < nVals; v++)
{
// Get the index for the vert
int vIndex = table->GetTableEntry(p, v);
// now get all the elements of the table for export.
Vector4 tableCol = cTable[vIndex];
float vT1 = (float)tableCol[0];
auto T1 = reinterpret_cast<const uint8_t*>(&vT1);
verts.insert(verts.end(), T1, T1 + sizeof(float));
float vT2 = (float)tableCol[1];
auto T2 = reinterpret_cast<const uint8_t*>(&vT2);
verts.insert(verts.end(), T2, T2 + sizeof(float));
float T3 = (float)tableCol[2];
auto T3 = reinterpret_cast<const uint8_t*>(&vT3);
verts.insert(verts.end(), T3, T3 + sizeof(float));
indices.push_back(vCount);
}
vCount++;
}
auto indexVec = builder.CreateVector(indices);
auto valsVec = builder.CreateVector(vals);
auto table = evr::CreateTable(builder, indexVec, valsVec);
builder.Finish(table);
When I read back in to verify the someVal array evaluates correctly. but iterator does not. it stores the first 10 values 0-9 then skips ahead to 2573. which is offset from the expected value which is 10 the next value is 2816 offset from the previous value by 243. every subsequent value is offset by 256. Any ideas what I might have done wrong.