RawEvent.cpp
Go to the documentation of this file.
1 #include "DAQDataFormats/RawEvent.h"
2 #include "DAQDataFormats/DataFormatException.h"
3 
4 /// It is requred to
5 /// 1. include DAQDataFormats/DataFormatFirst.inc
6 /// 2. define CURRENT_CLASS
7 /// 3. define CURRENT_CLASS_VERSION for version of the class
8 /// OR define LAST_CLASS_VERSION for the main structure of the class
9 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
10 /// 5. include DAQDataFormats/DataFormatLast.inc
11 /// before the declaration of the DataFormat version class in the header.
12 #include "DAQDataFormats/DataFormatFirst.inc"
13 #define CURRENT_CLASS RawEvent
14 #define LAST_CLASS_VERSION 1
15 #define CURRENT_FIELDS_SUB_NAMESPACE rawevent
16 #include "DAQDataFormats/DataFormatLast.inc"
17 
18 
19 namespace daqdataformats{
20 
21 //------------------------------------------------------------------------------
22 // Default constructor
23 RawEvent::RawEvent(const uint32_t size, const version_t version):
24  PREVIOUS_VERSION_CLASS_NAME(version)
25 {
26  INITIALIZE_DEBUGGING_VARIABLES;
27  reserveInternalBuffer(size);
28  defaultConstructorFloatingSize();
29 }
30 //------------------------------------------------------------------------------
31 RawEvent::RawEvent(const RawEvent& copy_in):
32  PREVIOUS_VERSION_CLASS_NAME(copy_in)
33 {
34  INITIALIZE_DEBUGGING_VARIABLES;
35  lastOperationsInDeepCopy(copy_in);
36 }
37 
38 //------------------------------------------------------------------------------
40  PREVIOUS_VERSION_CLASS_NAME(version)
41 {
42  INITIALIZE_DEBUGGING_VARIABLES;
43  copy(buffer);
44 }
45 
46 //------------------------------------------------------------------------------
47 // Destructor
49 
50 /// All binding routines
51 #define STANDARD_ROUTINES \
52  BIND_CUSTOM_FUNCTION(nextEvent, version0, , bool, ); \
53  BIND_CUSTOM_FUNCTION(setAppropriateMCFlag , version0, , bool, const void*);\
54  BIND_CUSTOM_FUNCTION(addDataBlock , version0, , bool, const void*);\
55  BIND_CUSTOM_FUNCTION(addDataBlockWithSize , version0, , bool, const void*, const uint32_t);\
56  BIND_CUSTOM_FUNCTION(close , version0, , bool, const bool);\
57  BIND_CUSTOM_FUNCTION(setTrigger1 , version0, , bool, const daqdataformats::RawTrigger&);\
58  BIND_CUSTOM_FUNCTION(setTrigger2 , version0, , bool, const void*);\
59  BIND_CUSTOM_FUNCTION(setFloatingDataBlockToBufferSource, version0, const, bool, const void*);\
60  BIND_CUSTOM_FUNCTION(getHeader , version0, const, daqdataformats::RawEventHeader*, ); \
61  BIND_CUSTOM_FUNCTION(getTail , version0, , daqdataformats::RawEventTail*, ); \
62  BIND_CUSTOM_FUNCTION(getTrigger , version0, , daqdataformats::RawTrigger*, ); \
63  BIND_CUSTOM_FUNCTION(getFloatingDataBlock , version0, , daqdataformats::RawDataBlock*, ); \
64  BIND_CUSTOM_FUNCTION(getHeaderConst , version0, const, daqdataformats::RawEventHeader*, ); \
65  BIND_CUSTOM_FUNCTION(getTailConst , version0, const, daqdataformats::RawEventTail*, ); \
66  BIND_CUSTOM_FUNCTION(getTriggerConst , version0, const, daqdataformats::RawTrigger*, ); \
67  BIND_CUSTOM_FUNCTION(getFloatingDataBlockConst , version0, const, daqdataformats::RawDataBlock*, ); \
68  BIND_CUSTOM_FUNCTION(getHeaderMarkerLeft , version0, const, uint32_t, ); \
69  BIND_CUSTOM_FUNCTION(getHeaderMarkerRight , version0, const, uint32_t, ); \
70  BIND_CUSTOM_FUNCTION(getVersion , version0, const, uint32_t, ); \
71  BIND_CUSTOM_FUNCTION(getDataLoggerID , version0, const, uint32_t, ); \
72  BIND_CUSTOM_FUNCTION(getRunNumber , version0, const, uint32_t, ); \
73  BIND_CUSTOM_FUNCTION(getRunType , version0, const, uint32_t, ); \
74  BIND_CUSTOM_FUNCTION(getConfigIDX , version0, const, uint32_t, ); \
75  BIND_CUSTOM_FUNCTION(getPartition , version0, const, uint32_t, ); \
76  BIND_CUSTOM_FUNCTION(getSubrun , version0, const, uint32_t, ); \
77  BIND_CUSTOM_FUNCTION(getEventNumberLo , version0, const, uint32_t, ); \
78  BIND_CUSTOM_FUNCTION(getEventNumberHi , version0, const, uint32_t, ); \
79  BIND_CUSTOM_FUNCTION(getEventNumber , version0, const, uint64_t, ); \
80  BIND_CUSTOM_FUNCTION(getEventType , version0, const, uint32_t, ); \
81  BIND_CUSTOM_FUNCTION(getEventSize , version0, const, uint32_t, ); \
82  BIND_CUSTOM_FUNCTION(getDataBlockNumber , version0, const, uint32_t, ); \
83  BIND_CUSTOM_FUNCTION(isEventIncomplete , version0, const, bool, ); \
84  BIND_CUSTOM_FUNCTION(getMonteCarloFlag , version0, const, bool, ); \
85  BIND_CUSTOM_FUNCTION(isCRCCalculationUsed , version0, const, bool, ); \
86  BIND_CUSTOM_FUNCTION(setTriggerPointer , version0, , bool, const void*);\
87  BIND_CUSTOM_FUNCTION(setDataLoggerID , version0, , bool, const uint32_t);\
88  BIND_CUSTOM_FUNCTION(setRunNumber , version0, , bool, const uint32_t);\
89  BIND_CUSTOM_FUNCTION(setRunType , version0, , bool, const uint32_t);\
90  BIND_CUSTOM_FUNCTION(setConfigIDX , version0, , bool, const uint32_t);\
91  BIND_CUSTOM_FUNCTION(setPartition , version0, , bool, const uint32_t);\
92  BIND_CUSTOM_FUNCTION(setSubrun , version0, , bool, const uint32_t);\
93  BIND_CUSTOM_FUNCTION(setEventNumberLo , version0, , bool, const uint32_t);\
94  BIND_CUSTOM_FUNCTION(setEventNumberHi , version0, , bool, const uint32_t);\
95  BIND_CUSTOM_FUNCTION(setEventNumber , version0, , bool, const uint64_t);\
96  BIND_CUSTOM_FUNCTION(setEventType , version0, , bool, const uint32_t);\
97  BIND_CUSTOM_FUNCTION(setEventIncomplete , version0, , bool, const bool);\
98  BIND_CUSTOM_FUNCTION(setMonteCarloFlag , version0, , bool, const bool);\
99  BIND_CUSTOM_FUNCTION(setFloatingDataBlock , version0, const, bool, const uint32_t);\
100  BIND_STADARD_FUNCTIONS;\
101  _tailSize = getTailSize(_version);
102 
103 #include "DAQDataFormats/setFunctionPointers_template.inc"
104 
105 
106 }
::xsd::cxx::tree::buffer< char > buffer
Definition: Database.h:179
RawEvent(const uint32_t buffersize=DEFAULT_EVENT_SIZE, const version_t version=raweventhdr::RAWEVENTHEADER_LATEST_VERSION)
Constructors.
Definition: RawEvent.cpp:23
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.
~RawEvent()
Destructor.
Definition: RawEvent.cpp:48