Jpp  master_rocky-40-g5f0272dcd
the software that should make you happy
JModuleStatus.hh
Go to the documentation of this file.
1 #ifndef __JDETECTOR__JMODULESTATUS__
2 #define __JDETECTOR__JMODULESTATUS__
3 
4 #include <string>
5 #include <vector>
6 #include <map>
7 
9 
10 #include "JLang/JType.hh"
11 #include "JLang/JVectorize.hh"
12 
13 #include "Jeep/JStatus.hh"
14 
15 
16 /**
17  * \author mdejong
18  */
19 
20 namespace JDETECTOR {}
21 namespace JPP { using namespace JDETECTOR; }
22 
23 namespace JDETECTOR {
24 
25  using JLANG::JType;
26  using JEEP::JStatus;
27  using JEEP::JPutStatusBit;
28  using JEEP::JGetStatusBit;
29 
30 
31  /**
32  * Auxiliary class to map key to module status bit.
33  */
35  public JGetStatusBit
36  {
37  /**
38  * Default constructor.
39  */
41  {
42 #define MAKE_ENTRY(A) std::make_pair(#A, A)
43 
44  this->insert(MAKE_ENTRY(MODULE_DISABLE));
45  this->insert(MAKE_ENTRY(COMPASS_DISABLE));
46  this->insert(MAKE_ENTRY(HYDROPHONE_DISABLE));
47  this->insert(MAKE_ENTRY(PIEZO_DISABLE));
48  this->insert(MAKE_ENTRY(MODULE_OUT_OF_SYNC));
49 
50 #undef MAKE_ENTRY
51  }
52  };
53 
54 
55  /**
56  * Type definition to map module status bit to key.
57  */
59 
60 
61  /**
62  * Function object to map key to module status bit.
63  */
65 
66 
67  /**
68  * Function object to map module status bit to key.
69  */
71 
72 
73  /**
74  * Get module status bits.
75  *
76  * \param type type
77  * \return status bits
78  */
80  {
82  }
83 
84 
85  /**
86  * Get module status bits.
87  *
88  * \param type type
89  * \return status bits
90  */
92  {
94  }
95 
96 
97  /**
98  * Get module status bits.
99  *
100  * \return status bits
101  */
102  template<class T>
104  {
105  return getModuleStatusBits(JType<T>());
106  }
107 }
108 
109 #endif
#define MAKE_ENTRY(A)
Auxiliary methods to convert data members or return values of member methods of a set of objects to a...
static const int MODULE_OUT_OF_SYNC
Enable (disable) synchronous signal from this module if this status bit is 0 (1);.
static const int HYDROPHONE_DISABLE
Enable (disable) use of hydrophone if this status bit is 0 (1);.
static const int MODULE_DISABLE
KM3NeT Data Definitions v3.4.0-8-ge14cb17 https://git.km3net.de/common/km3net-dataformat.
static const int PIEZO_DISABLE
Enable (disable) use of piezo if this status bit is 0 (1);.
static const int COMPASS_DISABLE
Enable (disable) use of compass if this status bit is 0 (1);.
file Auxiliary data structures and methods for detector calibration.
Definition: JAnchor.hh:12
std::vector< T > getModuleStatusBits()
Get module status bits.
static const JGetModuleStatusBit getModuleStatusBit
Function object to map key to module status bit.
static const JPutModuleStatusBit putModuleStatusBit(getModuleStatusBit)
Function object to map module status bit to key.
JPutStatusBit JPutModuleStatusBit
Type definition to map module status bit to key.
const array_type< JKey_t > & get_keys(const std::map< JKey_t, JValue_t, JComparator_t, JAllocator_t > &data)
Method to create array of keys of map.
Definition: JVectorize.hh:139
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Auxiliary class to map key to module status bit.
JGetModuleStatusBit()
Default constructor.
Auxiliary class to map key to status bit.
Definition: JStatus.hh:209
Auxiliary class to map status bit to key.
Definition: JStatus.hh:228
Auxiliary class for handling status.
Definition: JStatus.hh:39
Auxiliary class for a type holder.
Definition: JType.hh:19