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.
| 1483 | // This function converts them to be relative to the current location |
| 1484 | // in the buffer (when stored here), pointing upwards. |
| 1485 | uoffset_t ReferTo(uoffset_t off) { |
| 1486 | // Align to ensure GetSize() below is correct. |
| 1487 | Align(sizeof(uoffset_t)); |
| 1488 | // Offset must refer to something already in buffer. |
| 1489 | FLATBUFFERS_ASSERT(off && off <= GetSize()); |
| 1490 | return GetSize() - off + static_cast<uoffset_t>(sizeof(uoffset_t)); |
| 1491 | } |
| 1492 | |
| 1493 | void NotNested() { |
| 1494 | // If you hit this, you're trying to construct a Table/Vector/String |
no test coverage detected