ZNC trunk
Loading...
Searching...
No Matches
CTimer Class Reference

#include <Modules.h>

Inheritance diagram for CTimer:
Collaboration diagram for CTimer:

Public Member Functions

 CTimer (CModule *pModule, unsigned int uInterval, unsigned int uCycles, const CString &sLabel, const CString &sDescription)
virtual ~CTimer ()
 CTimer (const CTimer &)=delete
CTimeroperator= (const CTimer &)=delete
void SetModule (CModule *p)
void SetDescription (const CString &s)
CModuleGetModule () const
const CStringGetDescription () const
void run (timeval &tNow)
 This is used by the Job Manager, and not you directly.
void StartMaxCycles (double dTimeSequence, uint32_t iMaxCycles)
void StartMaxCycles (const timeval &tTimeSequence, uint32_t iMaxCycles)
void Start (double dTimeSequence)
 starts and runs infinity amount of times
void Start (const timeval &TimeSequence)
void Stop ()
 call this to turn off your cron, it will be removed
void Pause ()
 pauses excution of your code in RunJob
void UnPause ()
 removes the pause on RunJon
void Reset ()
 reset the timer
timeval GetInterval () const
uint32_t GetMaxCycles () const
uint32_t GetCyclesLeft () const
bool isValid () const
 returns true if cron is active
const CS_STRINGGetName () const
void SetName (const CS_STRING &sName)
timeval GetNextRun () const
 returns the timestamp of the next estimated run time. Note that it may not run at this EXACT time, but it will run at least at this time or after
virtual void RunJob ()
 this is the method you should override

Protected Attributes

CModulem_pModule
CString m_sDescription
bool m_bRunOnNextCall
 if set to true, RunJob() gets called on next invocation of run() despite the timeout

Constructor & Destructor Documentation

◆ CTimer() [1/2]

CTimer::CTimer ( CModule * pModule,
unsigned int uInterval,
unsigned int uCycles,
const CString & sLabel,
const CString & sDescription )

Referenced by CFPTimer::CFPTimer(), and operator=().

◆ ~CTimer()

virtual CTimer::~CTimer ( )
virtual

◆ CTimer() [2/2]

CTimer::CTimer ( const CTimer & )
delete

Member Function Documentation

◆ GetCyclesLeft()

uint32_t CCron::GetCyclesLeft ( ) const
inherited

◆ GetDescription()

const CString & CTimer::GetDescription ( ) const

◆ GetInterval()

timeval CCron::GetInterval ( ) const
inherited

◆ GetMaxCycles()

uint32_t CCron::GetMaxCycles ( ) const
inherited

◆ GetModule()

CModule * CTimer::GetModule ( ) const

◆ GetName()

const CS_STRING & CCron::GetName ( ) const
inherited

References CS_STRING.

◆ GetNextRun()

timeval CCron::GetNextRun ( ) const
inlineinherited

returns the timestamp of the next estimated run time. Note that it may not run at this EXACT time, but it will run at least at this time or after

◆ isValid()

bool CCron::isValid ( ) const
inherited

returns true if cron is active

◆ operator=()

CTimer & CTimer::operator= ( const CTimer & )
delete

References CTimer().

◆ Pause()

void CCron::Pause ( )
inherited

pauses excution of your code in RunJob

◆ Reset()

void CCron::Reset ( )
inherited

reset the timer

◆ run()

void CCron::run ( timeval & tNow)
inherited

This is used by the Job Manager, and not you directly.

◆ RunJob()

virtual void CCron::RunJob ( )
virtualinherited

this is the method you should override

Reimplemented in CFPTimer.

◆ SetDescription()

void CTimer::SetDescription ( const CString & s)

◆ SetModule()

void CTimer::SetModule ( CModule * p)

◆ SetName()

void CCron::SetName ( const CS_STRING & sName)
inherited

References CS_STRING.

◆ Start() [1/2]

void CCron::Start ( const timeval & TimeSequence)
inherited

◆ Start() [2/2]

void CCron::Start ( double dTimeSequence)
inherited

starts and runs infinity amount of times

◆ StartMaxCycles() [1/2]

void CCron::StartMaxCycles ( const timeval & tTimeSequence,
uint32_t iMaxCycles )
inherited

◆ StartMaxCycles() [2/2]

void CCron::StartMaxCycles ( double dTimeSequence,
uint32_t iMaxCycles )
inherited
Parameters
TimeSequencehow often to run in seconds
iMaxCycleshow many times to run, 0 makes it run forever

◆ Stop()

void CCron::Stop ( )
inherited

call this to turn off your cron, it will be removed

◆ UnPause()

void CCron::UnPause ( )
inherited

removes the pause on RunJon

Member Data Documentation

◆ m_bRunOnNextCall

bool CCron::m_bRunOnNextCall
protectedinherited

if set to true, RunJob() gets called on next invocation of run() despite the timeout

◆ m_pModule

CModule* CTimer::m_pModule
protected

Referenced by CFPTimer::RunJob().

◆ m_sDescription

CString CTimer::m_sDescription
protected

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