RawMilliSliceIndexHeader.h
Go to the documentation of this file.
1 #ifndef RAWMILLISLICEINDEXHEADER_H
2 #define RAWMILLISLICEINDEXHEADER_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/BitFields.h"
5 #include "DAQDataFormats/Macros.h"
6 
7 #include "DAQDataFormats/DataFormatFirst.inc"
8 #define CURRENT_CLASS RawMilliSliceIndexHeader
9 #define CURRENT_FIELDS_SUB_NAMESPACE millisliceindexheader
10 
11 namespace daqdataformats {
12 
13 
15 
16  static const uint32_t RAWMILLISLICEINDEXHEADER_SIZE = 1; ///< MilliSliceIndexHeader size in words
17 
19  MASK_Version = 0x00000FFF, ///< Version Mask (12 bits)
20  MASK_Closed = 0x00008000, ///< Is the MilliSliceIndex Closed (1 bit)
21  MASK_IndexNumber = 0xFFFF0000 ///< Number of indeces (16 bits)
22  };// end of MilliSliceIndexHeaderMASKS
23 
25  WORD_Version = 0, ///< Version Mask (12 bits)
26  WORD_Closed = 0, ///< Is the MilliSliceIndex Closed (1 bit)
27  WORD_IndexNumber = 0 ///< Number of indeces (16 bits)
28  };// end of MilliSliceIndexHeaderMASKS
29 
30  DEFINE_SHIFT_FROM_MASK(Version);
31  DEFINE_SHIFT_FROM_MASK(Closed);
32  DEFINE_SHIFT_FROM_MASK(IndexNumber);
33 
34  }
35 
37  public:
38  // Constructors
39  RawMilliSliceIndexHeader();//! The default constructor
40  RawMilliSliceIndexHeader(const RawMilliSliceIndexHeader& copy_in); //! Deep copy constructor
41  RawMilliSliceIndexHeader(const void* buffer);
42  /// Destructor
44 
46 
47  IMPLEMENT_GET_NOVERSION (Version, uint32_t);
48  IMPLEMENT_SET_NOVERSION_PROTECTED(Version, uint32_t);
49 
51  IMPLEMENT_GET_AND_SET_NOVERSION (IndexNumber, uint32_t);
52 
53  bool advanceIndexNumber() {return setIndexNumber(getIndexNumber() + 1);}
54 
55  private:
56 
57  version_t figureOutTheVersion(const void*) const {return 0;}
58  bool setFunctionPointers() {return true;}
59 
60 
61  };
62 } // END NAMESPCE daqdataformats
63 #endif /* RAWMILLISLICEINDEXHEADER_H */
version_t figureOutTheVersion(const void *) const
#define IMPLEMENT_GET_NOVERSION(FUNC, UNITS)
Definition: Macros.h:107
::xsd::cxx::tree::buffer< char > buffer
Definition: Database.h:179
static const uint32_t RAWMILLISLICEINDEXHEADER_SIZE
MilliSliceIndexHeader size in words.
#define CURRENT_FIELDS_SUB_NAMESPACE
#define IMPLEMENT_SET_NOVERSION_PROTECTED(FUNC, UNITS)
Definition: Macros.h:114
int32_t version_t
Definition: RawDAQData.h:72
#define IMPLEMENT_IS_AND_SET_NOVERSION(FUNC)
Definition: Macros.h:136
Class to hold the data from the FEBs in correct formats.
#define IMPLEMENT_GET_AND_SET_NOVERSION(FUNC, UNITS)
Definition: Macros.h:130