RawConfigurationBlockV0.h
Go to the documentation of this file.
1 #ifndef RAWCONFIGURATIONBLOCKV0_H
2 #define RAWCONFIGURATIONBLOCKV0_H
3 #include "DAQDataFormats/RawConfigurationHeader.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 CURRENT_CLASS_VERSION 0
16 #define CURRENT_FIELDS_SUB_NAMESPACE configurationblock
17 #include "DAQDataFormats/DataFormatLast.inc"
18 
19 // forward declarations
20 namespace daqdataformats {
21  class RawConfigurationTail;
22  class RawConfigurationSystemID;
23 }
24 
25 namespace daqdataformats {
26 
28  static const uint32_t ConfigurationBlockMaximumSize = 10000;
29  }
30 
31 namespace VERSION_NAMESPACE {
35  }// end of namespace configurationblock
36 
37 
38  class RawConfigurationBlock : public PREVIOUS_VERSION_CLASS_NAME {
39 
40  public:
41  RawConfigurationBlock (const version_t); ///< The default constructor
43  ~RawConfigurationBlock(); ///< Destructor
44 
45  void init ();
47  void print (std::ostream& os=std::cout) const;
48  uint32_t sizeofdata () const { return _header->getConfigurationBlockSize(); }
49  bool setBufferSource (const void* pointer);
50 
51  using PREVIOUS_VERSION_CLASS_NAME::readData; // unhide the reset of the readData methods
52  void* readData(const void*);
53 
54  INIT_FIRST(close , , bool, const bool);
57  INIT_FIRST(getTailConst , const, daqdataformats::RawConfigurationTail*, );
59  INIT_FIRST(getSystemIDConst , const, daqdataformats::RawConfigurationSystemID*, );
60  INIT_FIRST(getSystemIDWithInput , , daqdataformats::RawConfigurationSystemID*, const uint32_t);
61  INIT_FIRST(getSystemIDConstWithInput , const, daqdataformats::RawConfigurationSystemID*, const uint32_t);
62  INIT_FIRST(setFloatingSystemIDToBufferSource, const, bool, const void*);
63  INIT_FIRST(setFloatingSystemID , const, bool, const uint32_t);
64  INIT_FIRST(addSystemID , , bool, const void*);
65 
66  INIT_FIRST(getMarkerHi1 , const, uint32_t, );
67  INIT_FIRST(getMarkerHi2 , const, uint32_t, );
68  INIT_FIRST(getMarkerLo1 , const, uint32_t, );
69  INIT_FIRST(getMarkerLo2 , const, uint32_t, );
70  INIT_FIRST(getConfigurationVersion , const, uint32_t, );
71  INIT_FIRST(getConfigurationBlockSize, const, uint32_t, );
72  INIT_FIRST(getSystemNumber , const, uint32_t, );
73 
74  INIT_FIRST_GET_AND_SET(DetectorID , uint32_t);
75  INIT_FIRST_GET_AND_SET(ResourceManagerID, uint32_t);
76  INIT_FIRST_GET_AND_SET(RunNumber , uint32_t);
77  INIT_FIRST_GET_AND_SET(RunType , uint32_t);
78  INIT_FIRST_GET_AND_SET(Partition , uint32_t);
79  INIT_FIRST_GET_AND_SET(Subrun , uint32_t);
80  INIT_FIRST_GET_AND_SET(SystemVersionIDX , uint32_t);
81 
82  protected:
83 
84  /// Setting versions
85  bool setVersions() {
86  _version_ConfigurationSystemID = CURRENT_FIELDS_SUB_NAMESPACE::Version_ConfigurationSystemID;
88  return true;
89  }
90 
91  uint32_t getPredefinedSize() const {return 1;}
92 
93  protected:
95  daqdataformats::RawConfigurationHeader* _header; //<! Header. Embedded into the InternalBuffer of the RawConfigurationBlockV0
96  mutable daqdataformats::RawConfigurationSystemID* _floatingSystemID; //<! Configuration system ID
97  mutable int _floatingSystemIDNumber;//<! Floating system ID Number
98 
101 
102  };
103 
104 
105 }} // END NAMESPCE daqdataformats
106 #endif /* RAWCONFIGURATIONBLOCKV0_H */
#define VERSION_NAMESPACE
#define INIT_FIRST(FUNC, CONSTNESS, OUTPUT_UNITS,...)
Definition: Macros.h:239
#define INIT_FIRST_GET_AND_SET(FUNC, UNITS)
Definition: Macros.h:245
bool print
OStream cout
Definition: OStream.cxx:6
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.
#define CURRENT_FIELDS_SUB_NAMESPACE
daqdataformats::RawConfigurationSystemID * _floatingSystemID
procfile close()