ZNC  trunk
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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...
 
timeval GetInterval () const
 
uint32_t GetMaxCycles () const
 
uint32_t GetCyclesLeft () const
 
bool isValid ()
 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 ( )
virtual CCron::~CCron ( )
inlinevirtual

Member Function Documentation

uint32_t CCron::GetCyclesLeft ( ) const
timeval CCron::GetInterval ( ) const
uint32_t CCron::GetMaxCycles ( ) const
const CS_STRING& CCron::GetName ( ) const
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

bool CCron::isValid ( )

returns true if cron is active

void CCron::Pause ( )

pauses excution of your code in RunJob

void CCron::run ( timeval &  tNow)

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

virtual void CCron::RunJob ( )
virtual

this is the method you should override

Reimplemented in CFPTimer, CPyTimer, and CPerlTimer.

void CCron::SetName ( const CS_STRING sName)
void CCron::Start ( double  dTimeSequence)

starts and runs infinity amount of times

void CCron::Start ( const timeval &  TimeSequence)
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
void CCron::StartMaxCycles ( const timeval &  tTimeSequence,
uint32_t  iMaxCycles 
)
void CCron::Stop ( )

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

void CCron::UnPause ( )

removes the pause on RunJon

Member Data Documentation

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: