Jpp
JDAQAbstractPreamble.hh
Go to the documentation of this file.
1 #ifndef __JDAQABSTRACTPREAMBLE__
2 #define __JDAQABSTRACTPREAMBLE__
3 
4 #include "JDAQ/JDAQDataTypes.hh"
5 #include "JDAQ/JDAQRoot.hh"
6 
7 
8 /**
9  * \author rbruijn
10  */
11 
12 namespace KM3NETDAQ {
13 
14 
15  /**
16  * Simple datastructure for the DAQ preamble without ROOT functionality.
17  * Required for a correct calculation of the object size for I/O.
18  * JDAQPreamble derives from this and adds I/O and ROOT functionality.
19  */
21  protected:
22  /**
23  * Constructor.
24  *
25  * \param type data type of derived class
26  */
27  template<class T>
29  length(0),
31  {}
32 
33  public:
34  /**
35  * Default constuctor
36  */
38  length(0),
39  type (0)
40  {}
41 
42 
43  /**
44  * Get length.
45  *
46  * \return number of bytes
47  */
48  int getLength() const
49  {
50  return length;
51  }
52 
53 
54  /**
55  * Get data type.
56  *
57  * \return data type
58  */
59  int getDataType() const
60  {
61  return type;
62  }
63 
64 
65  /**
66  * Get size of object.
67  *
68  * \return number of bytes
69  */
70  static int sizeOf()
71  {
72  return sizeof(int) + sizeof(int);
73  }
74 
75 
77 
78  protected:
79  int length;
80  int type;
81  };
82 }
83 
84 #endif
KM3NETDAQ::JDAQAbstractPreamble::sizeOf
static int sizeOf()
Get size of object.
Definition: JDAQAbstractPreamble.hh:70
KM3NETDAQ::JDAQAbstractPreamble::JDAQAbstractPreamble
JDAQAbstractPreamble()
Default constuctor.
Definition: JDAQAbstractPreamble.hh:37
KM3NETDAQ::JDAQAbstractPreamble::length
int length
Definition: JDAQAbstractPreamble.hh:79
KM3NETDAQ::JDAQAbstractPreamble::getLength
int getLength() const
Get length.
Definition: JDAQAbstractPreamble.hh:48
KM3NETDAQ::JDAQAbstractPreamble::getDataType
int getDataType() const
Get data type.
Definition: JDAQAbstractPreamble.hh:59
JDAQDataTypes.hh
JDAQRoot.hh
KM3NETDAQ::JDAQAbstractPreamble
Simple datastructure for the DAQ preamble without ROOT functionality.
Definition: JDAQAbstractPreamble.hh:20
KM3NETDAQ::JDAQType
Auxiliary class for a DAQ type holder.
Definition: JDAQDataTypes.hh:15
KM3NETDAQ
KM3NeT DAQ data structures and auxiliaries.
Definition: DataQueue.cc:39
KM3NETDAQ::JDAQAbstractPreamble::type
int type
Definition: JDAQAbstractPreamble.hh:80
KM3NETDAQ::JDAQAbstractPreamble::JDAQAbstractPreamble
JDAQAbstractPreamble(JDAQType< T > type)
Constructor.
Definition: JDAQAbstractPreamble.hh:28
KM3NETDAQ::JDAQAbstractPreamble::ClassDefNV
ClassDefNV(JDAQAbstractPreamble, 1)