Belle II Software  release-06-00-14
Time.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 #ifndef Time_hh
9 #define Time_hh
10 
11 #include "daq/slc/base/Serializable.h"
12 
13 #include <string>
14 
15 namespace Belle2 {
21  class Time : public Serializable {
22 
23  // constructors & destructors
24  public:
25  explicit Time();
26  Time(const double);
27  Time(const long, const long);
28  ~Time();
29 
30  // member methods
31  private:
32  void adjust();
33 
34  public:
35  void clear();
36  void set();
37  void set(const double);
38  void set(const long, const long);
39  double get() const;
40  long getSecond() const;
41  long getMicroSecond() const;
42  std::string toString() const;
43 
44  // for serialization
45  public:
46  virtual void readObject(Reader&);
47  virtual void writeObject(Writer&) const;
48 
49  // operators
50  public:
51  Time& operator = (const Time&);
52  bool operator == (const Time&) const;
53  Time operator + (const Time&) const;
54  Time operator - (const Time&) const;
55 
56  // member data
57  private:
58  long m_s;
59  long m_us;
60 
61  };
62 
64 }
65 
66 #endif
Abstract base class for different kinds of events.