Gray C++ Libraries  0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
GrayLib::cTimeTickMaster Class Reference

#include <cTimeTick.h>

Inheritance diagram for GrayLib::cTimeTickMaster:
Gray::cSingletonStatic< cTimeTickMaster > GrayLib::cTimeTick GrayLib::cTimeTickBase

Public Member Functions

 cTimeTickMaster (TIMETICK_t nTimeFreq=cTimeSys::k_FREQ, TIMETICK_t lTimeBase=1)
 
 ~cTimeTickMaster ()
 
bool AdvanceTimeSpec ()
 
void InitTime (TIMETICK_t lTimeBase)
 
 UNITTEST_FRIEND (cTimeTick)
 
- Public Member Functions inherited from GrayLib::cTimeTick
 cTimeTick ()
 
 cTimeTick (TIMETICK_t lTimeBase)
 
 cTimeTick (const cTimeTickBase &time)
 
- Public Member Functions inherited from GrayLib::cTimeTickBase
bool isTimeValid () const noexcept
 
bool isTimeFuture () const noexcept
 
void InitTime (TIMETICK_t lTimeBase=k_NEVER) noexcept
 
void InitTimeNow ()
 
void InitTimeNowPlusTicks (TIMETICKD_t iOffsetTicks)
 
TIMETICK_t get_TimeTicks () const noexcept
 
 operator TIMETICK_t () const noexcept
 
int GetTimeSinceTick (const cTimeTickBase &time) const noexcept
 
TIMETICKD_t get_TimeTilTick () const
 
TIMETICKD_t get_AgeTick () const
 
void InitTimeNowPlusSec (TIMESECF_t fOffsetSec)
 
TIMESECF_t get_TimeTilSec () const
 
TIMESECF_t get_AgeSec () const
 
cTimeTickBase operator+ (TIMETICKD_t iTimeDiff) const
 
cTimeTickBase operator- (TIMETICKD_t iTimeDiff) const
 
int operator- (cTimeTickBase time) const
 
bool operator== (cTimeTickBase time) const
 
bool operator!= (cTimeTickBase time) const
 
bool operator< (cTimeTickBase time) const
 
bool operator> (cTimeTickBase time) const
 
bool operator<= (cTimeTickBase time) const
 
bool operator>= (cTimeTickBase time) const
 

Public Attributes

const TIMETICK_t m_nTimeFreq
 Desired tick freq. TIMETICK_FREQ. More...
 

Protected Attributes

cThreadLockCount m_Lock
 Make this thread safe. More...
 
TIMETICK_t m_nTimeDiv
 Desired tick freq. TIMETICK_FREQ per real second. More...
 
cTimeSys m_TimeSysLast
 cTimeSys::GetTimeNow() of the last AdvanceTimeSpec(). "(1/cTimeSys::k_FREQ)" More...
 
- Protected Attributes inherited from GrayLib::cTimeTickBase
TIMETICK_t m_PrivateTime
 m_nTimeFreq arbitrary frequency More...
 

Additional Inherited Members

- Static Public Member Functions inherited from Gray::cSingletonStatic< cTimeTickMaster >
static bool isSingleCreated () noexcept
 
static cTimeTickMaster * get_SingleU () noexcept
 
static cTimeTickMaster * get_Single ()
 
static TYPE2 *__stdcall get_SingleCast ()
 
static cTimeTickMaster & I () noexcept
 
- Static Public Member Functions inherited from GrayLib::cTimeTickBase
static cTimeTickBase GRAYCALL GetTickCount ()
 from cTimeTickMaster More...
 
static TIMETICK_t GRAYCALL GetTickFreq ()
 
- Static Public Attributes inherited from GrayLib::cTimeTickBase
static const TIMETICK_t k_NEVER = ((TIMETICK_t)(-1))
 
- Protected Member Functions inherited from Gray::cSingletonStatic< cTimeTickMaster >
 cSingletonStatic (cTimeTickMaster *pObject) noexcept
 
virtual ~cSingletonStatic () noexcept
 
- Static Protected Attributes inherited from Gray::cSingletonStatic< cTimeTickMaster >
static cTimeTickMaster * sm_pThe
 pointer to the one and only object of this TYPE. ASSUME automatically init to = nullptr. More...
 

Detailed Description

takes the system time and converts it to a more local tick time. the current relative tick time (in m_nTimeFreq)

Note
Also the time will only advance when AdvanceTime is called.

Constructor & Destructor Documentation

◆ cTimeTickMaster()

GrayLib::cTimeTickMaster::cTimeTickMaster ( TIMETICK_t  nTimeFreq = cTimeSys::k_FREQ,
TIMETICK_t  lTimeBase = 1 
)

◆ ~cTimeTickMaster()

GrayLib::cTimeTickMaster::~cTimeTickMaster ( )

Member Function Documentation

◆ AdvanceTimeSpec()

bool GrayLib::cTimeTickMaster::AdvanceTimeSpec ( )

Get current time. Watch for system clock overflow. ASSERT(0) on TIMETICK_t overflow!

◆ InitTime()

void GrayLib::cTimeTickMaster::InitTime ( TIMETICK_t  lTimeBase)

◆ UNITTEST_FRIEND()

GrayLib::cTimeTickMaster::UNITTEST_FRIEND ( cTimeTick  )

Member Data Documentation

◆ m_Lock

cThreadLockCount GrayLib::cTimeTickMaster::m_Lock
mutableprotected

Make this thread safe.

◆ m_nTimeDiv

TIMETICK_t GrayLib::cTimeTickMaster::m_nTimeDiv
protected

Desired tick freq. TIMETICK_FREQ per real second.

◆ m_nTimeFreq

const TIMETICK_t GrayLib::cTimeTickMaster::m_nTimeFreq

Desired tick freq. TIMETICK_FREQ.

◆ m_TimeSysLast

cTimeSys GrayLib::cTimeTickMaster::m_TimeSysLast
protected

cTimeSys::GetTimeNow() of the last AdvanceTimeSpec(). "(1/cTimeSys::k_FREQ)"


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