RawConfigurationTailV0.cpp
Go to the documentation of this file.
1 #include "DAQDataFormats/RawConfigurationTailV0.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 RawConfigurationTail
15 #define CURRENT_CLASS_VERSION 0
16 #define CURRENT_FIELDS_SUB_NAMESPACE rawconftail
17 #include "DAQDataFormats/DataFormatLast.inc"
18 
19 namespace daqdataformats{
20 namespace VERSION_NAMESPACE{
21 //------------------------------------------------------------------------------
22 // Default constructor
24  RawDAQData(version)
25  ,ZEROOUT_GET_AND_SET(Version)
26  ,ZEROOUT_GET_AND_SET(Reserved1)
27  ,ZEROOUT_GET_AND_SET(Reserved2)
28  ,ZEROOUT_GET_AND_SET(MarkerLo1)
29  ,ZEROOUT_GET_AND_SET(MarkerLo2)
31 {}
32 
34  RawDAQData(copyin)
35  ,DEEPCOPY_GET_AND_SET(Version)
36  ,DEEPCOPY_GET_AND_SET(Reserved1)
37  ,DEEPCOPY_GET_AND_SET(Reserved2)
38  ,DEEPCOPY_GET_AND_SET(MarkerLo1)
39  ,DEEPCOPY_GET_AND_SET(MarkerLo2)
41 {}
42 //------------------------------------------------------------------------------
43 // Destructor
45 
46 
47 //------------------------------------------------------------------------------
48 // Initialization of data members
50 
51  EXECUTE_FUNCTION(setVersion)(_version);
52 
53  // Set the Marker
56 }
57 
58 //------------------------------------------------------------------------------
59 // Printing the RawConfigurationTail structure
60 void RawConfigurationTail::print(std::ostream& os) const{
61  const uint32_t size_of_data = EXECUTE_FUNCTION(sizeofdata)();
62 
63  os<<boost::format("\n---RawConfigurationTail---------------------------------------------size = %u words\n")
64  % size_of_data;
65 
66  os<<boost::format(" MarkerLo1=%u") % EXECUTE_FUNCTION(getMarkerLo1)();
67  os<<boost::format(" MarkerLo2=%u") % EXECUTE_FUNCTION(getMarkerLo2)();
68 
69  os<<"\nRawConfigurationTail Data RAW 32bit WORDs (converted, if required, to native endian format):";
70  for(uint32_t i = 0; i < size_of_data; ++i){
71  printWord(i, false, os);
72  os<<" ";
73  }
74 
75  os<<"\nRawConfigurationTail Data RAW 32bit Bits (converted, if required, to native endian format):";
76  for(uint32_t i = 0; i < size_of_data; ++i){
77  os<<"\n ";
78  printWord(i, true, os);
79  }
80 
81 }
82 
83 }} // 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
#define ZEROOUT_GET_AND_SET(FUNC)
Definition: FunctionBind.h:56
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
Class to hold the data from the FEBs in correct formats.
RawConfigurationTail(const version_t)
The default constructor.