Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JDAQSummarysliceIO.hh
Go to the documentation of this file.
1#ifndef __JDAQSUMMARYSLICE_IO__
2#define __JDAQSUMMARYSLICE_IO__
3
5
7#include "JIO/JSTDIO.hh"
8
9#include "JDAQ/JDAQSizeof.hh"
13
14/**
15 * \author mdejong
16 */
17namespace KM3NETDAQ {
18
19 /**
20 * Get size of object.
21 *
22 * \param object DAQ summary slice
23 * \return number of bytes
24 */
25 inline size_t getSizeof(const JDAQSummaryslice& object)
26 {
27 return (getSizeof<JDAQPreamble>() +
28 sizeof(Version_t) +
30 getSizeof(static_cast<const std::vector<JDAQSummaryFrame>&>(object)));
31 }
32
33
34 /**
35 * Read DAQ summary slice from input.
36 *
37 * \param in reader
38 * \param object DAQ summary slice
39 * \return reader
40 */
42 {
43 Version_t version;
44
45 object.clear();
46
47 in >> static_cast<JDAQPreamble&> (object);
48 in >> version;
49 in >> static_cast<JDAQSummarysliceHeader&> (object);
50 in >> static_cast<std::vector<JDAQSummaryFrame>&>(object);
51
52 return in;
53 }
54
55
56 /**
57 * Write DAQ summary slice to output.
58 *
59 * \param out writer
60 * \param object DAQ summary slice
61 * \return writer
62 */
63 inline JWriter& operator<<(JWriter& out, const JDAQSummaryslice& object)
64 {
65 out << JDAQPreamble::getDAQPreamble(object);
66 out << JDAQSummaryslice::Class_Version();
67 out << static_cast<const JDAQSummarysliceHeader&> (object);
68 out << static_cast<const std::vector<JDAQSummaryFrame>&>(object);
69
70 return out;
71 }
72}
73
74#endif
STD extensions for binary I/O.
Interface for binary input.
virtual void clear()
Clear status of reader.
Interface for binary output.
static JDAQPreamble getDAQPreamble(const T &object)
Get DAQ preamble.
KM3NeT DAQ data structures and auxiliaries.
Definition DataQueue.cc:39
size_t getSizeof< JDAQSummarysliceHeader >()
Get size of type.
JWriter & operator<<(JWriter &out, const JDAQChronometer &chronometer)
Write DAQ chronometer to output.
size_t getSizeof< JDAQPreamble >()
Get size of type.
JReader & operator>>(JReader &in, JDAQChronometer &chronometer)
Read DAQ chronometer from input.
size_t getSizeof()
Definition of method to get size of data type.