STIR  6.2.0
AbsTimeInterval.h
Go to the documentation of this file.
1 //
2 //
3 /*
4  Copyright (C) 2005- 2010 , Hammersmith Imanet Ltd
5  SPDX-License-Identifier: Apache-2.0
6  See STIR/LICENSE.txt for details
7 */
8 #ifndef __stir_AbsTimeInterval__H__
9 #define __stir_AbsTimeInterval__H__
10 
19 #include "stir/RegisteredObject.h"
20 #include "stir/ParsingObject.h"
21 
22 START_NAMESPACE_STIR
23 
31 class AbsTimeInterval : public RegisteredObject<AbsTimeInterval>
32 {
33 
34 public:
35  ~AbsTimeInterval() override {}
37  : _start_time_in_secs_since_1970(0),
38  _end_time_in_secs_since_1970(0)
39  {}
40  AbsTimeInterval(double start_time_in_secs_since_1970, double end_time_in_secs_since_1970)
41  : _start_time_in_secs_since_1970(start_time_in_secs_since_1970),
42  _end_time_in_secs_since_1970(end_time_in_secs_since_1970)
43  {}
44 
45  double get_start_time_in_secs_since_1970() const { return _start_time_in_secs_since_1970; }
46  double get_end_time_in_secs_since_1970() const { return _end_time_in_secs_since_1970; }
47  double get_duration_in_secs() const { return _end_time_in_secs_since_1970 - _start_time_in_secs_since_1970; }
48 
49 protected:
50  double _start_time_in_secs_since_1970;
51  double _end_time_in_secs_since_1970;
52 };
53 
54 END_NAMESPACE_STIR
55 
56 #endif
Declaration of class stir::ParsingObject.
Base class for specifying a time interval (in absolute time)
Definition: AbsTimeInterval.h:31
Declaration of class stiir::RegisteredObject.
Helper class to provide registry mechanisms to a Base classSuppose you have a hierarchy of classes wi...
Definition: RegisteredObject.h:95