RawConfigurationBlock.cpp
Go to the documentation of this file.
1 #include "DAQDataFormats/RawConfigurationBlock.h"
2 #include "DAQDataFormats/RawConfigurationTail.h"
3 #include "DAQDataFormats/DataFormatException.h"
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 RawConfigurationBlock
15 #define LAST_CLASS_VERSION 1
16 #define CURRENT_FIELDS_SUB_NAMESPACE configurationblock
17 #include "DAQDataFormats/DataFormatLast.inc"
18 
19 namespace daqdataformats{
20 
21 //------------------------------------------------------------------------------
22 // Default constructor
24  PREVIOUS_VERSION_CLASS_NAME(version)
25 {
26  INITIALIZE_DEBUGGING_VARIABLES;
28  defaultConstructorFloatingSize();
29 
30  _tail = new RawConfigurationTail(_version_ConfigurationTail);
31 }
32 
33 //------------------------------------------------------------------------------
35  PREVIOUS_VERSION_CLASS_NAME(copy_in)
36 {
37  INITIALIZE_DEBUGGING_VARIABLES;
38  lastOperationsInDeepCopy(copy_in);
39  _tail = new RawConfigurationTail(_version_ConfigurationTail);
40 }
41 
42 //------------------------------------------------------------------------------
43 RawConfigurationBlock::RawConfigurationBlock(const void* datablock_buffer, const version_t version):
44  PREVIOUS_VERSION_CLASS_NAME(version)
45 {
46  INITIALIZE_DEBUGGING_VARIABLES;
48  copy(datablock_buffer);
49 
50  _tail = new RawConfigurationTail(_version_ConfigurationTail);
51 }
52 
53 //------------------------------------------------------------------------------
54 // Destructor
56 
57 
58 //------------------------------------------------------------------------------
59 /// All binding routines
60 #define STANDARD_ROUTINES \
61  BIND_CUSTOM_FUNCTION(close , version0, , bool, const bool);\
62  BIND_CUSTOM_FUNCTION(getHeader , version0, , daqdataformats::RawConfigurationHeader*, ); \
63  BIND_CUSTOM_FUNCTION(getTail , version0, , daqdataformats::RawConfigurationTail*, ); \
64  BIND_CUSTOM_FUNCTION(getTailConst , version0, const, daqdataformats::RawConfigurationTail*, ); \
65  BIND_CUSTOM_FUNCTION(getSystemID , version0, , daqdataformats::RawConfigurationSystemID*, ); \
66  BIND_CUSTOM_FUNCTION(getSystemIDConst , version0, const, daqdataformats::RawConfigurationSystemID*, ); \
67  BIND_CUSTOM_FUNCTION(getSystemIDWithInput , version0, , daqdataformats::RawConfigurationSystemID*, const uint32_t);\
68  BIND_CUSTOM_FUNCTION(getSystemIDConstWithInput , version0, const, daqdataformats::RawConfigurationSystemID*, const uint32_t);\
69  BIND_CUSTOM_FUNCTION(setFloatingSystemIDToBufferSource, version0, const, bool, const void*);\
70  BIND_CUSTOM_FUNCTION(setFloatingSystemID , version0, const, bool, const uint32_t);\
71  BIND_CUSTOM_FUNCTION(addSystemID , version0, , bool, const void*);\
72  BIND_CUSTOM_FUNCTION(getMarkerHi1 , version0, const, uint32_t, ); \
73  BIND_CUSTOM_FUNCTION(getMarkerHi2 , version0, const, uint32_t, ); \
74  BIND_CUSTOM_FUNCTION(getMarkerLo1 , version0, const, uint32_t, ); \
75  BIND_CUSTOM_FUNCTION(getMarkerLo2 , version0, const, uint32_t, ); \
76  BIND_CUSTOM_FUNCTION(getConfigurationVersion , version0, const, uint32_t, ); \
77  BIND_CUSTOM_FUNCTION(getConfigurationBlockSize , version0, const, uint32_t, ); \
78  BIND_CUSTOM_FUNCTION(getSystemNumber , version0, const, uint32_t, ); \
79  BIND_GET_AND_SET(DetectorID , version0, uint32_t);\
80  BIND_GET_AND_SET(ResourceManagerID, version0, uint32_t);\
81  BIND_GET_AND_SET(RunNumber , version0, uint32_t);\
82  BIND_GET_AND_SET(RunType , version0, uint32_t);\
83  BIND_GET_AND_SET(Partition , version0, uint32_t);\
84  BIND_GET_AND_SET(Subrun , version0, uint32_t);\
85  BIND_GET_AND_SET(SystemVersionIDX , version0, uint32_t);\
86  BIND_STADARD_FUNCTIONS; \
87  CURRENT_VERSION_NAMESPACE::CURRENT_CLASS::setVersions();
88 
89 #include "DAQDataFormats/setFunctionPointers_template.inc"
90 
91 }// end of namespaces
RawConfigurationBlock(const version_t version=rawconfhdr::RAWCONFIGURATIONBLOCKHEADER_LATEST_VERSION)
Constructors.
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.