ADTF  3.18.3
indexwritetable.h
Go to the documentation of this file.
1 
7 #ifndef _INDEX_WRITE_TABLE_CLASS_HEADER_
8 #define _INDEX_WRITE_TABLE_CLASS_HEADER_
9 
10 
11 
12 namespace A_UTILS_NS
13 {
14 
18 class DOEXPORT cIndexWriteTable
19 {
21 
22  private:
25 
26  struct tIndexTable
27  {
28  tIndexTable():nIndexTableOffset(0), nIndexCount(0), tmLastIndex(0), nIndexOffset(0) {}
29  tUInt32 nIndexTableOffset;
30  tUInt32 nIndexCount;
31  //the timestamp of the last index entry
32  tTimeStamp tmLastIndex;
33  //the chunk position of the last index entry
34  tUInt64 nIndexOffset;
35  };
36 
37  struct tMasterIndexTable: public std::deque<IIndexedFile::tChunkRef>, public tIndexTable
38  {
39  };
40 
41  tMasterIndexTable m_oMasterIndex;
42 
43  struct tStreamIndexTable: public std::deque<IIndexedFile::tStreamRef>, public tIndexTable
44  {
45  };
46 
47  tStreamIndexTable m_aStreamIndexTables[MAX_INDEXED_STREAMS + 1];
48 
49  public:
50 
56 
62 
69 
76  tInt64 GetItemCount(tUInt16 ui16StreamId);
77 
84  tInt64 GetBufferSize(tUInt16 ui16StreamId);
85 
93  tResult CopyToBuffer(tUInt16 ui16StreamId, tVoid* pvBuffer);
94 
109  tResult Append(tUInt16 ui16StreamId,
110  tUInt64 ui64StreamIndex,
111  tUInt64 ui64ChunkIndex,
112  tUInt64 nFilePos,
113  tUInt32 nSize,
114  tTimeStamp nTimeStamp,
115  tUInt32 ui32Flags,
116  tBool& bIndexEntryAppended);
117 
124  tResult Remove(tUInt64 ui64ChunkIndex, tUInt16 ui16StreamId);
125 
132 
139 };
140 
141 } // namespace
142 #endif // _INDEX_WRITE_TABLE_CLASS_HEADER_
int64_t tInt64
type definition for signed integer values (64bit) (platform and compiler independent type).
void tVoid
The tVoid is always the definition for the void (non-type).
uint16_t tUInt16
type definition for unsigned integer values (16bit) (platform and compiler independent type).
int tInt
type definition for signed integer value (platform and compiler dependent type).
bool tBool
The tBool defines the type for the Values tTrue and tFalse (platform and compiler dependent).
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
uint64_t tUInt64
type definition for unsigned integer values (64bit) (platform and compiler independent type).
Class for storing an index table of an indexed file.
tInt64 GetBufferSize(tUInt16 ui16StreamId)
Returns the buffer size of a stream.
tInt GetMaxStreamId()
Returns the biggest possible stream id.
tResult Create()
Allocates all neccessary resources.
tResult Append(tUInt16 ui16StreamId, tUInt64 ui64StreamIndex, tUInt64 ui64ChunkIndex, tUInt64 nFilePos, tUInt32 nSize, tTimeStamp nTimeStamp, tUInt32 ui32Flags, tBool &bIndexEntryAppended)
Appends a new item to the index table.
tResult Free()
Frees all allocated resources.
tResult CopyToBuffer(tUInt16 ui16StreamId, tVoid *pvBuffer)
Copys all stream data into a buffer.
tResult Remove(tUInt64 ui64ChunkIndex, tUInt16 ui16StreamId)
The method removes an index entry from the front of the tables.
static tTimeStamp m_nIndexDelay
The maximum delay betweeen indices (microseconds)
tUInt64 GetIndexOffset(tUInt16 ui16StreamId)
Returns the offset of the first stream index in the chunk headers fro the given stream.
tUInt64 GetIndexTableOffset(tUInt16 ui16StreamId)
Returns the offset of the stream table indices in the chunk header and master/stream references.
tInt64 GetItemCount(tUInt16 ui16StreamId)
Returns the item count of a stream.
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
Definition: d_ptr.h:270
#define MAX_INDEXED_STREAMS
Maximum of indexed streams.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11