Jpp  15.0.1-rc.1-highqe
the software that should make you happy
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JDatim_t.hh
Go to the documentation of this file.
1 #ifndef __JDB_JDATIM_T__
2 #define __JDB_JDATIM_T__
3 
4 #include <TROOT.h>
5 #include <TObject.h>
6 
8 
9 #include "JDB/JDate_t.hh"
10 #include "JDB/JTime_t.hh"
11 
12 
13 /**
14  * \author mdejong
15  */
16 namespace JDATABASE {}
17 namespace JPP { using namespace JDATABASE; }
18 
19 namespace JDATABASE {
20 
22  using JLANG::JTYPELIST;
23 
24 
25  /**
26  * Auxiliairy data structure for date and time.
27  */
28  struct JDatim_t :
29  public JDate_t,
30  public JTime_t,
31  public JMultiComparable<JDatim_t, JTYPELIST<JDate_t, JTime_t>::typelist>
32  {
33  /**
34  * Separation character.
35  */
36  static const char SEPARATOR = '-';
37 
38 
39  /**
40  * Default constructor.
41  */
43  {}
44 
45 
46  /**
47  * Constructor.
48  *
49  * \param date date
50  * \param time time
51  */
52  JDatim_t(const JDate_t& date,
53  const JTime_t& time) :
54  JDate_t(date),
55  JTime_t(time)
56  {}
57 
58 
59  static JDatim_t min() { return JDatim_t(JDate_t::min(), JTime_t::min()); } //!< Minimal date and time
60  static JDatim_t max() { return JDatim_t(JDate_t::max(), JTime_t::max()); } //!< Maximal date and time
61 
62 
63  /**
64  * Read date and time from input stream.
65  *
66  * \param in input stream
67  * \param object date and time
68  * \return input stream
69  */
70  friend inline std::istream& operator>>(std::istream& in, JDatim_t& object)
71  {
72  in >> static_cast<JDate_t&>(object);
73  in.ignore();
74  in >> static_cast<JTime_t&>(object);
75 
76  return in;
77  }
78 
79 
80  /**
81  * Write date and time to output stream.
82  *
83  * \param out output stream
84  * \param object date and time
85  * \return output stream
86  */
87  friend inline std::ostream& operator<<(std::ostream& out, const JDatim_t& object)
88  {
89  out << static_cast<const JDate_t&>(object);
90  out << JDatim_t::SEPARATOR;
91  out << static_cast<const JTime_t&>(object);
92 
93  return out;
94  }
95 
96  ClassDefNV(JDatim_t, 1);
97  };
98 }
99 
100 #endif
static JTime max()
Maximal time.
Definition: Jeep/JTime.hh:88
friend std::ostream & operator<<(std::ostream &out, const JDatim_t &object)
Write date and time to output stream.
Definition: JDatim_t.hh:87
JDatim_t()
Default constructor.
Definition: JDatim_t.hh:42
static JDate min()
Minimal date.
Definition: Jeep/JDate.hh:87
ClassDefNV(JDatim_t, 1)
Auxiliairy data structure for date and time.
Definition: JDatim_t.hh:28
JDatim_t(const JDate_t &date, const JTime_t &time)
Constructor.
Definition: JDatim_t.hh:52
static JDate max()
Maximal date.
Definition: Jeep/JDate.hh:88
Auxiliary class for recursive type list generation.
Definition: JTypeList.hh:351
static JTime min()
Minimal time.
Definition: Jeep/JTime.hh:87
static const char SEPARATOR
Separation character.
Definition: JDatim_t.hh:36
Template definition of auxiliary base class for composite data structures composed of base classes wi...
friend std::istream & operator>>(std::istream &in, JDatim_t &object)
Read date and time from input stream.
Definition: JDatim_t.hh:70
Auxiliary class for simple time.
Definition: Jeep/JTime.hh:39
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 source JAcoustics sh $DETECTOR_ID CHECK_EXIT_CODE typeset A TRIPODS get_tripods $WORKDIR tripod txt TRIPODS for EMITTER in
Definition: JCanberra.sh:41
static JDatim_t max()
Maximal date and time.
Definition: JDatim_t.hh:60
static JDatim_t min()
Minimal date and time.
Definition: JDatim_t.hh:59