Anope IRC Services  Version 2.0
Static Public Member Functions | Static Private Attributes
TimerManager Class Reference

#include <timers.h>

Static Public Member Functions

static void AddTimer (Timer *t)
 
static void DelTimer (Timer *t)
 
static void TickTimers (time_t ctime=Anope::CurTime)
 
static void DeleteTimersFor (Module *m)
 

Static Private Attributes

static std::multimap< time_t,
Timer * > 
Timers
 

Detailed Description

This class manages sets of Timers, and triggers them at their defined times. This will ensure timers are not missed, as well as removing timers that have expired and allowing the addition of new ones.

Definition at line 106 of file timers.h.

Member Function Documentation

void TimerManager::AddTimer ( Timer t)
static

Add a timer to the list

Parameters
tA Timer derived class to add

Definition at line 82 of file timers.cpp.

References Timer::GetTimer(), and Timers.

Referenced by Timer::SetSecs(), Timer::SetTimer(), and Timer::Timer().

void TimerManager::DeleteTimersFor ( Module m)
static

Deletes all timers owned by the given module

Definition at line 119 of file timers.cpp.

References Timers.

Referenced by Module::~Module().

void TimerManager::DelTimer ( Timer t)
static

Deletes a timer

Parameters
tA Timer derived class to delete

Definition at line 87 of file timers.cpp.

References Timer::GetTimer(), and Timers.

Referenced by Timer::SetSecs(), Timer::SetTimer(), and Timer::~Timer().

void TimerManager::TickTimers ( time_t  ctime = Anope::CurTime)
static

Tick all pending timers

Parameters
ctimeThe current time

Definition at line 100 of file timers.cpp.

References Timer::GetRepeat(), Timer::GetSecs(), Timer::GetTimer(), Timer::SetTimer(), Timer::Tick(), and Timers.

Referenced by main().

Field Documentation

std::multimap< time_t, Timer * > TimerManager::Timers
staticprivate

A list of timers

Definition at line 110 of file timers.h.

Referenced by AddTimer(), DeleteTimersFor(), DelTimer(), and TickTimers().


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