Class ChunkRef
Defined in File reader.h
Class Documentation
-
class ChunkRef
Thin interface class that holds the pointer to the chunk and hides the messages reading routines.
It expects that Chunk was “verified” before creating a ChunkRef.
Public Functions
-
ChunkRef(const uint64_t offset, Reader *reader)
- Parameters:
offset[in] – The offset into the chunk array for the specified chunk.
reader[in] – The reader object to use for reading.
-
ChunkRef(const uint64_t offset, const OsfBuffer &buf, Reader *reader)
Constructs a ChunkRef using a chunk offset, buffer, and Reader pointer.
- Parameters:
offset[in] – Offset into the OSF chunk array.
buf[in] – OSF buffer corresponding to the chunk data.
reader[in] – Reader instance used to interpret the chunk.
-
ChunkRef(ChunkRef &&other) = default
Move constructor for ChunkRef.
- Parameters:
other[in] – The ChunkRef instance to move from.
-
ChunkRef(const ChunkRef &other) = default
Copy constructor for ChunkRef.
- Parameters:
other[in] – The ChunkRef instance to copy from.
-
const ChunkState *state() const
Get the ChunkState for the chunk associated with this ChunkRef.
- Returns:
The ChunkState associated with this ChunkRef.
-
const ChunkInfoNode *info() const
Get the ChunkInfoNode for the chunk associated with this ChunkRef.
- Returns:
The ChunkInfoNode associated with this ChunkRef.
-
MessagesChunkIter begin() const
Begin function for std iterator support.
- Returns:
A MessagesChunkIter object for iteration.
-
MessagesChunkIter end() const
End function for std iterator support.
- Returns:
A MessagesChunkIter object for signifying the end of iteration.
-
const MessageRef operator[](size_t msg_idx) const
Get the message at a specific index.
- Parameters:
msg_idx[in] – The message index to get.
- Returns:
The resulting message.
-
std::unique_ptr<const MessageRef> messages(size_t msg_idx) const
Get the message smart pointer at a specific index.
- Parameters:
msg_idx[in] – The message index to get.
- Returns:
The resulting message smart pointer, returns nullptr if non existent.
-
std::string to_string() const
Debug string representation.
- Returns:
The string representation of a ChunkRef.
-
uint64_t offset() const
Return the chunk offset in the larger flatbuffer array.
- Returns:
The chunk offset in the larger flatbuffer array.
-
size_t size() const
Returns the summation of the sizes of the chunks messages.
- Returns:
The summation of the sizes of the chunks messages, 0 on chunk invalidity.
-
bool valid() const
Get the validity of the chunk.
- Returns:
The validity of the chunk.
-
ChunkState *state()
Get the ChunkState for the chunk associated with this ChunkRef.
- Returns:
The ChunkState associated with this ChunkRef.
-
ChunkInfoNode *info()
Get the ChunkInfoNode for the chunk associated with this ChunkRef.
- Returns:
The ChunkInfoNode associated with this ChunkRef.
-
ChunkRef(const uint64_t offset, Reader *reader)