ZNC  trunk
Public Member Functions | Protected Attributes | List of all members
CCron Class Reference

this is the main cron job class More...

#include <Csocket.h>

+ Inheritance diagram for CCron:

Public Member Functions

 CCron ()
 
virtual ~CCron ()
 
void run (timeval &tNow)
 This is used by the Job Manager, and not you directly. More...
 
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 More...
 
void Start (const timeval &TimeSequence)
 
void Stop ()
 call this to turn off your cron, it will be removed More...
 
void Pause ()
 pauses excution of your code in RunJob More...
 
void UnPause ()
 removes the pause on RunJon More...
 
void Reset ()
 reset the timer More...
 
timeval GetInterval () const
 
uint32_t GetMaxCycles () const
 
uint32_t GetCyclesLeft () const
 
bool isValid () const
 returns true if cron is active More...
 
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 More...
 
virtual void RunJob ()
 this is the method you should override More...
 

Protected Attributes

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

Detailed Description

this is the main cron job class

You should derive from this class, and override RunJob() with your code

Author
Jim Hull csock.nosp@m.et@j.nosp@m.imloc.nosp@m.o.co.nosp@m.m

Constructor & Destructor Documentation

◆ CCron()

CCron::CCron ( )

◆ ~CCron()

virtual CCron::~CCron ( )
inlinevirtual

Member Function Documentation

◆ GetCyclesLeft()

uint32_t CCron::GetCyclesLeft ( ) const

◆ GetInterval()

timeval CCron::GetInterval ( ) const

◆ GetMaxCycles()

uint32_t CCron::GetMaxCycles ( ) const

◆ GetName()

const CS_STRING& CCron::GetName ( ) const

◆ GetNextRun()

timeval CCron::GetNextRun ( ) const
inline

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

returns true if cron is active

◆ Pause()

void CCron::Pause ( )

pauses excution of your code in RunJob

◆ Reset()

void CCron::Reset ( )

reset the timer

◆ run()

void CCron::run ( timeval &  tNow)

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

◆ RunJob()

virtual void CCron::RunJob ( )
virtual

this is the method you should override

Reimplemented in CFPTimer.

◆ SetName()

void CCron::SetName ( const CS_STRING sName)

◆ Start() [1/2]

void CCron::Start ( const timeval &  TimeSequence)

◆ Start() [2/2]

void CCron::Start ( double  dTimeSequence)

starts and runs infinity amount of times

◆ StartMaxCycles() [1/2]

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

◆ StartMaxCycles() [2/2]

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

◆ Stop()

void CCron::Stop ( )

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

◆ UnPause()

void CCron::UnPause ( )

removes the pause on RunJon

Member Data Documentation

◆ m_bRunOnNextCall

bool CCron::m_bRunOnNextCall
protected

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


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