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

#include <indexedfile_v100.h>

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

Classes

struct  TagChunkHeader
 
struct  TagDateTime
 
struct  TagFileHeader
 
struct  TagIndexBlockItem
 

Public Types

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

 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 Types

typedef struct ifhd::v100::IndexedFileV100::TagIndexBlockItem IndexBlockItem
 

Protected Member Functions

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

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?
 

Static Protected Attributes

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

Compatibility class for reading indexed files in format version 100.

Member Typedef Documentation

◆ ChunkHeader

ChunkHeader Structure

◆ DateTime

DateTime Structure

◆ FileHeader

FileHeader Structure

◆ IndexBlockItem

IndexBlockItem Structure

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
tf_chunk_time 

time format used for lookup time

See also
ifhd::v100::IndexedFileReaderV100::lookupChunkRef

Constructor & Destructor Documentation

◆ IndexedFileV100()

ifhd::v100::IndexedFileV100::IndexedFileV100 ( )

Default constructor.

◆ ~IndexedFileV100()

ifhd::v100::IndexedFileV100::~IndexedFileV100 ( )

Destructor.

Member Function Documentation

◆ allocBuffer()

void ifhd::v100::IndexedFileV100::allocBuffer ( int  size)
protected

Allocate internal buffer.

Parameters
size[in] Size of buffer.

◆ allocCache()

void ifhd::v100::IndexedFileV100::allocCache ( int  size)
protected

Allocate cache.

Parameters
size[in] Size of cache.

◆ allocHeader()

void ifhd::v100::IndexedFileV100::allocHeader ( )
protected

Allocate header.

◆ allocHeaderExtension()

void ifhd::v100::IndexedFileV100::allocHeaderExtension ( int  size)

Allocate memory for the header extension.

Parameters
size[in] The amount of memory to allocate.

◆ allocIndexBlock()

void ifhd::v100::IndexedFileV100::allocIndexBlock ( int  count = -1)
protected

Allocate index block.

Parameters
count[in] Number of entries.

◆ allocIndexTable()

void ifhd::v100::IndexedFileV100::allocIndexTable ( int  size)
protected

Allocate index table.

Parameters
size[in] Size of table.

◆ appendIndex()

void ifhd::v100::IndexedFileV100::appendIndex ( uint64_t  pos,
timestamp_t  time_stamp 
)
protected

Append index.

Parameters
pos[in] Position.
time_stamp[in] Timestamp.

◆ close()

void ifhd::v100::IndexedFileV100::close ( )

Closes the file.

◆ freeBuffer()

void ifhd::v100::IndexedFileV100::freeBuffer ( )
protected

Free internal buffer.

◆ freeCache()

void ifhd::v100::IndexedFileV100::freeCache ( )
protected

Free cache.

◆ freeHeader()

void ifhd::v100::IndexedFileV100::freeHeader ( )
protected

Free header.

◆ freeHeaderExtension()

void ifhd::v100::IndexedFileV100::freeHeaderExtension ( )

Frees memory allocated for the header extension.

◆ freeIndexTable()

void ifhd::v100::IndexedFileV100::freeIndexTable ( )
protected

Free index table.

◆ getCacheAddr()

void* ifhd::v100::IndexedFileV100::getCacheAddr ( )
protected

Retrieve cache address.

Returns
Pointer to cache.

◆ getDateTime()

DateTime ifhd::v100::IndexedFileV100::getDateTime ( )

Get the timestamp of the file.

◆ getDescription()

std::string ifhd::v100::IndexedFileV100::getDescription ( ) const

Get the description of the file.

Returns
The description of the file.

◆ getHeaderExtension()

void ifhd::v100::IndexedFileV100::getHeaderExtension ( void **  data,
int *  data_size 
)

Returns the header extension.

Parameters
data[out] This will point to the header extension.
data_size[out] The size of the header extension.

◆ getSectorSize()

int ifhd::v100::IndexedFileV100::getSectorSize ( const std::string &  filename) const
protected

Get sector size of specified file.

Parameters
filename[in] File to retrieve sector size of.
Returns
Sector size of file.

◆ initialize()

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

Internal initialization method.

◆ internalFree()

void ifhd::v100::IndexedFileV100::internalFree ( void *  memory)
protected

Internal deallocation method.

Parameters
memory[in] Pointer to memory.

◆ internalMalloc()

void* ifhd::v100::IndexedFileV100::internalMalloc ( int  size)
protected

Internal allocation method.

Parameters
size[in] Size of Allocation.
Returns
Allocated memory.

◆ setDateTime()

void ifhd::v100::IndexedFileV100::setDateTime ( const DateTime date_time)

Set the timestamp of the file.

Parameters
date_time[in] The new timestamp.

◆ setDescription()

void ifhd::v100::IndexedFileV100::setDescription ( const std::string &  description)

Sets the description of the file

Parameters
description[in] The new description.

◆ setHeaderExtension()

void ifhd::v100::IndexedFileV100::setHeaderExtension ( void *  data,
int  data_size 
)

Set the header extension.

Parameters
data[in] The new extension data.
data_size[in] The size of the extension data.

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