XCube Stream Reader SDK
|
00001 00008 #ifndef __IDXFILEFORMAT__H__ 00009 #define __IDXFILEFORMAT__H__ 00010 00011 #include "xcTypes.h" 00012 00013 namespace x3c { 00014 namespace indexer { 00015 00016 /* 00017 ** Version info 00018 */ 00019 const UINT16 INDEX_FILE_VERSION_MAJOR = 1; 00020 const UINT16 INDEX_FILE_VERSION_MINOR = 0; 00021 00025 const UINT32 INDEX_MAGIC_COOKIE = 0xa5b4c3d2; 00026 const UINT32 TRAILER_MAGIC_COOKIE = 0xcafebabe; 00027 const std::string INDEX_FILE_EXT = "idx"; 00028 00029 typedef struct _IndexRecord 00030 { 00031 UINT64 timestamp; /* time stamp (seconds << 32 + nanoseconds) */ 00032 UINT64 offset; /* file offset to the x3c header, not the pay load */ 00033 UINT64 packet_number; /* */ 00034 } IndexRecord; 00035 00036 typedef struct _IndexHeader 00037 { 00038 UINT32 magic_number; /* magic number */ 00039 UINT32 header_length; /* does not include magic_number or header length */ 00040 UINT16 version_major; /* major version number */ 00041 UINT16 version_minor; /* minor version number */ 00042 UINT64 start_time; /* seconds << 32 + nanoseconds */ 00043 UINT64 end_time; /* seconds << 32 + nanoseconds */ 00044 INT32 time_zone; /* +/- offset from GMT in seconds */ 00045 UINT64 num_index_records; /* number of index records in this file */ 00046 UINT64 total_index_count; /* the index count for the entire stream */ 00047 UINT16 num_files; /* the number of files that make up the stream */ 00048 UCHAR reserved[0x1fc2]; /* pad to 8KB - must adjust when adding fields */ 00049 UINT32 trailer_magic; /* for sanity checking the trailer */ 00050 00051 } IndexHeader; 00052 00053 typedef struct _IndexTrailer 00054 { 00055 UINT64 trailer_length; /* length of the trailer */ 00056 UINT64 timestamp; /* trailer timestamp (time witten) */ 00057 UINT64 file_record_count; /* number of index records in the file */ 00058 UINT64 file_offset; /* Offset */ 00059 UINT64 total_packets; /* */ 00060 UCHAR reserved[0x1fd4]; /* pad to 8KB - must adjust when adding fields */ 00061 UINT32 magic_number; /* trailer magic. Should always be the last field */ 00062 } IndexTrailer; 00063 00064 } /* namespace indexer */ 00065 } /* namespace x3c */ 00066 00067 #endif /* __IDXFILEFORMAT__H__ */