adtf_file_library  0.13.2
Classes | Public Member Functions | List of all members
ifhd::v201_v301::IndexReadTable Class Reference

#include <indexreadtable_v201_v301.h>

Public Member Functions

void create (IndexedFile *indexed_file)
 
void readIndexTable ()
 
void free ()
 
std::string getStreamName (uint16_t stream_id) const
 
bool streamExists (uint16_t stream_id) const
 Checks either a stream exists or not. More...
 
const StreamInfoHeadergetStreamInfo (uint16_t stream_id) const
 
timestamp_t getFirstTime (uint16_t stream_id) const
 
timestamp_t getLastTime (uint16_t stream_id) const
 
const void * getAdditionalStreamInfo (uint16_t stream_id) const
 
int64_t getItemCount (uint16_t stream_id) const
 
void adjustChunkHeader (ChunkHeader *header)
 
void fillChunkHeaderFromIndex (uint32_t master_idx, ChunkHeader *header, int64_t *chunk_index, int64_t *chunk_offset)
 
int64_t lookupChunkRef (uint16_t stream_id, int64_t pos, TimeFormat time_format, int64_t *chunk_index, int64_t *chunk_offset, int64_t *end_chunk_index, int64_t *master_index) const
 
bool findNearestEntryWithFlags (uint16_t stream_id, uint64_t chunk_index, uint16_t chunk_flags, uint64_t *master_index)
 
bool validateRawMasterIndex (int32_t ref_master_table_index)
 

Detailed Description

Class for storing an index table of an indexed file.

Member Function Documentation

◆ adjustChunkHeader()

void ifhd::v201_v301::IndexReadTable::adjustChunkHeader ( ChunkHeader header)

Adjusts the indices in the given chunk header

Parameters
header[inout] The header that should be adjusted

◆ create()

void ifhd::v201_v301::IndexReadTable::create ( IndexedFile indexed_file)

Allocates all neccessary resources.

Parameters
indexed_file[in] the indexed file from where the header is read from

◆ fillChunkHeaderFromIndex()

void ifhd::v201_v301::IndexReadTable::fillChunkHeaderFromIndex ( uint32_t  master_idx,
ChunkHeader header,
int64_t *  chunk_index,
int64_t *  chunk_offset 
)

Filles a chunk header from a master index entry

Parameters
master_idx[in] The index of the entry.
header[out] The header that should be filled.
chunk_index[out] The index of the chunk.
chunk_offset[out] The file offset of the chunk.

◆ findNearestEntryWithFlags()

bool ifhd::v201_v301::IndexReadTable::findNearestEntryWithFlags ( uint16_t  stream_id,
uint64_t  chunk_index,
uint16_t  chunk_flags,
uint64_t *  master_index 
)

Tries to find an entry before or at a given timestamp that has certain flags set.

Parameters
[in]stream_idThe stream id.
[in]chunk_indexThe limiting chunk.
[in]chunk_flagsThe flags to look for.
[out]master_indexThe wil be set to the index in the master index table.
Returns
Whether or not an entry was found.

◆ free()

void ifhd::v201_v301::IndexReadTable::free ( )

Frees all allocated resources.

◆ getAdditionalStreamInfo()

const void* ifhd::v201_v301::IndexReadTable::getAdditionalStreamInfo ( uint16_t  stream_id) const

This function gets the additional stream information by its id.

Parameters
stream_id[in] the stream Id
Returns
Additional stream information

◆ getFirstTime()

timestamp_t ifhd::v201_v301::IndexReadTable::getFirstTime ( uint16_t  stream_id) const

This function gets the first time stamp of the given stream.

Parameters
stream_id[in] the stream Id
Returns
timestamp_t

◆ getItemCount()

int64_t ifhd::v201_v301::IndexReadTable::getItemCount ( uint16_t  stream_id) const

Returns the item count of a stream.

Parameters
stream_id[in] The stream id.
Returns
The item count of the stream.
Remarks
implemented rt safe

◆ getLastTime()

timestamp_t ifhd::v201_v301::IndexReadTable::getLastTime ( uint16_t  stream_id) const

This function gets the last time stamp of the given stream.

Parameters
stream_id[in] the stream Id
Returns
timestamp_t

◆ getStreamInfo()

const StreamInfoHeader* ifhd::v201_v301::IndexReadTable::getStreamInfo ( uint16_t  stream_id) const

This function gets the information header of a stream by its id.

Parameters
stream_id[in] the stream Id
Returns
Stream information header

◆ getStreamName()

std::string ifhd::v201_v301::IndexReadTable::getStreamName ( uint16_t  stream_id) const

This function gets the name of a stream by its id.

Parameters
stream_id[in] the stream Id
Returns
Stream name

◆ lookupChunkRef()

int64_t ifhd::v201_v301::IndexReadTable::lookupChunkRef ( uint16_t  stream_id,
int64_t  pos,
TimeFormat  time_format,
int64_t *  chunk_index,
int64_t *  chunk_offset,
int64_t *  end_chunk_index,
int64_t *  master_index 
) const

This function gets the chunk index of the given file position.

Parameters
[in]stream_idthe stream Id
[in]posthe file position
[in]time_formatthe format to look for (see IndexedFile::TF_*)
[out]chunk_indexthe index of the chunk where the search should start.
[out]chunk_offsetthe file offset of the chunk where the search should start.
[out]end_chunk_indexthe nearest end chunkindex of pos
[out]master_indexthe index of the nearest master index entry.
Returns
Standard result

◆ readIndexTable()

void ifhd::v201_v301::IndexReadTable::readIndexTable ( )

Build stream index tables

◆ streamExists()

bool ifhd::v201_v301::IndexReadTable::streamExists ( uint16_t  stream_id) const

Checks either a stream exists or not.

Parameters
stream_idthe stream id
Return values
trueexists
falsedoes not exist

◆ validateRawMasterIndex()

bool ifhd::v201_v301::IndexReadTable::validateRawMasterIndex ( int32_t  ref_master_table_index)

Checks if the specified index is valid

Parameters
[in]ref_master_table_indexThe index to be checked
Return values
ERR_NOERRORIndex is fine
ERR_OUT_OF_RANGEIndex is not within the valid range.

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

Copyright © CARIAD SE.
Generated on Mon Jun 10 2024 by doxygen 1.9.1
GIT Commit Hash: eb3af397a6b49ad6fcad9a60d8277d909b458b48