Tezzeret  1
Tezzeret
GmGenericData.hpp
1 #ifndef GMGENERICDATA_HPP_
2 #define GMGENERICDATA_HPP_
3 
4 #include <geotypes.hpp>
5 
6 #ifndef GMMETA_HPP_
7 #include <GmMeta.hpp>
8 #endif
9 
10 #include <GmError.hpp>
11 
12 // ============= Metadata IDs ==================
13 // ===== This is the authority for generic data types.
14 // =============================================
15 
16 // GM_GEN_APP_ID_PACKET is the data type for a packet that begins
17 // with a header of type GmAppIdPacketHeader
18 #define GM_GEN_APP_ID_PACKET (GM_DATA_DOMAIN_GENERAL | 0x01)
19 
20 /* Will be data type in packet of type GmRemoteTimeSynchPacket, for
21  * application synchronization (what this means is up to the application)
22  * of a remote record in milliseconds, and some other global count. */
23 #define GM_GEN_APP_MILLISECOND_TO_PPS_SYNCH (GM_DATA_DOMAIN_GENERAL | 0x02)
24 
25 /**************************************************************************/
26 /* A record of this type is placed at the beginning of binary data files. */
27 /**************************************************************************/
28 
29 #define GM_GEN_APP_DATASET_ID_HEADER (GM_DATA_DOMAIN_GENERAL | 0x03)
30 
31 
32 #define GM_GEN_APP_MACHINE_ID 0x01
33 
34 #ifndef DWORD
35 typedef unsigned long DWORD;
36 #endif
37 
38 namespace Geometrics {
39 
41  {
42  public:
43  // m_dwRecordType will have the value GM_GEN_APP_ID_PACKET
44  DWORD m_dwRecordType;
45 
46  // m_ui32RecordSize will have the value of the size of this header,
47  // plus the size of the nested record.
48  UInt32 m_ui32RecordSize;
49  DWORD m_dwApplicationRecordType;
50  DWORD m_dwApplicationId;
51  };
52 
54  {
55  public:
56  UInt32 m_ui32SynchType;
57  UInt32 m_ui32RemoteId;
58  uint64_t m_ui64RemoteCountAtSynch;
59  uint64_t m_ui64GlobalCountAtSynch;
60  };
61 
63  {
64  public:
65  UInt32 m_ui32SynchType;
66  UInt32 m_ui32RecordSize;
67  };
68 
69  // -------- Structure to index a packet --------------------
71  {
72  public:
73  uint64_t m_ui64PacketIndex;
74  };
75 
76  /**************************************************************/
77  /* Class for a generic indexed string. The string length */
78  /* is arbitrary - instances should always be allocated with */
79  /* malloc or new char[], to the custom length of the field. */
80  /* The purpose of this class is to provide a memory layout */
81  /* for the headers of strings. */
82  /**************************************************************/
84  {
85  public:
86  GeoDataIndex m_piIndex;
87  char m_strData[1000];
88  };
89 
90  /*************************************************************/
91  /* See notes about GeoIndexedString */
92  /*************************************************************/
94  {
95  public:
96  DWORD m_dwRecordType;
97  UInt32 m_ui32RecordSize;
98  GeoIndexedString m_gisData;
99  };
100 
102  {
103  public:
104  uint64_t m_ui64RecordId;
105  UInt32 m_ui32Flags;
106  };
107 
108  PACKED_PRAGMA
109  typedef struct PACKED_SPEC GmDatasetHeader
110  {
111  public:
112  DWORD m_dwRecordType; // offset 0, size 4 must be GM_GEN_APP_DATASET_ID_HEADER
113  UInt32 m_ui32RecordSize; // offset 4, size 4, will be the size of this record.
114  char m_strSurveyId[16]; // offset 8, size 16
115  char m_strAcquisitionId[16]; // offset 24, size 16
116  int m_iDatasetId; // offset 40, size 4
117  char m_strSerialNumber[20]; // offset 44, size 20 Serial number of the acquisition hardware
118  char m_strFirmwareVersion[20]; // offset 64, size 20
119  char m_strFirmwareName[32]; // offset 84, size 32, total record size 116
120  UInt32 m_databaseSchema; // offset 116, size 4, total record size 120
121  } GmDatasetHeader_;
122 }
123 
124 #define GM_DB_RECORD_FLAG_ACTIVE ((UInt32)(0x01))
125 #define GM_DB_RECORD_FLAG_MARK_TO_REUSE ((UInt32)(0x02))
126 
127 #endif
Definition: GmGenericData.hpp:71
Definition: GmGenericData.hpp:94
Definition: GmGenericData.hpp:84
Definition: GmGenericData.hpp:41
Definition: GmGenericData.hpp:63
Definition: GmGenericData.hpp:102
Definition: GmGenericData.hpp:54
GmApp/GmLoggingApp.hpp>
Definition: Analogs.hpp:47
Definition: GmGenericData.hpp:110