RawSummaryDroppedMicroblockV0.h
Go to the documentation of this file.
1 #ifndef RAWSUMMARYDROPPEDMICROBLOCKV0_H
2 #define RAWSUMMARYDROPPEDMICROBLOCKV0_H
3 
4 #include "DAQDataFormats/RawDAQData.h"
5 #include "DAQDataFormats/Macros.h"
6 #include "DAQDataFormats/BitFields.h"
7 
8 /// It is requred to
9 /// 1. include DAQDataFormats/DataFormatFirst.inc
10 /// 2. define CURRENT_CLASS
11 /// 3. define CURRENT_CLASS_VERSION for version of the class
12 /// OR define LAST_CLASS_VERSION for the main structure of the class
13 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
14 /// 5. include DAQDataFormats/DataFormatLast.inc
15 /// before the declaration of the DataFormat version class in the header.
16 #include "DAQDataFormats/DataFormatFirst.inc"
17 #define CURRENT_CLASS RawSummaryDroppedMicroblock
18 #define CURRENT_CLASS_VERSION 0
19 #define CURRENT_FIELDS_SUB_NAMESPACE summarydroppedmicroblock
20 #include "DAQDataFormats/DataFormatLast.inc"
21 
22 namespace daqdataformats {
23 
24  namespace VERSION_NAMESPACE {
25 
27 
28  static const uint32_t SUMMARYDROPPEDMICROBLOCK_SIZE = 5;
29 
31  MASK_TimeStampLow = 0xFFFFFFFF,
32  MASK_TimeStampHigh = 0x00FFFFFF,
33  MASK_Version = 0xFF000000,
34  MASK_TimeWindow_sec = 0xFFF00000,
35  MASK_TimeWindow_usec = 0x000FFFFF,
37  };
38 
42  WORD_Version = 1,
46  };
47 
48  DEFINE_SHIFT_FROM_MASK(TimeStampLow);
49  DEFINE_SHIFT_FROM_MASK(TimeStampHigh);
50  DEFINE_SHIFT_FROM_MASK(Version);
51  DEFINE_SHIFT_FROM_MASK(TimeWindow_sec);
52  DEFINE_SHIFT_FROM_MASK(TimeWindow_usec);
53  DEFINE_SHIFT_FROM_MASK(NumDroppedMicroblocks);
54 
55  }// end of namespace summarydroppedmicroblock
56 
57  class RawSummaryDroppedMicroblock: public PREVIOUS_VERSION_CLASS_NAME {
58 
59  public:
60 
61  RawSummaryDroppedMicroblock (const version_t); ///< The default constructor
63  ~RawSummaryDroppedMicroblock (); ///< Destructor
64 
65  void init ();
67  void print (std::ostream& os=std::cout) const;
70  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
71 
72  protected:
73 
74  IMPLEMENT_FIRST_GET_AND_SET(Version, uint32_t);
75  IMPLEMENT_FIRST_GET_AND_SET(TimeStampLow, uint32_t);
76  IMPLEMENT_FIRST_GET_AND_SET(TimeStampHigh, uint32_t);
77  IMPLEMENT_FIRST_GET_AND_SET(TimeWindow_sec, uint32_t);
78  IMPLEMENT_FIRST_GET_AND_SET(TimeWindow_usec, uint32_t);
79  IMPLEMENT_FIRST_GET_AND_SET(NumDroppedMicroblocks, uint32_t);
80 
81  INIT_FIRST(getTimeStamp, const, uint64_t, );
82  INIT_FIRST(setTimeStamp, , bool , const uint64_t );
83 
84  INIT_FIRST(getTimeWindowTvUsec, const, suseconds_t, );
85  INIT_FIRST(setTimeWindowTvUsec, , bool, const suseconds_t );
86  INIT_FIRST(getTimeWindowTvSec, const, time_t, );
87  INIT_FIRST(setTimeWindowTvSec, , bool, const time_t );
88  INIT_FIRST(getTimeWindowTv, const, timeval, );
89  INIT_FIRST(setTimeWindowTv, , bool, const timeval );
90  };
91 
92 
93  }
94 } // END NAMESPACE daqdataformats
95 
96 #endif /* RAWSUMMARYDROPPEDMICROBLOCKV0_H */
void * readDataGeneral(const void *buffer)
General ReadData method when the sizeofdata is known.
Definition: RawDAQData.cpp:186
#define VERSION_NAMESPACE
#define CURRENT_FIELDS_SUB_NAMESPACE
#define INIT_FIRST(FUNC, CONSTNESS, OUTPUT_UNITS,...)
Definition: Macros.h:239
#define IMPLEMENT_FIRST_GET_AND_SET(FUNC, UNITS)
Definition: Macros.h:171
bool print
OStream cout
Definition: OStream.cxx:6
void * readData(const void *buffer)
Shallow copy constructor.
Definition: RawDAQData.cpp:181
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.