XCube Stream Reader SDK
x3c/include/libIndexer/IdxFileFormat.h
Go to the documentation of this file.
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    = "ix1";
00028         const std::string INDEX_FILE_EXT_WDOT    = ".ix1";
00029 
00030         typedef struct _IndexRecord
00031         {
00032             UINT64 timestamp;       /* time stamp  (seconds << 32 + nanoseconds) */
00033             UINT64 offset;          /* file offset to the x3c header, not the pay load */
00034             UINT64 packet_number;   /* */
00035         } IndexRecord;
00036 
00037         typedef struct _IndexHeader
00038         {
00039             UINT32 magic_number;       /* magic number            */
00040             UINT32 header_length;      /* does not include magic_number or header length */
00041             UINT16 version_major;      /* major version number    */
00042             UINT16 version_minor;      /* minor version number    */
00043             UINT64 start_time;         /* seconds << 32 + nanoseconds */
00044             UINT64 end_time;           /* seconds << 32 + nanoseconds */
00045             INT32  time_zone;          /* +/- offset from GMT in seconds */
00046             UINT64 num_index_records;  /* number of index records in this file   */
00047             UINT64 total_index_count;  /* the index count for the entire stream */
00048             UINT16 num_files;          /* the number of files that make up the stream */
00049             UCHAR  reserved[0x1fc2];   /* pad to 8KB - must adjust when adding fields */
00050             UINT32 trailer_magic;      /* for sanity checking the trailer */
00051 
00052         } IndexHeader;
00053 
00054         typedef struct _IndexTrailer
00055         {
00056             UINT64 trailer_length;     /* length of the trailer */
00057             UINT64 timestamp;          /* trailer timestamp (time witten) */
00058             UINT64 file_record_count;  /* number of index records in the file */ 
00059             UINT64 file_offset;        /* Offset */ 
00060             UINT64 total_packets;      /* */
00061             UCHAR  reserved[0x1fd4];   /* pad to 8KB - must adjust when adding fields */
00062             UINT32 magic_number;       /* trailer magic. Should always be the last field */
00063         } IndexTrailer;
00064 
00065     }   /* namespace indexer */
00066 }  /* namespace x3c */
00067 
00068 #endif   /* __IDXFILEFORMAT__H__ */
 All Classes Files Functions Variables Typedefs Friends Defines