ADTF  3.18.2
cIndexReadTable

Class for storing an index table of an indexed file. More...

Classes

struct  tIndexTable
 
struct  tMasterIndexTable
 
struct  tStreamIndexTable
 

Public Member Functions

tResult Create (cIndexedFile *pIndexedFile)
 Allocates all neccessary resources. More...
 
tResult ReadIndexTable ()
 Build stream index tables. More...
 
tResult Free ()
 Frees all allocated resources. More...
 
const tCharGetStreamName (tUInt16 ui16StreamId)
 This function gets the name of a stream by its id. More...
 
const IIndexedFile::tStreamInfoHeader * GetStreamInfo (tUInt16 ui16StreamId)
 This function gets the information header of a stream by its id. More...
 
tTimeStamp GetFirstTime (tUInt16 ui16StreamId)
 This function gets the first time stamp of the given stream. More...
 
tTimeStamp GetLastTime (tUInt16 ui16StreamId)
 This function gets the last time stamp of the given stream. More...
 
const void * GetAdditionalStreamInfo (tUInt16 ui16StreamId)
 This function gets the additional stream information by its id. More...
 
tInt64 GetItemCount (tUInt16 ui16StreamId)
 Returns the item count of a stream. More...
 
tResult AdjustChunkHeader (IIndexedFile::tChunkHeader *pHeader)
 Adjusts the indices in the given chunk header. More...
 
tResult FillChunkHeaderFromIndex (tUInt32 ui32MasterIdx, IIndexedFile::tChunkHeader *pHeader, tInt64 *pChunkIndex, tInt64 *pChunkOffset)
 Filles a chunk header from a master index entry. More...
 
tInt32 LookupChunkRef (tUInt16 ui16StreamId, tInt64 nPos, tInt nTimeFormat, tInt64 *pChunkIndex, tInt64 *pChunkOffset, tInt64 *pEndChunkIndex, tInt64 *pMasterIndex)
 This function gets the chunk index of the given file position. More...
 
tResult FindNearestEntryWithFlags (tUInt16 ui16StreamId, tUInt64 nChunkIndex, tUInt16 nChunkFlags, tInt64 *pMasterIndex)
 Tries to find an entry before or at a given timestamp that has certain flags set. More...
 
tResult ValidateRawMasterIndex (tUInt32 ui32RefMasterTableIndex)
 Checks if the specified index is valid. More...
 

Private Types

typedef std::vector< tStreamIndexTabletStreamIndexTableVector
 

Private Member Functions

tResult SetIndexOffsetInfos (tUInt16 ui16StreamId, IIndexedFile::tAdditionalIndexInfo &rAdditionalIndexInfo)
 Sets additional index offsets. More...
 
tResult AddStreamIndexTableEntry (tUInt16 ui16StreamId, IIndexedFile::tStreamRef *pStreamRef, IIndexedFile::tStreamInfoHeader *pStreamInfo, tVoid *pAdditionalStreamInfo, tUInt64 uiCount)
 Adds a new item to the stream index table. More...
 
tResult AddMasterIndexTableEntry (void *pRefTbl, tUInt64 uiCount)
 Adds a new item to the master index table. More...
 
tResult GetStreamRef (tUInt16 ui16StreamId, tUInt32 ui32StreamIdx, IIndexedFile::tStreamRef *pStreamRef)
 This function gets a stream reference of the given id and index. More...
 

Private Attributes

tMasterIndexTable m_oMasterIndexTable
 
tStreamIndexTable m_aStreamIndexTables [MAX_INDEXED_STREAMS+1]
 
cIndexedFilem_pIndexedFile
 
IIndexedFile::tFileHeader * m_pFileHeader
 

Detailed Description

Class for storing an index table of an indexed file.

Definition at line 18 of file indexreadtable.h.

Member Function Documentation

◆ AddMasterIndexTableEntry()

tResult AddMasterIndexTableEntry ( void *  pRefTbl,
tUInt64  uiCount 
)
private

Adds a new item to the master index table.

Parameters
[in]pRefTblMaster stream reference table
[in]uiCountStream reference items count
Returns
Standard result.

◆ AddStreamIndexTableEntry()

tResult AddStreamIndexTableEntry ( tUInt16  ui16StreamId,
IIndexedFile::tStreamRef *  pStreamRef,
IIndexedFile::tStreamInfoHeader *  pStreamInfo,
tVoid pAdditionalStreamInfo,
tUInt64  uiCount 
)
private

Adds a new item to the stream index table.

Parameters
[in]ui16StreamIdThe stream id.
[in]pStreamRefStream reference item.
[in]pStreamInfoStream info header item.
[in]pAdditionalStreamInfoAdditional stream information.
[in]uiCountStream reference items count
Returns
Standard result.

◆ AdjustChunkHeader()

tResult AdjustChunkHeader ( IIndexedFile::tChunkHeader *  pHeader)

Adjusts the indices in the given chunk header.

Parameters
pHeader[inout] The header that should be adjusted
Returns
Nothing.

◆ Create()

tResult Create ( cIndexedFile pIndexedFile)

Allocates all neccessary resources.

Parameters
pIndexedFile[in] the indexed file from where the header is read from
Returns
Standard result.

◆ FillChunkHeaderFromIndex()

tResult FillChunkHeaderFromIndex ( tUInt32  ui32MasterIdx,
IIndexedFile::tChunkHeader *  pHeader,
tInt64 pChunkIndex,
tInt64 pChunkOffset 
)

Filles a chunk header from a master index entry.

Parameters
ui32MasterIdx[in] The index of the entry.
pHeader[out] The header that should be filled.
pChunkIndex[out] The index of the chunk.
pChunkOffset[out] The file offset of the chunk.
Returns
Standard result.

◆ FindNearestEntryWithFlags()

tResult FindNearestEntryWithFlags ( tUInt16  ui16StreamId,
tUInt64  nChunkIndex,
tUInt16  nChunkFlags,
tInt64 pMasterIndex 
)

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

Parameters
[in]ui16StreamIdThe stream id.
[in]nChunkIndexThe limiting chunk.
[in]nChunkFlagsThe flags to look for.
[out]pMasterIndexThe wil be set to the index in the master index table.
Returns
Standard result

◆ Free()

tResult Free ( )

Frees all allocated resources.

Returns
Standard result.

◆ GetAdditionalStreamInfo()

const void* GetAdditionalStreamInfo ( tUInt16  ui16StreamId)

This function gets the additional stream information by its id.

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

◆ GetFirstTime()

tTimeStamp GetFirstTime ( tUInt16  ui16StreamId)

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

Parameters
ui16StreamId[in] the stream Id
Returns
tTimeStamp

◆ GetItemCount()

tInt64 GetItemCount ( tUInt16  ui16StreamId)

Returns the item count of a stream.

Parameters
ui16StreamId[in] The stream id.
Returns
The item count of the stream.
This method is real-time safe.\nSee @ref page_real_time_safe.\n

◆ GetLastTime()

tTimeStamp GetLastTime ( tUInt16  ui16StreamId)

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

Parameters
ui16StreamId[in] the stream Id
Returns
tTimeStamp

◆ GetStreamInfo()

const IIndexedFile::tStreamInfoHeader* GetStreamInfo ( tUInt16  ui16StreamId)

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

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

◆ GetStreamName()

const tChar* GetStreamName ( tUInt16  ui16StreamId)

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

Parameters
ui16StreamId[in] the stream Id
Returns
Stream name

◆ GetStreamRef()

tResult GetStreamRef ( tUInt16  ui16StreamId,
tUInt32  ui32StreamIdx,
IIndexedFile::tStreamRef *  pStreamRef 
)
private

This function gets a stream reference of the given id and index.

Parameters
ui16StreamId[in] the stream Id
ui32StreamIdx[in] the stream index
pStreamRef[out] stream reference
Returns
Standard result

◆ LookupChunkRef()

tInt32 LookupChunkRef ( tUInt16  ui16StreamId,
tInt64  nPos,
tInt  nTimeFormat,
tInt64 pChunkIndex,
tInt64 pChunkOffset,
tInt64 pEndChunkIndex,
tInt64 pMasterIndex 
)

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

Parameters
[in]ui16StreamIdthe stream Id
[in]nPosthe file position
[in]nTimeFormatthe format to look for (see IIndexedFile::TF_*)
[out]pChunkIndexthe index of the chunk where the search should start.
[out]pChunkOffsetthe file offset of the chunk where the search should start.
[out]pEndChunkIndexthe nearest end chunkindex of nPos
[out]pMasterIndexthe index of the nearest master index entry.
Returns
Standard result

◆ ReadIndexTable()

tResult ReadIndexTable ( )

Build stream index tables.

Returns
Standard result

◆ SetIndexOffsetInfos()

tResult SetIndexOffsetInfos ( tUInt16  ui16StreamId,
IIndexedFile::tAdditionalIndexInfo &  rAdditionalIndexInfo 
)
private

Sets additional index offsets.

Parameters
[in]ui16StreamIdThe stream id.
[in]rAdditionalIndexInfoAdditional stream offsets.
Returns
Standard result.

◆ ValidateRawMasterIndex()

tResult ValidateRawMasterIndex ( tUInt32  ui32RefMasterTableIndex)

Checks if the specified index is valid.

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