ADTF  3.18.2
highrestimer.h
Go to the documentation of this file.
1 
7 #ifndef _HIGHRES_TIMER_CLASS_HEADER_
8 #define _HIGHRES_TIMER_CLASS_HEADER_
9 
10 namespace A_UTILS_NS
11 {
12 
22 class DOEXPORT cHighResTimer
23 {
25 
26  public:
31 
35  virtual ~cHighResTimer();
36 
43  tResult Create(tUInt uiDelay);
44 
51 
59  tVoid Sleep(tUInt uiTimeout);
60 
71 
72  public:
79  static tTimeStamp GetTime();
80 
88 
96 
97  private:
98 #ifdef WIN32
99  #ifdef WIN64
100  static void __stdcall /* CALLBACK */ TimerProc(unsigned int uiID, unsigned int uiMsg, __int64 dwUser, __int64 dw1, __int64 dw2);
101  #else
102  static void __stdcall /* CALLBACK */ TimerProc(unsigned int uiID, unsigned int uiMsg, unsigned long dwUser, unsigned long dw1, unsigned long dw2);
103  #endif
104 #else
105  static void TimerProc(tUInt32 uiID, tUInt32 uiMsg, tUInt32 dwUser, tUInt32 dw1, tUInt32 dw2);
106 #endif
107 };
108 
112 class DOEXPORT cHighResTimeSpan
113 {
115 
116  public:
121 
126 
133 
140 };
141 
142 
149 class DOEXPORT cTickCounter
150 {
152 
153  public:
158 
165 
172 
179 };
180 
181 } // namespace A_UTILS_NS
182 
183 #endif // _HIGHRES_TIMER_CLASS_HEADER_
unsigned int tUInt
type definition for unsigned integer value (platform and compiler dependent type).
void tVoid
The tVoid is always the definition for the void (non-type).
uint32_t tUInt32
type definition for unsigned integer values (32bit) (platform and compiler independent type).
uint64_t tUInt64
type definition for unsigned integer values (64bit) (platform and compiler independent type).
Class that measures timespans.
Definition: highrestimer.h:113
tTimeStamp GetElapsed()
Returns the timespan since the last call of GetElapsed or Reset.
cHighResTimeSpan()
Default constructor.
tVoid Reset()
Resets the start timestamp.
High resolution timer.
Definition: highrestimer.h:23
static tTimeStamp GetTime()
Returns the current time in microseconds.
tVoid Sleep(tUInt uiTimeout)
Pauses the calling thread for a specified time.
tResult Release()
Releases all allocated resources.
virtual ~cHighResTimer()
Destructor.
cHighResTimer()
Default constructor.
tVoid SleepMicroSeconds(tTimeStamp tmTimeout)
Pauses the calling thread for a specified time.
static tUInt GetMaximumResolution()
returns the maximum resolution
tResult Create(tUInt uiDelay)
Allocates all resources, registers timer with OS.
static tUInt GetMinimumResolution()
returns the minimum resolution
CPU Tick Counter class This class may be used for testing purposes.
Definition: highrestimer.h:150
cTickCounter()
Default constructor.
tUInt64 GetElapsed()
Returns the ticks since the last call of GetElapsed or Reset.
static tUInt64 GetCurrentTicks()
Returns the current tick count in the cpu register.
tVoid Reset()
Resets start tick count of the counter.
#define A_UTILS_D(__pclassname_)
Helper macro for d-pattern definitions.
Definition: d_ptr.h:270
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
Definition: d_ptr.h:11