ADTF File Library
Loading...
Searching...
No Matches
ifhd::v201_v301::IndexWriteTable Class Reference

#include <indexwritetable_v201_v301.h>

Public Member Functions

void create (timestamp_t index_delay=1000000)
 
void free ()
 
uint16_t getMaxStreamId () const
 
size_t getItemCount (uint16_t stream_id) const
 
uint64_t getBufferSize (uint16_t stream_id) const
 
void copyToBuffer (uint16_t stream_id, void *buffer) const
 
void append (uint16_t stream_id, uint64_t stream_index, uint64_t chunk_index, uint64_t file_pos, uint32_t size, timestamp_t time_stamp, uint32_t flags)
 
void remove (uint64_t chunk_index, uint16_t stream_id)
 
uint64_t getIndexOffset (uint16_t stream_id) const
 
uint64_t getIndexTableOffset (uint16_t stream_id) const
 
bool requiresIndex (uint16_t stream_id, timestamp_t time_stamp, uint32_t flags, uint64_t file_pos) const
 Checks if the item needs an index entry based on normal rules.
 

Detailed Description

Class for storing an index table of an indexed file.

Member Function Documentation

◆ append()

void ifhd::v201_v301::IndexWriteTable::append ( uint16_t stream_id,
uint64_t stream_index,
uint64_t chunk_index,
uint64_t file_pos,
uint32_t size,
timestamp_t time_stamp,
uint32_t flags )

Appends a new item to the index table.

Parameters
stream_idThe stream id.
stream_indexThe stream index.
chunk_indexThe chunk index.
file_posThe file position.
sizeThe size of the item.
time_stampThe timestamp.
flagsappend flags, see ChunkHeader

◆ copyToBuffer()

void ifhd::v201_v301::IndexWriteTable::copyToBuffer ( uint16_t stream_id,
void * buffer ) const

Copys all stream data into a buffer. No buffer overflow checking is done!

Parameters
[in]stream_idthe stream id.
[out]bufferThe buffer that is to be filled.

◆ create()

void ifhd::v201_v301::IndexWriteTable::create ( timestamp_t index_delay = 1000000)

Allocates all neccessary resources.

Parameters
index_delayThe maximum delay between indices.

◆ free()

void ifhd::v201_v301::IndexWriteTable::free ( )

Frees all allocated resources.

◆ getBufferSize()

uint64_t ifhd::v201_v301::IndexWriteTable::getBufferSize ( uint16_t stream_id) const

Returns the buffer size of a stream.

Parameters
stream_idThe stream id.
Returns
The buffer size of the stream.

◆ getIndexOffset()

uint64_t ifhd::v201_v301::IndexWriteTable::getIndexOffset ( uint16_t stream_id) const

Returns the offset of the first stream index in the chunk headers fro the given stream.

Parameters
stream_idThe stream id.
Returns
the offset of the first stream index in the chunk headers fro the given stream.

◆ getIndexTableOffset()

uint64_t ifhd::v201_v301::IndexWriteTable::getIndexTableOffset ( uint16_t stream_id) const

Returns the offset of the stream table indices in the chunk header and master/stream references.

Parameters
stream_idThe stream id.
Returns
the offset of the stream table indices in the chunk header and master/stream references..

◆ getItemCount()

size_t ifhd::v201_v301::IndexWriteTable::getItemCount ( uint16_t stream_id) const

Returns the item count of a stream.

Parameters
stream_idThe stream id.
Returns
The item count of the stream.

◆ getMaxStreamId()

uint16_t ifhd::v201_v301::IndexWriteTable::getMaxStreamId ( ) const

Returns the biggest possible stream id.

Returns
The biggest possible stream id.

◆ remove()

void ifhd::v201_v301::IndexWriteTable::remove ( uint64_t chunk_index,
uint16_t stream_id )

The method removes an index entry from the front of the tables.

Parameters
chunk_indexthe chunk index
stream_idthe stream id

◆ requiresIndex()

bool ifhd::v201_v301::IndexWriteTable::requiresIndex ( uint16_t stream_id,
timestamp_t time_stamp,
uint32_t flags,
uint64_t file_pos ) const

Checks if the item needs an index entry based on normal rules.

Parameters
stream_idThe stream id.
time_stampThe timestamp.
flagsappend flags, see ChunkHeader
file_posThe file position - same as in append function.
Returns
If the index is required.

The documentation for this class was generated from the following file: