Jpp test-rotations-old
the software that should make you happy
Loading...
Searching...
No Matches
JTransmission_t.hh
Go to the documentation of this file.
1#ifndef __JACOUSTICS__JTRANSMISSION_T__
2#define __JACOUSTICS__JTRANSMISSION_T__
3
4#include <istream>
5#include <ostream>
6
8
9/**
10 * \file
11 *
12 * Acoustic transmission identifier.
13 * \author mdejong
14 */
15namespace JACOUSTICS {}
16namespace JPP { using namespace JACOUSTICS; }
17
18namespace JACOUSTICS {
19
21
22
23 /**
24 * Acoustic transmission identifier.
25 */
27 public JComparable<JTransmission_t>
28 {
29 /**
30 * Default constructor.
31 */
33 tx(-1),
34 rx(-1)
35 {}
36
37
38 /**
39 * Constructor.
40 *
41 * \param tx emitter identifier
42 * \param rx receiver identifier
43 */
45 const int rx) :
46 tx(tx),
47 rx(rx)
48 {}
49
50
51 /**
52 * Less than method.
53 *
54 * \param id transmission identifier
55 * \return true is this transmission identifier is less than given transmision identifier; else false
56 *
57 */
58 inline bool less(const JTransmission_t& id) const
59 {
60 if (this->tx == id.tx)
61 return this->rx < id.rx;
62 else
63 return this->tx < id.tx;
64 }
65
66
67 /**
68 * Read transmission identifier from input stream.
69 *
70 * \param in input stream
71 * \param object transmission identifier
72 * \return input stream
73 */
74 friend inline std::istream& operator>>(std::istream& in, JTransmission_t& object)
75 {
76 return in >> object.tx >> object.rx;
77 }
78
79
80 /**
81 * Write transmission identifier to output stream.
82 *
83 * \param out output stream
84 * \param object transmission identifier
85 * \return output stream
86 */
87 friend inline std::ostream& operator<<(std::ostream& out, const JTransmission_t& object)
88 {
89 return out << object.tx << ' ' << object.rx;
90 }
91
92
93 int tx; //!< emitter identifier
94 int rx; //!< receiver identifier
95 };
96}
97
98#endif
Auxiliary classes and methods for acoustic position calibration.
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Acoustic transmission identifier.
friend std::ostream & operator<<(std::ostream &out, const JTransmission_t &object)
Write transmission identifier to output stream.
friend std::istream & operator>>(std::istream &in, JTransmission_t &object)
Read transmission identifier from input stream.
JTransmission_t(const int tx, const int rx)
Constructor.
JTransmission_t()
Default constructor.
int tx
emitter identifier
bool less(const JTransmission_t &id) const
Less than method.
int rx
receiver identifier
Template definition of auxiliary base class for comparison of data structures.