Jpp  18.0.1-rc.2
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JAcoustics/JCounter.hh
Go to the documentation of this file.
1 #ifndef __JACOUSTICS__JCOUNTER__
2 #define __JACOUSTICS__JCOUNTER__
3 
4 #include <TROOT.h>
5 #include <TObject.h>
6 
7 #include "JIO/JSerialisable.hh"
8 
9 
10 /**
11  * \file
12  *
13  * Acoustic counter.
14  * \author mdejong
15  */
16 namespace JACOUSTICS {}
17 namespace JPP { using namespace JACOUSTICS; }
18 
19 namespace JACOUSTICS {
20 
21  using JIO::JReader;
22  using JIO::JWriter;
23 
24  /**
25  * Acoustic counter.
26  */
27  struct JCounter {
28  /**
29  * Default constructor.
30  */
32  counter(0)
33  {}
34 
35 
36  /**
37  * Constructor.
38  *
39  * \param counter counter
40  */
41  JCounter(const int counter) :
42  counter(counter)
43  {}
44 
45 
46  /**
47  * Get counter.
48  *
49  * \return counter
50  */
51  int getCounter() const
52  {
53  return counter;
54  }
55 
56 
57  /**
58  * Read counter from input.
59  *
60  * \param in reader
61  * \param object counter
62  * \return reader
63  */
64  friend inline JReader& operator>>(JReader& in, JCounter& object)
65  {
66  in >> object.counter;
67 
68  return in;
69  }
70 
71 
72  /**
73  * Write counter to output.
74  *
75  * \param out writer
76  * \param object counter
77  * \return writer
78  */
79  friend inline JWriter& operator<<(JWriter& out, const JCounter& object)
80  {
81  out << object.counter;
82 
83  return out;
84  }
85 
86  ClassDefNV(JCounter, 1);
87 
88  protected:
89  int counter;
90  };
91 
92 
93  /**
94  * Less-than operator for two counters.
95  *
96  * \param first first counter
97  * \param second second counter
98  * \return true if first counter less than second; else false
99  */
100  static inline bool operator<(const JCounter& first, const JCounter& second)
101  {
102  return first.getCounter() < second.getCounter();
103  }
104 
105 
106  /**
107  * Equals operator for two counters.
108  *
109  * \param first first counter
110  * \param second second counter
111  * \return true if first counter equal to second; else false
112  */
113  static inline bool operator==(const JCounter& first, const JCounter& second)
114  {
115  return first.getCounter() == second.getCounter();
116  }
117 }
118 
119 #endif
Interface for binary output.
friend JReader & operator>>(JReader &in, JCounter &object)
Read counter from input.
Acoustic counter.
bool operator<(const Head &first, const Head &second)
Less than operator.
Definition: JHead.hh:1799
int getCounter() const
Get counter.
JCounter()
Default constructor.
ClassDefNV(JCounter, 1)
then echo The file $DIR KM3NeT_00000001_00000000 root already please rename or remove it first
friend JWriter & operator<<(JWriter &out, const JCounter &object)
Write counter to output.
bool operator==(Packet const &p, ID const &id)
JCounter(const int counter)
Constructor.
Interface for binary input.
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 JAcoustics sh $DETECTOR_ID source JAcousticsToolkit sh CHECK_EXIT_CODE typeset A EMITTERS get_tripods $WORKDIR tripod txt EMITTERS get_transmitters $WORKDIR transmitter txt EMITTERS for EMITTER in
Definition: JCanberra.sh:46