#ifndef __JDAQABSTRACTPREAMBLE__ #define __JDAQABSTRACTPREAMBLE__ #include "JDAQ/JDAQDataTypes.hh" #include "JDAQ/JDAQRoot.hh" namespace KM3NETDAQ { /** * Simple datastructure for the DAQ preamble without ROOT functionality. * Required for a correct calculation of the object size for I/O. * JDAQPreamble derives from this and adds I/O and ROOT functionality. */ class JDAQAbstractPreamble { protected: /** * Constructor. * * \param type data type of derived class */ template JDAQAbstractPreamble(JLANG::JType type) : length(0), type (KM3NETDAQ::getDataType(type)) {} public: /** * Default constuctor */ JDAQAbstractPreamble() : length(0), type (0) {} /** * Get length. * * \return number of bytes */ int getLength() const { return length; } /** * Get data type. * * \return data type */ int getDataType() const { return type; } /** * Get size of object. * * \return number of bytes */ static int sizeOf() { return sizeof(int) + sizeof(int); } ClassDefNV(JDAQAbstractPreamble,1); protected: int length; int type; }; } #endif