CGeneralTimeStamp.h
Go to the documentation of this file.
1 #ifndef istd_CGeneralTimeStamp_included
2 #define istd_CGeneralTimeStamp_included
3 
4 
5 // Qt includes
6 #include <QtCore/QObject>
7 #if QT_VERSION >= 0x040700
8  #include <QtCore/QElapsedTimer>
9 #else
10  #include <QtCore/QDateTime>
11 #endif
12 
13 // ACF includes
14 #include <istd/ITimeStamp.h>
15 
16 
17 namespace istd
18 {
19 
20 
24 class CGeneralTimeStamp: virtual public ITimeStamp
25 {
26 public:
28 
29  double GetTimeTo(const CGeneralTimeStamp& timeStamp) const;
30 
31  // reimplemented (istd::ITimeStamp)
32  virtual void Start(double elapsedTime = 0);
33  virtual QDateTime GetStartTime() const;
34  virtual double GetElapsed() const;
35  virtual double GetTimeTo(const ITimeStamp& timeStamp) const;
36  virtual void WaitTo(double time) const;
37  virtual double GetTimerResolution() const;
38 
39 private:
40 #if QT_VERSION >= 0x040700
41  QElapsedTimer m_timer;
42 #else
43  QDateTime m_timer;
44 #endif
45 
46  double m_timeShift;
47 };
48 
49 
50 } // namespace istd
51 
52 
53 #endif // !istd_CGeneralTimeStamp_included
54 
55 
A general time stamp implementation.
virtual void Start(double elapsedTime=0)
Start the timer.
virtual double GetTimerResolution() const
Return the timer resolution in seconds.
Common interface for timer implementations.
Definition: ITimeStamp.h:21
virtual double GetElapsed() const
Return the time in seconds from start until this call.
double GetTimeTo(const CGeneralTimeStamp &timeStamp) const
virtual QDateTime GetStartTime() const
Get point in time of latest start.
virtual void WaitTo(double time) const
Wait for specific timer elapsed value is reached.

© 2007-2017 Witold Gantzke and Kirill Lepskiy