ADTF File Library
Loading...
Searching...
No Matches
indexwritetable_v201_v301.h
Go to the documentation of this file.
1
16
17#ifndef INDEX_WRITE_TABLE_V201_V301_CLASS_HEADER
18#define INDEX_WRITE_TABLE_V201_V301_CLASS_HEADER
19
21
22#include <deque>
23
24namespace ifhd
25{
26namespace v201_v301
27{
32{
33private:
34 struct IndexTable
35 {
36 IndexTable(): index_table_offset(0), index_count(0), last_index(0), index_offset(0)
37 {
38 }
39 uint32_t index_table_offset;
40 uint32_t index_count;
41 // the timestamp of the last index entry
42 timestamp_t last_index;
43 // the chunk position of the last index entry
44 uint64_t index_offset;
45 };
46
47 struct MasterIndexTable : public std::deque<ChunkRef>, public IndexTable
48 {
49 };
50
51 MasterIndexTable _master_index;
52
53 struct StreamIndexTable : public std::deque<StreamRef>, public IndexTable
54 {
55 };
56
57 StreamIndexTable _stream_index_tables[max_indexed_streams + 1];
59 timestamp_t _index_delay;
60
61public:
66 void create(timestamp_t index_delay = 1000000);
67
71 void free();
72
77 uint16_t getMaxStreamId() const;
78
84 size_t getItemCount(uint16_t stream_id) const;
85
91 uint64_t getBufferSize(uint16_t stream_id) const;
92
98 void copyToBuffer(uint16_t stream_id, void* buffer) const;
99
111 void append(uint16_t stream_id,
112 uint64_t stream_index,
113 uint64_t chunk_index,
114 uint64_t file_pos,
115 uint32_t size,
116 timestamp_t time_stamp,
117 uint32_t flags);
118
124 void remove(uint64_t chunk_index, uint16_t stream_id);
125
131 uint64_t getIndexOffset(uint16_t stream_id) const;
132
138 uint64_t getIndexTableOffset(uint16_t stream_id) const;
139
148 bool requiresIndex(uint16_t stream_id, timestamp_t time_stamp, uint32_t flags, uint64_t file_pos) const;
149};
150
151} // namespace v201_v301
152} // namespace ifhd
153#endif // _INDEX_WRITE_TABLE_V201_V301_CLASS_HEADER_
Definition indexwritetable_v201_v301.h:32
void remove(uint64_t chunk_index, uint16_t stream_id)
void create(timestamp_t index_delay=1000000)
bool requiresIndex(uint16_t stream_id, timestamp_t time_stamp, uint32_t flags, uint64_t file_pos) const
Checks if the item needs an index entry based on normal rules.
uint64_t getIndexTableOffset(uint16_t stream_id) const
uint64_t getIndexOffset(uint16_t stream_id) const
size_t getItemCount(uint16_t stream_id) const
void append(uint16_t stream_id, uint64_t stream_index, uint64_t chunk_index, uint64_t file_pos, uint32_t size, timestamp_t time_stamp, uint32_t flags)
uint64_t getBufferSize(uint16_t stream_id) const
void copyToBuffer(uint16_t stream_id, void *buffer) const
namespace for indexed file definitions in version 2.0, 2.1, 3.0 and 3.1
Definition indexedfile_types_v201_v301.h:28
namespace for IFHD File library
Definition indexedfile_types.h:30