MicroBlockConstructor.cpp
Go to the documentation of this file.
1 /*
2  * File: MicroBlockConstructor.cpp
3  * Author: denis
4  *
5  * Created on September 20, 2012, 2:18 PM
6  */
7 
8 #include <DAQDataFormats/RawMicroBlock.h>
9 #include <DAQDataFormats/RawMicroBlockHeader.h>
10 
12 
13 /// It is requred to
14 /// 1. include DAQDataFormats/DataFormatFirst.inc
15 /// 2. define CURRENT_CLASS
16 /// 3. define CURRENT_CLASS_VERSION for version of the class
17 /// OR define LAST_CLASS_VERSION for the main structure of the class
18 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
19 /// 5. include DAQDataFormats/DataFormatLast.inc
20 /// before the declaration of the DataFormat version class in the header.
21 #include "DAQDataFormats/DataFormatFirst.inc"
22 #define CURRENT_CLASS RawMicroBlock
23 #define LAST_CLASS_VERSION 1
24 #define CURRENT_FIELDS_SUB_NAMESPACE microblock
25 #include "DAQDataFormats/DataFormatLast.inc"
26 
27 namespace daqdataformats {
29 
32 {
33 }
35 
36 //------------------------------------------------------------------------------
39  fillDataFormat(out);
40  return out;
41 }
42 
43 //------------------------------------------------------------------------------
45  RawMicroBlock* microblock = new daqdataformats::RawMicroBlock(ver);
46 
50 
51  microblock->setMicroBlockHeader(milli->getBuffer());
52  microblock->setMicroSlice(micro->getBuffer());
53 
54  delete milli;
55  delete micro;
56  }
57 
58  return microblock;
59 }
60 
61 //------------------------------------------------------------------------------
64 
67 
68  microblock->setMicroBlockHeader(milli->getBuffer());
69  microblock->setMicroSlice(micro->getBuffer());
70 
71  delete milli;
72  delete micro;
73 
74  return true;
75 }
76 
77 }}// end of namespaces
daqdataformats::RawDAQData * getFilledDataFormat(const version_t) const
#define CURRENT_FIELDS_SUB_NAMESPACE
daqdataformats::RawDAQData * getFilledDataFormat(const daqdataformats::version_t) const
static const version_t RAWMICROBLOCK_LATEST_VERSION
daqdataformats::RawDAQData * getEmptyDataFormat(const daqdataformats::version_t) const
method to create an empty dataformat with a given version
daqdataformats::RawDAQData * getEmptyDataFormat(const version_t) const
method to create an empty dataformat with a given version
daqdataformats::RawDAQData * getEmptyDataFormat(const daqdataformats::version_t) const
method to create an empty dataformat with a given version
void * getBuffer() const
Definition: RawDAQData.h:131
bool fillDataFormat(daqdataformats::RawDAQData *) const
method to Fill the input dataformat
Class to hold the MicroSlice data.
Definition: RawMicroSlice.h:48
int32_t version_t
Definition: RawDAQData.h:72
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
Class to hold the data from the FEBs in correct formats.
daqdataformats::RawDAQData * getFilledDataFormat(const daqdataformats::version_t) const