Offsets initially are relative to the end of the buffer (downwards). This function converts them to be relative to the current location in the buffer (when stored here), pointing upwards.
| 1409 | // This function converts them to be relative to the current location |
| 1410 | // in the buffer (when stored here), pointing upwards. |
| 1411 | uoffset_t ReferTo(uoffset_t off) { |
| 1412 | // Align to ensure GetSize() below is correct. |
| 1413 | Align(sizeof(uoffset_t)); |
| 1414 | // Offset must refer to something already in buffer. |
| 1415 | FLATBUFFERS_ASSERT(off && off <= GetSize()); |
| 1416 | return GetSize() - off + static_cast<uoffset_t>(sizeof(uoffset_t)); |
| 1417 | } |
| 1418 | |
| 1419 | void NotNested() { |
| 1420 | // If you hit this, you're trying to construct a Table/Vector/String |
no test coverage detected