Jpp  debug
the software that should make you happy
JTripod.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JTRIPOD__
2 #define __JDETECTOR__JTRIPOD__
3 
4 #include <istream>
5 #include <ostream>
6 
7 #include "JLang/JObjectID.hh"
8 #include "JUTM/JUTMPosition.hh"
9 #include "JIO/JSerialisable.hh"
10 
11 
12 /**
13  * \file
14  *
15  * Data structure for tripod.
16  * \author mdejong
17  */
18 namespace JDETECTOR {}
19 namespace JPP { using namespace JDETECTOR; }
20 
21 namespace JDETECTOR {
22 
23  using JLANG::JObjectID;
24  using JUTM::JUTMPosition;
25  using JIO::JReader;
26  using JIO::JWriter;
27 
28 
29  /**
30  * Data structure for tripod.
31  */
32  class JTripod :
33  public JObjectID,
34  public JUTMPosition
35  {
36  public:
37  /**
38  * Default constructor.
39  */
41  {}
42 
43 
44  /**
45  * Constructor.
46  *
47  * \param id identifier
48  * \param position UTM positiom
49  */
50  JTripod(const int id,
51  const JUTMPosition& position) :
52  JObjectID(id),
53  JUTMPosition(position)
54  {}
55 
56 
57  /**
58  * Read tripod from input.
59  *
60  * \param in input stream
61  * \param tripod tripod
62  * \return input stream
63  */
64  friend inline std::istream& operator>>(std::istream& in, JTripod& tripod)
65  {
66  in >> static_cast<JObjectID&> (tripod);
67  in >> static_cast<JUTMPosition&>(tripod);
68 
69  return in;
70  }
71 
72 
73  /**
74  * Write tripod to output.
75  *
76  * \param out output stream
77  * \param tripod tripod
78  * \return output stream
79  */
80  friend inline std::ostream& operator<<(std::ostream& out, const JTripod& tripod)
81  {
82  out << static_cast<const JObjectID&> (tripod);
83  out << ' ';
84  out << static_cast<const JUTMPosition&>(tripod);
85 
86  return out;
87  }
88 
89 
90  /**
91  * Read tripod from input.
92  *
93  * \param in reader
94  * \param tripod tripod
95  * \return reader
96  */
97  friend inline JReader& operator>>(JReader& in, JTripod& tripod)
98  {
99  in >> static_cast<JObjectID&> (tripod);
100  in >> static_cast<JUTMPosition&>(tripod);
101 
102  return in;
103  }
104 
105 
106  /**
107  * Write tripod to output.
108  *
109  * \param out writer
110  * \param tripod tripod
111  * \return writer
112  */
113  friend inline JWriter& operator<<(JWriter& out, const JTripod& tripod)
114  {
115  out << static_cast<const JObjectID&> (tripod);
116  out << static_cast<const JUTMPosition&>(tripod);
117 
118  return out;
119  }
120  };
121 }
122 
123 #endif
Data structure for tripod.
Definition: JTripod.hh:35
friend JWriter & operator<<(JWriter &out, const JTripod &tripod)
Write tripod to output.
Definition: JTripod.hh:113
JTripod(const int id, const JUTMPosition &position)
Constructor.
Definition: JTripod.hh:50
friend std::ostream & operator<<(std::ostream &out, const JTripod &tripod)
Write tripod to output.
Definition: JTripod.hh:80
friend std::istream & operator>>(std::istream &in, JTripod &tripod)
Read tripod from input.
Definition: JTripod.hh:64
friend JReader & operator>>(JReader &in, JTripod &tripod)
Read tripod from input.
Definition: JTripod.hh:97
JTripod()
Default constructor.
Definition: JTripod.hh:40
Interface for binary input.
Interface for binary output.
Auxiliary class for object identification.
Definition: JObjectID.hh:25
Data structure for UTM position.
Definition: JUTMPosition.hh:38
file Auxiliary data structures and methods for detector calibration.
Definition: JAnchor.hh:12
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).