STIR  6.2.0
ListTime.h
Go to the documentation of this file.
1 //
13 /*
14  Copyright (C) 2003- 2011, Hammersmith Imanet Ltd
15  Copyright (C) 2019, National Physical Laboratory
16  Copyright (C) 2019, University College of London
17  This file is part of STIR.
18 
19  SPDX-License-Identifier: Apache-2.0
20 
21  See STIR/LICENSE.txt for details
22 */
23 
24 #ifndef __stir_listmode_ListTime_H__
25 #define __stir_listmode_ListTime_H__
26 
27 //#include "ListTime.h"
28 #include "stir/Succeeded.h"
29 #include "stir/round.h"
30 
31 START_NAMESPACE_STIR
32 // class Succeeded;
33 
35 
46 class ListTime
47 {
48 public:
49  virtual ~ListTime() {}
50 
51  virtual unsigned long get_time_in_millisecs() const = 0;
52  inline double get_time_in_secs() const { return get_time_in_millisecs() / 1000.; }
53 
54  virtual Succeeded set_time_in_millisecs(const unsigned long time_in_millisecs) = 0;
55  inline Succeeded set_time_in_secs(const double time_in_secs)
56  {
57  unsigned long time_in_millisecs;
58  round_to(time_in_millisecs, time_in_secs / 1000.);
59  return set_time_in_millisecs(time_in_millisecs);
60  }
61 };
62 
63 END_NAMESPACE_STIR
64 
65 #endif
Declaration of class stir::Succeeded.
Declaration of the stir::round functions.
void round_to(integerT &result, const float x)
Implements rounding of floating point numbers to other integer types.
Definition: round.inl:26
a class containing an enumeration type that can be used by functions to signal successful operation o...
Definition: Succeeded.h:43
A class for storing and using a timing record from a listmode file.
Definition: ListTime.h:46