#ifndef __JDAQPREAMBLE_IO__ #define __JDAQPREAMBLE_IO__ #include "km3net-dataformat/online/JDAQPreamble.hh" #include "JIO/JSerialisable.hh" /** * \author mdejong */ namespace KM3NETDAQ { /** * Get size of type. * * \return number of bytes */ template<> inline size_t getSizeof() { return (sizeof(JDAQPreamble::length) + sizeof(JDAQPreamble::type)); } /** * Read DAQ preamble from input. * * Note that JDAQAbstractPreamble::length is read first. * * \param in reader * \param preamble DAQ preamble * \return reader */ inline JReader& operator>>(JReader& in, JDAQPreamble& preamble) { in >> preamble.length; in >> preamble.type; return in; } /** * Write DAQ preamble to output. * * Note that JDAQPreamble::getSize() is written first. * * \param out writer * \param preamble DAQ preamble * \return writer */ inline JWriter& operator<<(JWriter& out, const JDAQPreamble& preamble) { out << preamble.length; out << preamble.type; return out; } } #endif