Fabcoin Core  0.16.2
P2P Digital Currency
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
TimerBase Class Referenceabstract

Base class for timers. More...

#include <hrtimer.h>

Inheritance diagram for TimerBase:
[legend]

Public Types

enum  Unit { SECONDS = 0, MILLISECONDS, MICROSECONDS, NANOSECONDS }
 

Public Member Functions

 TimerBase (Unit unit, bool stuckAtZero)
 
virtual TimerWord GetCurrentTimerValue ()=0
 
virtual TimerWord TicksPerSecond ()=0
 
void StartTimer ()
 
double ElapsedTimeAsDouble ()
 
unsigned long ElapsedTime ()
 

Private Member Functions

double ConvertTo (TimerWord t, Unit unit)
 

Private Attributes

Unit m_timerUnit
 
bool m_stuckAtZero
 
bool m_started
 
TimerWord m_start
 
TimerWord m_last
 

Detailed Description

Base class for timers.

Definition at line 20 of file hrtimer.h.

Member Enumeration Documentation

Enumerator
SECONDS 
MILLISECONDS 
MICROSECONDS 
NANOSECONDS 

Definition at line 23 of file hrtimer.h.

Constructor & Destructor Documentation

TimerBase::TimerBase ( Unit  unit,
bool  stuckAtZero 
)
inline

Definition at line 24 of file hrtimer.h.

Member Function Documentation

double TimerBase::ConvertTo ( TimerWord  t,
Unit  unit 
)
private

Definition at line 51 of file hrtimer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

unsigned long TimerBase::ElapsedTime ( )

Definition at line 83 of file hrtimer.cpp.

Here is the call graph for this function:

double TimerBase::ElapsedTimeAsDouble ( )

Definition at line 66 of file hrtimer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual TimerWord TimerBase::GetCurrentTimerValue ( )
pure virtual

Implemented in Timer, and ThreadUserTimer.

Here is the caller graph for this function:

void TimerBase::StartTimer ( )

Definition at line 60 of file hrtimer.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

virtual TimerWord TimerBase::TicksPerSecond ( )
pure virtual

Implemented in Timer, and ThreadUserTimer.

Here is the caller graph for this function:

Member Data Documentation

TimerWord TimerBase::m_last
private

Definition at line 40 of file hrtimer.h.

TimerWord TimerBase::m_start
private

Definition at line 40 of file hrtimer.h.

bool TimerBase::m_started
private

Definition at line 39 of file hrtimer.h.

bool TimerBase::m_stuckAtZero
private

Definition at line 39 of file hrtimer.h.

Unit TimerBase::m_timerUnit
private

Definition at line 38 of file hrtimer.h.


The documentation for this class was generated from the following files: