Jpp  master_rocky-43-ge265d140c
the software that should make you happy
JDetectors.hh
Go to the documentation of this file.
1 #ifndef __JDB_JDETECTORS__
2 #define __JDB_JDETECTORS__
3 
4 #include <TROOT.h>
5 #include <TObject.h>
6 
7 #include <string>
8 
9 #include "JDB/JDBString.hh"
10 #include "JDB/JSonSupportkit.hh"
11 
12 /**
13  * \author mdejong
14  */
15 namespace JDATABASE {}
16 namespace JPP { using namespace JDATABASE; }
17 
18 namespace JDATABASE {
19 
20  struct JDetectors :
21  public TObject
22  {
23  static const char* const getName() { return "detectors"; } //!< Table name
24 
25  std::string OID;
27  std::string LOCATIONID;
29 
31  };
32 
33  namespace APIV2 {
34 
35  struct JDetector :
36  public JSonHelper<JDetector>,
37  public TObject
38  {
39  static const char* const getName() { return "Detector"; } //!< Table name
40 
41  JDetector() {}
42 
43  /**
44  * Copy constructor.
45  *
46  * \param detector detector
47  */
48  JDetector(const JDetectors& detector) :
49  DetOID (detector.OID),
50  DetId (detector.SERIALNUMBER),
51  Location (detector.LOCATIONID),
52  City (detector.CITY)
53  {}
54 
55  /**
56  * Type conversion operator.
57  *
58  * \return detector
59  */
60  operator JDetectors() const
61  {
62  JDetectors detector;
63 
64  detector.OID = this->DetOID;
65  detector.SERIALNUMBER = this->DetId;
66  detector.LOCATIONID = this->Location;
67  detector.CITY = this->City;
68 
69  return detector;
70  }
71 
72  std::string DetOID;
73  int DetId;
74  std::string Location;
75  std::string City;
76 
78  };
79  }
80 }
81 
82 #endif
Auxiliary classes and methods for database I/O.
Definition: JAHRS.hh:14
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
static const char *const getName()
Table name.
Definition: JDetectors.hh:39
JDetector(const JDetectors &detector)
Copy constructor.
Definition: JDetectors.hh:48
Wrapper class to read string until end-of-line.
Definition: JDBString.hh:22
std::string LOCATIONID
Definition: JDetectors.hh:27
static const char *const getName()
Table name.
Definition: JDetectors.hh:23
ClassDef(JDetectors, 1)
Auxiliary base class for JSon I/O based on ROOT dictionary.
Definition: JRoot.hh:19