RawMilliSliceIndex.h
Go to the documentation of this file.
1 #ifndef RAWMILLISLICEINDEX_H
2 #define RAWMILLISLICEINDEX_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/BitFields.h"
5 #include "DAQDataFormats/Macros.h"
6 #include "DAQDataFormats/RawMilliSliceIndexHeader.h"
7 
8 #include "DAQDataFormats/DataFormatFirst.inc"
9 #define VERSION_NAMESPACE RawMilliSliceIndex
10 #define CURRENT_FIELDS_SUB_NAMESPACE rawmilliindx
11 
12 
13 namespace daqdataformats {
14 
15  static const uint32_t DEFAULT_MILLISLICEINDEX_MAXIMUM_SIZE = 2000;
16 
18  static const uint32_t MILLISLICEINDEX_SIZE = 2;
19 
21  MASK_Time = 0xFFFFFFFF, // Time length since the MilliSlice start time
22  MASK_Offset = 0x000FFFFF // Offset
23  };// end of MilliSliceIndexMASKS
24 
26  WORD_Time = 0,
28  };// end of MilliSliceIndexWORDS
29 
31  DEFINE_SHIFT_FROM_MASK(Offset);
32  }
33 
35 
36  public:
37 
38  // Constructors
39  RawMilliSliceIndex(const uint32_t size = DEFAULT_MILLISLICEINDEX_MAXIMUM_SIZE); //! The default constructor
40  RawMilliSliceIndex(const RawMilliSliceIndex& copy_in); //! Deep copy constructor
41  RawMilliSliceIndex(const void* millisliceheader_buffer); //! Shallow copy constructor
42  /// Destructor
44 
45  void init ();
46  using RawDAQData::print;
47  void print (std::ostream& os=std::cout) const;
48  uint32_t sizeofdata () const;
49  bool setBufferSource(const void*);
51  void* readData(const void* buffer);
52 
54 
55  bool setTime (const uint32_t, const uint32_t);
56  bool setOffset(const uint32_t, const uint32_t);
57 
58  uint32_t getTime (const uint32_t) const;
59  uint32_t getOffset(const uint32_t) const;
60 
61  bool addIndex(const uint32_t, const uint32_t);
62 
63  bool setClosed(const bool);
64  bool setIndexNumber(const uint32_t);
65 
66  bool advanceIndexNumber();
67 
68  bool close();
69 
70  uint32_t getIndexNumber() const;
71  bool isClosed() const;
72 
74 
75  private:
76 
77  version_t figureOutTheVersion(const void*) const {return 0;}
78  bool setFunctionPointers() {return true;}
79 
80 
81 
82  protected:
83  daqdataformats::RawMilliSliceIndexHeader* _Header; ///< RawMilliSliceIndexHeader
84 
85  };
86 
87 
88 } // END NAMESPCE daqdataformats
89 #endif /* RAWMILLISLICEINDEX_H */
version_t figureOutTheVersion(const void *) const
::xsd::cxx::tree::buffer< char > buffer
Definition: Database.h:179
void print(std::ostream &os=std::cout) const
Method for printing the content of the Buffer.
Definition: RawDAQData.cpp:500
static const uint32_t DEFAULT_MILLISLICEINDEX_MAXIMUM_SIZE
daqdataformats::RawMilliSliceIndexHeader * _Header
RawMilliSliceIndexHeader.
bool print
OStream cout
Definition: OStream.cxx:6
void * readData(const void *buffer)
Shallow copy constructor.
Definition: RawDAQData.cpp:181
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.
daqdataformats::RawMilliSliceIndexHeader * getHeader() const
#define CURRENT_FIELDS_SUB_NAMESPACE
procfile close()