MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / Finish

Function Finish

Libs/flatbuffers/flexbuffers.h:1330–1346  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1328 }
1329
1330 void Finish() {
1331 // If you hit this assert, you likely have objects that were never included
1332 // in a parent. You need to have exactly one root to finish a buffer.
1333 // Check your Start/End calls are matched, and all objects are inside
1334 // some other object.
1335 FLATBUFFERS_ASSERT(stack_.size() == 1);
1336
1337 // Write root value.
1338 auto byte_width = Align(stack_[0].ElemWidth(buf_.size(), 0));
1339 WriteAny(stack_[0], byte_width);
1340 // Write root type.
1341 Write(stack_[0].StoredPackedType(), 1);
1342 // Write root size. Normally determined by parent, but root has no parent :)
1343 Write(byte_width, 1);
1344
1345 finished_ = true;
1346 }
1347
1348 private:
1349 void Finished() const {

Callers

nothing calls this directly

Calls 5

WriteFunction · 0.85
ElemWidthMethod · 0.80
StoredPackedTypeMethod · 0.80
AlignFunction · 0.70
sizeMethod · 0.45

Tested by

no test coverage detected