Jpp  15.0.1-rc.2-highQE
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDAQSummarysliceIO.hh
Go to the documentation of this file.
1 #ifndef __JDAQSUMMARYSLICE_IO__
2 #define __JDAQSUMMARYSLICE_IO__
3 
5 
6 #include "JIO/JSerialisable.hh"
7 #include "JIO/JSTDIO.hh"
8 
9 #include "JDAQ/JDAQSizeof.hh"
10 #include "JDAQ/JDAQPreambleIO.hh"
13 
14 /**
15  * \author mdejong
16  */
17 namespace 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
Interface for binary output.
JWriter & operator<<(JWriter &out, const JDAQChronometer &chronometer)
Write DAQ chronometer to output.
size_t getSizeof< JDAQSummarysliceHeader >()
Get size of type.
static JDAQPreamble getDAQPreamble(const T &object)
Get DAQ preamble.
Definition: JDAQPreamble.hh:76
Interface for binary input.
JReader & operator>>(JReader &in, JDAQChronometer &chronometer)
Read DAQ chronometer from input.
size_t getSizeof< JDAQPreamble >()
Get size of type.
then fatal Wrong number of arguments fi set_variable DETECTOR $argv[1] set_variable INPUT_FILE $argv[2] eval JPrintDetector a $DETECTOR O IDENTIFIER eval JPrintDetector a $DETECTOR O SUMMARY source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
size_t getSizeof(const JDAQEvent &object)
Get size of object.
Definition: JDAQEventIO.hh:26
version
Definition: JCalibratePMT.sh:7
STD extensions for binary I/O.