RawConfigurationNameV0.h
Go to the documentation of this file.
1 #ifndef RAWCONFIGURATIONNAMEV0_H
2 #define RAWCONFIGURATIONNAMEV0_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/Macros.h"
5 #include "DAQDataFormats/BitFields.h"
6 
7 /// It is requred to
8 /// 1. include DAQDataFormats/DataFormatFirst.inc
9 /// 2. define CURRENT_CLASS
10 /// 3. define CURRENT_CLASS_VERSION for version of the class
11 /// OR define LAST_CLASS_VERSION for the main structure of the class
12 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
13 /// 5. include DAQDataFormats/DataFormatLast.inc
14 /// before the declaration of the DataFormat version class in the header.
15 #include "DAQDataFormats/DataFormatFirst.inc"
16 #define CURRENT_CLASS RawConfigurationName
17 #define CURRENT_CLASS_VERSION 0
18 #define CURRENT_FIELDS_SUB_NAMESPACE rawconfname
19 #include "DAQDataFormats/DataFormatLast.inc"
20 
21 namespace daqdataformats {
22 
23 namespace VERSION_NAMESPACE {
25 
27  MASK_Version = 0x00000FFF, //! Version number for the RawConfigurationNameV0 class (first of them) (12 bits)
28  MASK_Size = 0xFFFFF000, //! Size of the Name in words
29  MASK_Char1 = 0xFF000000, //! Character 1 (8 bits)
30  MASK_Char2 = 0x00FF0000, //! Character 1 (8 bits)
31  MASK_Char3 = 0x0000FF00, //! Character 1 (8 bits)
32  MASK_Char4 = 0x000000FF //! Character 1 (8 bits)
33  };
34 
36  WORD_Version = 0, //! Version number for the RawConfigurationNameV0 class (first of them) (12 bits)
37  WORD_Size = 0, //! Size of the Name in words
38  WORD_Char = 1 //! Character 1 (8 bits)
39  };
40 
41  DEFINE_SHIFT_FROM_MASK(Version);
47 
48  }// end of namespace rawconfhdr
49 
50 
51 
52  class RawConfigurationName : public PREVIOUS_VERSION_CLASS_NAME {
53 
54  public:
55  /// Constructors
56  RawConfigurationName (const version_t); ///< The default constructor
58  ~RawConfigurationName(); ///< Destructor
59 
60  void init ();
62  void print (std::ostream& os=std::cout) const;
63  uint32_t sizeofdata () const;
64  bool setBufferSource(const void* pointer);
65 
66  using PREVIOUS_VERSION_CLASS_NAME::readData; // unhide the reset of the readData methods
67  void* readData(const void*);
68 
69  IMPLEMENT_FIRST_GET_AND_SET(Version, uint32_t);
70  IMPLEMENT_FIRST_GET_AND_SET(Size , uint32_t);
71 
72  INIT_FIRST(getHeaderSize , const, uint32_t, );
73 
74  INIT_FIRST(getName , const, uint32_t, std::string&);
75  INIT_FIRST(setName , , uint32_t, const std::string&);
76 
77  INIT_FIRST(getChar1, const, uint32_t, const uint32_t);
78  INIT_FIRST(setChar1, , bool , const uint32_t, const uint32_t);
79  INIT_FIRST(getChar2, const, uint32_t, const uint32_t);
80  INIT_FIRST(setChar2, , bool , const uint32_t, const uint32_t);
81  INIT_FIRST(getChar3, const, uint32_t, const uint32_t);
82  INIT_FIRST(setChar3, , bool , const uint32_t, const uint32_t);
83  INIT_FIRST(getChar4, const, uint32_t, const uint32_t);
84  INIT_FIRST(setChar4, , bool , const uint32_t, const uint32_t);
85 
86  protected:
88 
89 
90  };// end of class definition
91 }} // END NAMESPCE daqdataformats
92 #endif /* RAWCONFIGURATIONNAMEV0_H */
Version number for the RawConfigurationNameV0 class (first of them) (12 bits)
#define VERSION_NAMESPACE
#define INIT_FIRST(FUNC, CONSTNESS, OUTPUT_UNITS,...)
Definition: Macros.h:239
#define IMPLEMENT_FIRST_GET_AND_SET(FUNC, UNITS)
Definition: Macros.h:171
bool print
OStream cout
Definition: OStream.cxx:6
#define CURRENT_FIELDS_SUB_NAMESPACE
::xsd::cxx::tree::string< char, simple_type > string
Definition: Database.h:154
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.
Version number for the RawConfigurationNameV0 class (first of them) (12 bits)