RawTriggerRangeV0.cpp
Go to the documentation of this file.
1 #include "DAQDataFormats/RawTriggerRangeV0.h"
2 #include "DAQDataFormats/BitFields.h"
3 #include <boost/format.hpp>
4 
5 /// It is requred to
6 /// 1. include DAQDataFormats/DataFormatFirst.inc
7 /// 2. define CURRENT_CLASS
8 /// 3. define CURRENT_CLASS_VERSION for version of the class
9 /// OR define LAST_CLASS_VERSION for the main structure of the class
10 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
11 /// 5. include DAQDataFormats/DataFormatLast.inc
12 /// before the declaration of the DataFormat version class in the header.
13 #include "DAQDataFormats/DataFormatFirst.inc"
14 #define CURRENT_CLASS RawTriggerRange
15 #define CURRENT_CLASS_VERSION 0
16 #define CURRENT_FIELDS_SUB_NAMESPACE triggerrange
17 #include "DAQDataFormats/DataFormatLast.inc"
18 
19 namespace daqdataformats{
20 namespace VERSION_NAMESPACE{
21 
22 //------------------------Constructors------------------------------------------
24  PREVIOUS_VERSION_CLASS_NAME(version)
25  ,ZEROOUT_GET_AND_SET(Version )
26  ,ZEROOUT_GET_AND_SET(TriggerLength)
27 {}
28 
29 //------------------------------------------------------------------------------
31  PREVIOUS_VERSION_CLASS_NAME(copyin)
32  ,DEEPCOPY_GET_AND_SET(Version )
33  ,DEEPCOPY_GET_AND_SET(TriggerLength)
34 {}
35 
36 //------------------------------------------------------------------------------
38 
39 //------------------------------------------------------------------------------
40 // General Initialization
42  EXECUTE_FUNCTION(setVersion)(_version);
43 }
44 
45 //------------------------------------------------------------------------------
46 void RawTriggerRange::print(std::ostream& os) const {
47 
48  os<<"++++ Trigger Range ++++\n";
49  os<<boost::format("Trigger Range Version:\t%u\n")%EXECUTE_FUNCTION(getVersion)();
50  os<<boost::format("Trigger range:\t\t%u\n")%EXECUTE_FUNCTION(getTriggerLength)();
51  PRINT_ON_DEBUG("Buffer is set to "<<_Buffer);
52 }
53 
54 }}// end of namespaces
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
#define DEEPCOPY_GET_AND_SET(FUNC)
Definition: FunctionBind.h:44
#define VERSION_NAMESPACE
Class to hold the data from the global trigger range in the correct format.
#define ZEROOUT_GET_AND_SET(FUNC)
Definition: FunctionBind.h:56
void print(std::ostream &os=std::cout) const
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
const XML_Char * version
Definition: expat.h:187
int32_t version_t
Definition: RawDAQData.h:72
RawTriggerRange(const version_t)
The default constructor.
#define PRINT_ON_DEBUG(x)
Definition: RawDAQData.h:35
Class to hold the data from the FEBs in correct formats.