Jpp  17.3.0
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JModuleAddress.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JMODULEADDRESS__
2 #define __JDETECTOR__JMODULEADDRESS__
3 
4 #include <istream>
5 #include <ostream>
6 
7 #include "JLang/JEquals.hh"
8 
9 
10 /**
11  * \author mdejong
12  */
13 
14 namespace JDETECTOR {}
15 namespace JPP { using namespace JDETECTOR; }
16 
17 namespace JDETECTOR {
18 
19  using JLANG::JEquals;
20 
21 
22  /**
23  * Address of module in detector data structure.
24  *
25  * The address of a module consists of a single integer value JModuleAddress::first
26  * which refers to the index of the module in the detector data structure.
27  *
28  * This class implements the JLANG::JEquals interface.
29  */
31  public JEquals<JModuleAddress>
32  {
33  public:
34  /**
35  * Default constructor.
36  */
38  first(-1)
39  {}
40 
41 
42  /**
43  * Constructor.
44  *
45  * \param index index
46  */
47  explicit JModuleAddress(const int index) :
48  first(index)
49  {}
50 
51 
52  /**
53  * Equal method.
54  *
55  * \param address module address
56  * \result true if this module address equal to given module address; else false
57  */
58  inline bool equals(const JModuleAddress& address) const
59  {
60  return this->first == address.first;
61  }
62 
63 
64  /**
65  * Read module address from input.
66  *
67  * \param in input stream
68  * \param object module address
69  * \return input stream
70  */
71  friend inline std::istream& operator>>(std::istream& in, JModuleAddress& object)
72  {
73  return in >> object.first;
74  }
75 
76 
77  /**
78  * Write module address to output.
79  *
80  * \param out output stream
81  * \param object module address
82  * \return output stream
83  */
84  friend inline std::ostream& operator<<(std::ostream& out, const JModuleAddress& object)
85  {
86  return out << object.first;
87  }
88 
89 
90  int first; //!< index of module in detector data structure
91  };
92 }
93 
94 #endif
JModuleAddress(const int index)
Constructor.
int first
index of module in detector data structure
friend std::istream & operator>>(std::istream &in, JModuleAddress &object)
Read module address from input.
Template definition of auxiliary base class for comparison of data structures.
Definition: JEquals.hh:24
Address of module in detector data structure.
bool equals(const JModuleAddress &address) const
Equal method.
friend std::ostream & operator<<(std::ostream &out, const JModuleAddress &object)
Write module address to output.
JModuleAddress()
Default constructor.
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