32 #ifndef CFDP_CHUNK_HPP 33 #define CFDP_CHUNK_HPP
void removeFromFirst(FileSize size)
Remove a specified size from the first chunk.
void reset()
Reset the chunk list to empty state.
C++ class encapsulation of CFDP chunk list operations.
FileSize size
The size of the chunk.
void add(FileSize offset, FileSize size)
Add a chunk (file segment) to the list.
FileSize offset
The start offset of the chunk within the file.
U32 FileSize
File size and offset type.
void(*)(const Chunk *chunk, void *opaque) GapComputeCallback
Callback type for gap computation.
CfdpChunkList(ChunkIdx maxChunks, Chunk *chunkMem)
Constructor - initializes chunk list with pre-allocated memory.
RateGroupDivider component implementation.
ChunkIdx getMaxChunks() const
Get the maximum number of chunks this list can hold.
const Chunk * getFirstChunk() const
Get the first chunk in the list.
static FileSize CfdpChunkMax(FileSize a, FileSize b)
Selects the larger of the two passed-in offsets.
ChunkIdx getCount() const
Get the current number of chunks in the list.
U32 computeGaps(ChunkIdx maxGaps, FileSize total, FileSize start, GapComputeCallback callback, void *opaque) const
Compute gaps between chunks and invoke callback for each.
Pairs an offset with a size to identify a specific piece of a file.