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