Jpp  18.0.0-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDAQAbstractPreamble.hh
Go to the documentation of this file.
1 #ifndef __JDAQABSTRACTPREAMBLE__
2 #define __JDAQABSTRACTPREAMBLE__
3 
6 
7 
8 /**
9  * \author rbruijn
10  */
11 
12 namespace KM3NETDAQ {
13 
14 
15  /**
16  * Simple data structure for the DAQ preamble required for a correct calculation
17  * of the object size for binary I/O.
18  *
19  * Note that JDAQPreamble derives from this and adds I/O and ROOT functionality.
20  */
22  protected:
23  /**
24  * Constructor.
25  *
26  * \param type data type of derived class
27  */
28  template<class T>
30  length(0),
31  type (KM3NETDAQ::getDataType(type))
32  {}
33 
34  public:
35  /**
36  * Default constuctor
37  */
39  length(0),
40  type (0)
41  {}
42 
43 
44  /**
45  * Get length.
46  *
47  * \return number of bytes
48  */
49  int getLength() const
50  {
51  return length;
52  }
53 
54 
55  /**
56  * Get data type.
57  *
58  * \return data type
59  */
60  int getDataType() const
61  {
62  return type;
63  }
64 
65 
67 
68  protected:
69  int length;
70  int type;
71  };
72 }
73 
74 #endif
Auxiliary class for a DAQ type holder.
int getDataType() const
Get data type.
JDAQAbstractPreamble(JDAQType< T > type)
Constructor.
int getLength() const
Get length.
Simple data structure for the DAQ preamble required for a correct calculation of the object size for ...
JDAQAbstractPreamble()
Default constuctor.
ClassDefNV(JDAQAbstractPreamble, 1)