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

#include <cTimer.h>

Inheritance diagram for GrayLib::cTimerInst:
Gray::cRefBase IUnknown GrayLib::cTimerFunc

Public Member Functions

 cTimerInst (cTimerGroup *pTimerGroup=nullptr, TIMESYS_t tCallNext=cTimeSys::k_CLEAR)
 
virtual ~cTimerInst ()
 
TIMESYS_t get_SortValue () const noexcept
 
bool SetTimer (TIMESYS_t tCallNext)
 
void KillTimer ()
 
- Public Member Functions inherited from Gray::cRefBase
 cRefBase (int iRefCount=0) noexcept
 
virtual ~cRefBase ()
 
int get_RefCount () const noexcept
 
HASHCODE_t get_HashCode () const noexcept
 
 STDMETHOD_ (HASHCODE_t, get_HashCodeX)() const noexcept
 
virtual void onFinalRelease ()
 
bool isValidObj () const noexcept
 
 STDMETHOD_ (ULONG, AddRef)(void) override
 
 STDMETHOD_ (ULONG, Release)(void) override
 
STDMETHOD() QueryInterface (const IID &riid, void __RPC_FAR *__RPC_FAR *ppvObject) override
 
void IncRefCount ()
 
void DecRefCount ()
 
bool isStaticConstruct () const noexcept
 
void StaticConstruct ()
 
void StaticDestruct ()
 
bool isDestructing () noexcept
 
void SetDestructing ()
 

Protected Member Functions

virtual void OnTimer ()
 

Friends

class cTimerGroup
 

Detailed Description

A single timer instance in a cTimerGroup Create one of these, then add it to a timer group. All timers are one shot timers that must re-add themselves once expired. OnTimer() calls SetTimer()

Constructor & Destructor Documentation

◆ cTimerInst()

GrayLib::cTimerInst::cTimerInst ( cTimerGroup pTimerGroup = nullptr,
TIMESYS_t  tCallNext = cTimeSys::k_CLEAR 
)

◆ ~cTimerInst()

GrayLib::cTimerInst::~cTimerInst ( void  )
virtual

ASSUME i am NOT in the timer array.

Member Function Documentation

◆ get_SortValue()

TIMESYS_t GrayLib::cTimerInst::get_SortValue ( ) const
inlinenoexcept

◆ KillTimer()

void GrayLib::cTimerInst::KillTimer ( )

Remove me from the timer array. and maybe destroy this. (if ref = 0)

◆ OnTimer()

void GrayLib::cTimerInst::OnTimer ( )
protectedvirtual

Override this to do something useful.

Note
this is a one shot timer. Call SetTimer() to reschedule this. Without reschedule or added ref count the timer is destroyed after use.

Reimplemented in GrayLib::cTimerFunc.

◆ SetTimer()

bool GrayLib::cTimerInst::SetTimer ( TIMESYS_t  tCallNext)

Re-sort the m_pTimerGroup->m_aTimers for this.

Friends And Related Function Documentation

◆ cTimerGroup

friend class cTimerGroup
friend

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