MCPcopy Create free account
hub / github.com/bytedance/Fastbot_Android / Finish

Function Finish

native/thirdpart/flatbuffers/flexbuffers.h:1320–1336  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 5

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

Tested by

no test coverage detected