The InspIRCd Project
Home | Developers | Wiki | Forums | Bug Tracker | SVN | Download
Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

TimerManager Class Reference

This class manages sets of Timers, and triggers them at their defined times. More...

#include <timer.h>

Inheritance diagram for TimerManager:

Inheritance graph
[legend]
Collaboration diagram for TimerManager:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TimerManager (InspIRCd *Instance)
 Constructor.
void TickTimers (time_t TIME)
 Tick all pending Timers.
void AddTimer (Timer *T)
 Add an Timer.
void DelTimer (Timer *T)
 Delete an Timer.

Static Public Member Functions

static bool TimerComparison (Timer *one, Timer *two)
 Compares two timers.

Protected Attributes

std::vector< Timer * > Timers
 A list of all pending timers.
InspIRCdServerInstance
 Creating server instance.

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 114 of file timer.h.


Constructor & Destructor Documentation

TimerManager::TimerManager InspIRCd Instance  ) 
 

Constructor.

Definition at line 19 of file timer.cpp.


Member Function Documentation

void TimerManager::AddTimer Timer T  ) 
 

Add an Timer.

Parameters:
T an Timer derived class to add
secs_from_now You may set this to the number of seconds from the current time when the timer will tick, or you may just leave this unset and the values set by the Timers constructor will be used. This is used internally for re-triggering repeating timers.

Definition at line 55 of file timer.cpp.

References TimerComparison(), and Timers.

Referenced by DNS::DNS(), DNSRequest::DNSRequest(), BufferedSocket::DoConnect(), ModuleSpanningTree::ModuleSpanningTree(), TreeSocket::OnConnected(), ModulePgSQL::ReconnectConn(), HandshakeTimer::Tick(), TickTimers(), and TreeSocket::TreeSocket().

void TimerManager::DelTimer Timer T  ) 
 

Delete an Timer.

Parameters:
T an Timer derived class to delete

Definition at line 44 of file timer.cpp.

References Timers.

Referenced by BufferedSocket::~BufferedSocket(), DNS::~DNS(), ModulePgSQL::~ModulePgSQL(), and ModuleSpanningTree::~ModuleSpanningTree().

void TimerManager::TickTimers time_t  TIME  ) 
 

Tick all pending Timers.

Parameters:
TIME the current system time

Definition at line 23 of file timer.cpp.

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

Referenced by InspIRCd::Run().

bool TimerManager::TimerComparison Timer one,
Timer two
[static]
 

Compares two timers.

Definition at line 61 of file timer.cpp.

References Timer::GetTimer().

Referenced by AddTimer().


Member Data Documentation

InspIRCd* TimerManager::ServerInstance [protected]
 

Creating server instance.

Definition at line 123 of file timer.h.

std::vector<Timer *> TimerManager::Timers [protected]
 

A list of all pending timers.

Definition at line 119 of file timer.h.

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


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