adtf_file_library  0.13.2
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ifhd::v100::IndexedFileReaderV100 Class Reference

#include <indexedfilereader_v100.h>

Inheritance diagram for ifhd::v100::IndexedFileReaderV100:
[legend]
Collaboration diagram for ifhd::v100::IndexedFileReaderV100:
[legend]

Public Types

enum  { flag_none = 0x0 , flag_disable_file_system_cache = 0x1 }
 
- Public Types inherited from ifhd::v100::IndexedFileV100
enum  { tf_chunk_index = 1 , tf_chunk_time = 2 }
 
typedef struct ifhd::v100::IndexedFileV100::TagDateTime DateTime
 
typedef struct ifhd::v100::IndexedFileV100::TagFileHeader FileHeader
 
typedef struct ifhd::v100::IndexedFileV100::TagChunkHeader ChunkHeader
 

Public Member Functions

 IndexedFileReaderV100 ()
 
 ~IndexedFileReaderV100 ()
 
void attach (FileHeader *file_header, utils5ext::File *file, uint32_t flags=0)
 
void detach ()
 
void reset ()
 
int64_t seek (int64_t position, int time_format, uint32_t flags=0)
 
int64_t seekFlags (uint32_t flags, ChunkHeader **chunk)
 
int64_t getCurrentPos (int time_format) const
 
int64_t setCurrentPos (int64_t position, int time_format)
 
void queryChunkInfo (ChunkHeader **chunk_info)
 
void readChunk (void **data)
 
void skipChunk ()
 
void readNextChunk (ChunkHeader **chunk_info, void **data)
 
int64_t getFilePos () const
 
int64_t getChunkCount () const
 
int64_t getIndexCount () const
 
timestamp_t getDuration () const
 
uint32_t getVersionId () const
 
int64_t internalGetIndex () const
 
FileHeaderinternalGetFileHeader () const
 
- Public Member Functions inherited from ifhd::v100::IndexedFileV100
 IndexedFileV100 ()
 
 ~IndexedFileV100 ()
 
void close ()
 
void setDescription (const std::string &description)
 
std::string getDescription () const
 
void setDateTime (const DateTime &date_time)
 
DateTime getDateTime ()
 
void allocHeaderExtension (int size)
 
void freeHeaderExtension ()
 
void getHeaderExtension (void **data, int *data_size)
 
void setHeaderExtension (void *data, int data_size)
 

Protected Member Functions

void initialize ()
 
void readFileHeader ()
 
void readFileHeaderExt ()
 
void readIndexTable ()
 
- Protected Member Functions inherited from ifhd::v100::IndexedFileV100
void initialize ()
 
void allocBuffer (int size)
 
void freeBuffer ()
 
void allocIndexTable (int size)
 
void freeIndexTable ()
 
void appendIndex (uint64_t pos, timestamp_t time_stamp)
 
void allocIndexBlock (int count=-1)
 
void allocHeader ()
 
void freeHeader ()
 
void allocCache (int size)
 
void freeCache ()
 
void * getCacheAddr ()
 
int getSectorSize (const std::string &filename) const
 
void * internalMalloc (int size)
 
void internalFree (void *memory)
 

Protected Attributes

uint32_t _flags
 flag value to attach
 
ChunkHeader_index_table
 index table
 
int _index_table_size
 size of index table
 
int64_t _end_of_data_marker
 endmarker for data
 
- Protected Attributes inherited from ifhd::v100::IndexedFileV100
bool _attached
 File attached?
 
int _sector_size
 Sector size.
 
utils5ext::File_file
 File pointer.
 
int64_t _index
 Current index.
 
int64_t _file_pos
 Current file position.
 
uint8_t * _buffer
 Internal buffer.
 
int _buffer_size
 Buffer size.
 
IndexBlockItem_index_blocks
 Pointer to index blocks.
 
IndexBlockItem_active_index_block
 Pointer to current index block.
 
FileHeader_file_header
 File header.
 
void * _header_extension
 Header extension.
 
void * _cache
 Pointer to cache.
 
int _cache_size
 Cache size.
 
bool _write_mode
 Write mode enabled?
 

Additional Inherited Members

- Protected Types inherited from ifhd::v100::IndexedFileV100
typedef struct ifhd::v100::IndexedFileV100::TagIndexBlockItem IndexBlockItem
 
- Static Protected Attributes inherited from ifhd::v100::IndexedFileV100
static int _default_block_size
 Default block size.
 
static int _default_cache_size
 Default cache size.
 
static int _index_table_cluster_size
 Size of index table clusters.
 

Detailed Description

Class for reading indexed file in version 100

Constructor & Destructor Documentation

◆ IndexedFileReaderV100()

ifhd::v100::IndexedFileReaderV100::IndexedFileReaderV100 ( )

Default constructor.

◆ ~IndexedFileReaderV100()

ifhd::v100::IndexedFileReaderV100::~IndexedFileReaderV100 ( )

Destructor.

Member Function Documentation

◆ attach()

void ifhd::v100::IndexedFileReaderV100::attach ( FileHeader file_header,
utils5ext::File file,
uint32_t  flags = 0 
)

Attaches the reader to an already opened file.

Parameters
file_header[in] The file header.
file[in] The file.
flags[in] Unused.

◆ detach()

void ifhd::v100::IndexedFileReaderV100::detach ( )

Detaches the reader from a file.

◆ getChunkCount()

int64_t ifhd::v100::IndexedFileReaderV100::getChunkCount ( ) const

Returns the number of chunks of the current file

Returns
Number of chunks

◆ getCurrentPos()

int64_t ifhd::v100::IndexedFileReaderV100::getCurrentPos ( int  time_format) const

Returns the current file position (Index or TimeStamp)

Parameters
time_formatFormat of position (TF_ChunkTime / TF_ChunkIndex);
Returns
Current Position

◆ getDuration()

timestamp_t ifhd::v100::IndexedFileReaderV100::getDuration ( ) const

Returns the duration of the current file [microsec]

Returns
File duration

◆ getFilePos()

int64_t ifhd::v100::IndexedFileReaderV100::getFilePos ( ) const

Returns the current index of the IndexTable

Returns
Index

◆ getIndexCount()

int64_t ifhd::v100::IndexedFileReaderV100::getIndexCount ( ) const

Returns the number of indexes of the current file

Returns
Number of indexes.

◆ getVersionId()

uint32_t ifhd::v100::IndexedFileReaderV100::getVersionId ( ) const

Returns the Version ID of the current file

Returns
Version ID

◆ initialize()

void ifhd::v100::IndexedFileReaderV100::initialize ( )
protected

internal initialize

◆ internalGetFileHeader()

FileHeader* ifhd::v100::IndexedFileReaderV100::internalGetFileHeader ( ) const

get the internal file header pointer

Returns
pointer to the internal file header

◆ internalGetIndex()

int64_t ifhd::v100::IndexedFileReaderV100::internalGetIndex ( ) const

Get the internal current index

Returns
current index

◆ queryChunkInfo()

void ifhd::v100::IndexedFileReaderV100::queryChunkInfo ( ChunkHeader **  chunk_info)

Returns the current ChunkInfo from IndexTable

Parameters
chunk_info[out] Current chunk info struct

◆ readChunk()

void ifhd::v100::IndexedFileReaderV100::readChunk ( void **  data)

Reads and returns the next Chunk and increments the IndexTable index

Parameters
data[out] Current chunk data

◆ readFileHeader()

void ifhd::v100::IndexedFileReaderV100::readFileHeader ( )
protected

read the file header

◆ readFileHeaderExt()

void ifhd::v100::IndexedFileReaderV100::readFileHeaderExt ( )
protected

read file header extension

◆ readIndexTable()

void ifhd::v100::IndexedFileReaderV100::readIndexTable ( )
protected

read the index table

◆ readNextChunk()

void ifhd::v100::IndexedFileReaderV100::readNextChunk ( ChunkHeader **  chunk_info,
void **  data 
)

Reads and returns the next Chunk and ChunkInfo struct and increments the IndexTable index

Parameters
chunk_info[out] Current chunk info
data[out] Current chunk data

◆ reset()

void ifhd::v100::IndexedFileReaderV100::reset ( )

Resets the file to the beginning of data

◆ seek()

int64_t ifhd::v100::IndexedFileReaderV100::seek ( int64_t  position,
int  time_format,
uint32_t  flags = 0 
)

Sets the file position to the Chunk of index and returns the respective ChunkInfo

Parameters
positionNew file position to set
time_formattime format (time or index)
flagsflags

◆ seekFlags()

int64_t ifhd::v100::IndexedFileReaderV100::seekFlags ( uint32_t  flags,
ChunkHeader **  chunk 
)

Increments the file index until seeked chunk flags found

Parameters
flagsFlags for seeking
chunkReturns the chunk header of the next chunk with the flags (see IndexedFileV100::SeekFlags)
Returns
Current Index

◆ setCurrentPos()

int64_t ifhd::v100::IndexedFileReaderV100::setCurrentPos ( int64_t  position,
int  time_format 
)

Sets the file position by Index or by TimeStamp

Parameters
positionNew file position
time_formatFormat of position (TF_ChunkTime / TF_ChunkIndex);
Returns
New Index

◆ skipChunk()

void ifhd::v100::IndexedFileReaderV100::skipChunk ( )

Skips the next Chunk by incrementing the IndexTable index and setting the new FilePosition


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