i6engine  1.0
i6e::core::Scheduler< ClockUpdater > Class Template Reference

#include <D:/Projekte/i6engine/libs/i6engine-core/include/i6engine/core/clock/Scheduler.h>

Classes

struct  Job
 this struct represents a single timer event More...
 

Public Types

typedef struct i6e::core::Scheduler::Job Job
 this struct represents a single timer event More...
 

Public Member Functions

 Scheduler (utils::Clock< ClockUpdater > &c)
 constructor for scheduler taking a clock More...
 
 ~Scheduler ()
 destructor More...
 
uint64_t runOnce (uint64_t time, const boost::function< bool(void)> &f, JobPriorities priority)
 starts a timer beeing scheduled after the given time More...
 
uint64_t runRepeated (uint64_t interval, const boost::function< bool(void)> &f, JobPriorities priority)
 starts a timer repeating in the given interval More...
 
uint64_t getTimeLeft (uint64_t id) const
 returns time left until execution of the job if no job with given name found, -1 is returned More...
 
void removeTimer (JobPriorities priority)
 removes all timers with given priority More...
 
bool stop (uint64_t id)
 removes Timer registered for given id returns true, if Timer was found, otherwise false More...
 

Detailed Description

template<class ClockUpdater>
class i6e::core::Scheduler< ClockUpdater >

Definition at line 43 of file Scheduler.h.

Member Typedef Documentation

template<class ClockUpdater>
typedef struct i6e::core::Scheduler::Job i6e::core::Scheduler< ClockUpdater >::Job

this struct represents a single timer event

Constructor & Destructor Documentation

template<class ClockUpdater>
i6e::core::Scheduler< ClockUpdater >::Scheduler ( utils::Clock< ClockUpdater > &  c)
inlineexplicit

constructor for scheduler taking a clock

Definition at line 97 of file Scheduler.h.

template<class ClockUpdater>
i6e::core::Scheduler< ClockUpdater >::~Scheduler ( )
inline

destructor

Definition at line 107 of file Scheduler.h.

Member Function Documentation

template<class ClockUpdater>
uint64_t i6e::core::Scheduler< ClockUpdater >::getTimeLeft ( uint64_t  id) const
inline

returns time left until execution of the job if no job with given name found, -1 is returned

Definition at line 174 of file Scheduler.h.

template<class ClockUpdater>
void i6e::core::Scheduler< ClockUpdater >::removeTimer ( JobPriorities  priority)
inline

removes all timers with given priority

Definition at line 194 of file Scheduler.h.

template<class ClockUpdater>
uint64_t i6e::core::Scheduler< ClockUpdater >::runOnce ( uint64_t  time,
const boost::function< bool(void)> &  f,
JobPriorities  priority 
)
inline

starts a timer beeing scheduled after the given time

Parameters
[in]namename of the timer
[in]timethe time until calling the given method
[in]fthe method to be called if time is over
[in]prioritythe priority in which order the timers are scheduled if time is equal

Definition at line 129 of file Scheduler.h.

template<class ClockUpdater>
uint64_t i6e::core::Scheduler< ClockUpdater >::runRepeated ( uint64_t  interval,
const boost::function< bool(void)> &  f,
JobPriorities  priority 
)
inline

starts a timer repeating in the given interval

Parameters
[in]namename of the timer
[in]intervalthe time between repetition of this method
[in]fthe method to be called if time is over
[in]prioritythe priority in which order the timers are scheduled if time is equal

Definition at line 154 of file Scheduler.h.

template<class ClockUpdater>
bool i6e::core::Scheduler< ClockUpdater >::stop ( uint64_t  id)
inline

removes Timer registered for given id returns true, if Timer was found, otherwise false

Definition at line 216 of file Scheduler.h.


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