UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zqb_header.hpp
1 /* zqb_header.hpp */
2 /* $Id: zqb_header.hpp 20080 2009-12-15 15:57:52Z vlad $ */
3 #ifndef __zqb_header_hpp
4 #define __zqb_header_hpp
5 
6 #include <map>
7 
8 #include "zqb_types.h"
9 #include "zqb_hdr_def.hpp"
10 
11 
27 class ZqbHeader
28 {
29 public:
30 
33  ZqbHeader ();
34 
37  ZqbHeader (int trhdr_size, const void* trhdr = NULL);
38 
40  ZqbHeader (const ZqbHeader& hdr);
41 
43  virtual ~ZqbHeader ();
44 
45 
47  ZqbHeader& operator= (const ZqbHeader& hdr);
48 
49 
51  virtual int size () const;
52 
54  virtual void setHeader (int trhdr_size, const void* trhdr = NULL);
55 
57  virtual void setHeader (const void* trhdr);
58 
59 
60  /*
61  * Comparison
62  */
63 
65  virtual void resetSortOrder ();
66 
69  virtual void setSortOrder (int hwId, ZqbOrder eOrder = Z_O_ASCENT);
70 
74  virtual void setSortOrder (int hwId1, ZqbOrder eOrder1,
75  int hwId2, ZqbOrder eOrder2);
76 
78  virtual void setSortOrder (int hwId1, ZqbOrder eOrder1,
79  int hwId2, ZqbOrder eOrder2,
80  int hwId3, ZqbOrder eOrder3);
81 
83  virtual bool operator< (const ZqbHeader& hdr) const;
84 
86  static bool compareLess (const ZqbHeader* hdr1,
87  const ZqbHeader* hdr2);
88 
90  virtual bool operator== (const ZqbHeader& hdr) const;
91 
93  static bool compareEqual (const ZqbHeader* hdr1,
94  const ZqbHeader* hdr2);
95 
97  bool operator!= (const ZqbHeader& hdr) const {
98  return !operator==(hdr);
99  }
100 
102  static bool compareNotEqual (const ZqbHeader* hdr1,
103  const ZqbHeader* hdr2);
104 
109  int hwCompare (int hwId, const ZqbHeader& hdr,
110  double fPrec = 1e-32) const;
111 
114  static bool byteCompare (const ZqbHeader& hdr1, const ZqbHeader& hdr2);
115 
116 
117 
118  /*
119  * Access the stuff
120  */
121 
124  virtual ZqbType hdrType (int hwId) const;
125 
129  virtual const char* hdrLabel (int hwId) const;
130 
136  virtual char hdrChar (int hwId) const;
137 
142  virtual int hdrInt (int hwId) const;
143 
149  virtual float hdrFloat (int hwId) const;
150 
151 
157  virtual void hdrChar (int hwId, char cValue);
158 
163  virtual void hdrInt (int hwId, int iValue);
164 
170  virtual void hdrFloat (int hwId, float fValue);
171 
176  virtual int hwid2index (int hwId) const;
177 
178 
183  virtual int hwid2offset (int hwId) const;
184 
185 public:/* data */
186 
188  int m_nHdrSize;
189 
191  void *m_pHdr;
192 
194  static double s_fEpsilon;
195 
198 
202  mutable bool m_bUseful;
203 
204 protected:
205 
207  int m_nCriteria;
208 
210  int m_iSortHW[3];
211 
213  ZqbOrder m_eSortOrder[3];
214 
215 private:
216 
218  void *m_pHdrAllocated;
219 
220 };
221 
222 
223 #endif /* zqb_header.hpp */
ZqbOrder m_eSortOrder[3]
Definition: zqb_header.hpp:202
ZqbHeaderDef * m_pHdrDef
Definition: zqb_header.hpp:191
bool m_bUseful
Definition: zqb_header.hpp:202
virtual float hdrFloat(int hwId) const
virtual void setHeader(int trhdr_size, const void *trhdr=NULL)
static bool compareLess(const ZqbHeader *hdr1, const ZqbHeader *hdr2)
virtual int hdrInt(int hwId) const
ZqbHeader & operator=(const ZqbHeader &hdr)
static bool compareNotEqual(const ZqbHeader *hdr1, const ZqbHeader *hdr2)
Definition: zqb_header.hpp:27
void * m_pHdr
Definition: zqb_header.hpp:185
virtual char hdrChar(int hwId) const
static bool compareEqual(const ZqbHeader *hdr1, const ZqbHeader *hdr2)
virtual int hwid2index(int hwId) const
virtual bool operator<(const ZqbHeader &hdr) const
virtual void setSortOrder(int hwId, ZqbOrder eOrder=Z_O_ASCENT)
int hwCompare(int hwId, const ZqbHeader &hdr, double fPrec=1e-32) const
static double s_fEpsilon
Definition: zqb_header.hpp:188
virtual void resetSortOrder()
Definition: zqb_hdr_def.hpp:19
virtual bool operator==(const ZqbHeader &hdr) const
static bool byteCompare(const ZqbHeader &hdr1, const ZqbHeader &hdr2)
virtual int hwid2offset(int hwId) const
int m_iSortHW[3]
Definition: zqb_header.hpp:199
bool operator!=(const ZqbHeader &hdr) const
Definition: zqb_header.hpp:97
virtual int size() const
int m_nCriteria
Definition: zqb_header.hpp:196
virtual ~ZqbHeader()
int m_nHdrSize
Definition: zqb_header.hpp:182
virtual const char * hdrLabel(int hwId) const
virtual ZqbType hdrType(int hwId) const