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::v110::IndexedFileV110 Class Reference

#include <indexedfile_v110.h>

Inheritance diagram for ifhd::v110::IndexedFileV110:
[legend]
Collaboration diagram for ifhd::v110::IndexedFileV110:
[legend]

Classes

struct  FileExtensionStruct
 File extension structure. More...
 
struct  TagChunkHeader
 
struct  TagChunkRef
 
struct  TagFileExtension
 
struct  TagFileHeader
 
struct  TagIndexBlockItem
 

Public Types

enum  { tf_chunk_index = 1 , tf_chunk_time = 2 }
 
enum  SeekFlags { sf_default = 0x0 , sf_keydata = 0x1 }
 SeekFlags. More...
 
enum  OpenMode { om_none = 0x0 , om_query_info = 0x4 }
 OpenMode. More...
 
using DateTime = v100::IndexedFileV100::DateTime
 
typedef struct ifhd::v110::IndexedFileV110::TagFileHeader FileHeader
 
typedef struct ifhd::v110::IndexedFileV110::TagFileExtension FileExtension
 
typedef struct ifhd::v110::IndexedFileV110::TagChunkHeader ChunkHeader
 
typedef struct ifhd::v110::IndexedFileV110::TagChunkRef ChunkRef
 
typedef struct ifhd::v110::IndexedFileV110::TagIndexBlockItem IndexBlockItem
 

Public Member Functions

 IndexedFileV110 ()
 
 ~IndexedFileV110 ()
 
void close ()
 
void setDescription (const std::string &description)
 
std::string getDescription () const
 
void setDateTime (const a_util::datetime::DateTime *date_time)
 
void getDateTime (a_util::datetime::DateTime *date_time) const
 
int getExtensionCount () const
 
bool findExtension (const std::string &identifier, FileExtension **extension_info, void **data) const
 
void getExtension (int index, FileExtension **extension_info, void **data) const
 
void appendExtension (const std::string &identifier, const void *data, int data_size, uint32_t type_id=0, uint32_t version_id=0)
 
void appendExtension (const void *data, const FileExtension *extension_info)
 
void freeExtensions ()
 
void getHeader (FileHeader **file_header) const
 

Protected Types

typedef std::list< FileExtensionStruct * > FileExtensionList
 file extension reference type
 

Protected Member Functions

void initialize ()
 
void allocBuffer (int size)
 
void freeBuffer ()
 
void appendIndex (uint64_t pos, timestamp_t time_stamp)
 
void allocIndexBlock (int count=-1)
 
void freeIndexTable ()
 
void allocHeader ()
 
void freeHeader ()
 
void allocExtensionPage (utils5ext::FileSize size, void **data)
 
void allocCache (int size)
 
void freeCache ()
 
void * getCacheAddr ()
 
int getSectorSize (const a_util::filesystem::Path &filename) const
 
void * internalMalloc (int size)
 
void internalFree (void *memory)
 

Protected Attributes

int _sector_size
 current sector size in bytes
 
utils5ext::File_file
 the file pointer
 
FilePos _file_pos
 current file pos
 
uint8_t * _buffer
 current data buffer reference
 
int _buffer_size
 current data buffer size in bytes
 
IndexBlockItem_index_blocks
 indexed table reference
 
IndexBlockItem_active_index_block
 current index block
 
FileHeader_file_header
 file header
 
FileExtensionList _extensions
 file extension references
 
void * _cache
 current cache buffer
 
int _cache_size
 current cache size
 
bool _write_mode
 writing or reading mode
 

Static Protected Attributes

static int default_block_size
 default block size in bytes
 
static int default_cache_size
 default cache size in bytes
 
static int index_table_cluster_size
 default index table allocation at once size in bytes
 

Detailed Description

Indexed File for version V1.1

Member Typedef Documentation

◆ ChunkHeader

header for chunks

Remarks
the header is filled up to 32 bytes. To be 16 byte alligned

◆ ChunkRef

header for a chunk reference

◆ DateTime

DateTime Structure

◆ FileExtension

FileExtension Structure

◆ FileHeader

FileHeader Structure

◆ IndexBlockItem

IndexBlockItem Structure

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
tf_chunk_index 

time format used for lookup index

See also
ifhd::v110::IndexedFileReaderV110::lookupChunkRef
tf_chunk_time 

time format used for lookup time

See also
ifhd::v110::IndexedFileReaderV110::lookupChunkRef

◆ OpenMode

OpenMode.

Enumerator
om_none 

default open mode

om_query_info 

open mode to get file header only

◆ SeekFlags

SeekFlags.

Enumerator
sf_default 

default seek flag for all kind of data

sf_keydata 

seek flag for indexed data only

Constructor & Destructor Documentation

◆ IndexedFileV110()

ifhd::v110::IndexedFileV110::IndexedFileV110 ( )

Default constructor.

◆ ~IndexedFileV110()

ifhd::v110::IndexedFileV110::~IndexedFileV110 ( )

Destructor.

Member Function Documentation

◆ allocBuffer()

void ifhd::v110::IndexedFileV110::allocBuffer ( int  size)
protected

Allocate internal buffer.

Parameters
size[in] Size of buffer.

◆ allocCache()

void ifhd::v110::IndexedFileV110::allocCache ( int  size)
protected

Allocate cache.

Parameters
size[in] Size of cache.

◆ allocExtensionPage()

void ifhd::v110::IndexedFileV110::allocExtensionPage ( utils5ext::FileSize  size,
void **  data 
)
protected

Allocate extension page.

Parameters
size[in] Size of extension page.
data[in] Pointer to data.

◆ allocHeader()

void ifhd::v110::IndexedFileV110::allocHeader ( )
protected

Allocate header.

◆ allocIndexBlock()

void ifhd::v110::IndexedFileV110::allocIndexBlock ( int  count = -1)
protected

Allocate index block.

Parameters
count[in] Number of entries.

◆ appendExtension() [1/2]

void ifhd::v110::IndexedFileV110::appendExtension ( const std::string &  identifier,
const void *  data,
int  data_size,
uint32_t  type_id = 0,
uint32_t  version_id = 0 
)

Adds a new extension to the file.

Parameters
identifier[in] The identifier of the extension.
data[in] The extension data.
data_size[in] The data size.
type_id[in] An optional type id
version_id[in] An optional version id

◆ appendExtension() [2/2]

void ifhd::v110::IndexedFileV110::appendExtension ( const void *  data,
const FileExtension extension_info 
)

Adds a new extension to the file.

Parameters
data[in] The extension data.
extension_info[in] The extension info.

◆ appendIndex()

void ifhd::v110::IndexedFileV110::appendIndex ( uint64_t  pos,
timestamp_t  time_stamp 
)
protected

Append index.

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

◆ close()

void ifhd::v110::IndexedFileV110::close ( )

Closes the file.

◆ findExtension()

bool ifhd::v110::IndexedFileV110::findExtension ( const std::string &  identifier,
FileExtension **  extension_info,
void **  data 
) const

Finds an extension with a specific identifier.

Parameters
identifier[in] The identifier of the extension
extension_info[out] The extension info data.
data[out] The extension data.
Returns
Whether the extension was found or not.

◆ freeBuffer()

void ifhd::v110::IndexedFileV110::freeBuffer ( )
protected

Free internal buffer.

◆ freeCache()

void ifhd::v110::IndexedFileV110::freeCache ( )
protected

Free cache.

◆ freeExtensions()

void ifhd::v110::IndexedFileV110::freeExtensions ( )

Frees all extensions.

◆ freeHeader()

void ifhd::v110::IndexedFileV110::freeHeader ( )
protected

Free header.

◆ freeIndexTable()

void ifhd::v110::IndexedFileV110::freeIndexTable ( )
protected

Free index table.

◆ getCacheAddr()

void* ifhd::v110::IndexedFileV110::getCacheAddr ( )
protected

Retrieve cache address.

Returns
Pointer to cache.

◆ getDateTime()

void ifhd::v110::IndexedFileV110::getDateTime ( a_util::datetime::DateTime *  date_time) const

Get the timestamp of the file.

Parameters
date_time[out] The timestamp of the file.

◆ getDescription()

std::string ifhd::v110::IndexedFileV110::getDescription ( ) const

Get the description of the file.

Returns
The description of the file.

◆ getExtension()

void ifhd::v110::IndexedFileV110::getExtension ( int  index,
FileExtension **  extension_info,
void **  data 
) const

Get an extension with a specific index.

Parameters
index[in] The index of the extension.
extension_info[out] The extension info data.
data[out] The extension data.

◆ getExtensionCount()

int ifhd::v110::IndexedFileV110::getExtensionCount ( ) const

Returns the amount of extensions in the file.

Returns
The amount of extensions in the file.

◆ getHeader()

void ifhd::v110::IndexedFileV110::getHeader ( FileHeader **  file_header) const

Returns the file header.

Parameters
file_header[out] Will point to the file header.

◆ getSectorSize()

int ifhd::v110::IndexedFileV110::getSectorSize ( const a_util::filesystem::Path &  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::v110::IndexedFileV110::initialize ( )
protected

Internal initialization method.

◆ internalFree()

void ifhd::v110::IndexedFileV110::internalFree ( void *  memory)
protected

Internal deallocation method.

Parameters
memory[in] Pointer to memory.

◆ internalMalloc()

void* ifhd::v110::IndexedFileV110::internalMalloc ( int  size)
protected

Internal allocation method.

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

◆ setDateTime()

void ifhd::v110::IndexedFileV110::setDateTime ( const a_util::datetime::DateTime *  date_time)

Set the timestamp of the file.

Parameters
date_time[in] The new timestamp.

◆ setDescription()

void ifhd::v110::IndexedFileV110::setDescription ( const std::string &  description)

Sets the description of the file

Parameters
description[in] The new description.

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