Anope IRC Services  Version 2.0
Public Member Functions | Private Attributes
Timer Class Referenceabstract

#include <timers.h>

Inheritance diagram for Timer:
Inheritance graph
[legend]
Collaboration diagram for Timer:
Collaboration graph
[legend]

Public Member Functions

 Timer (long time_from_now, time_t now=Anope::CurTime, bool repeating=false)
 
 Timer (Module *creator, long time_from_now, time_t now=Anope::CurTime, bool repeating=false)
 
virtual ~Timer ()
 
void SetTimer (time_t t)
 
time_t GetTimer () const
 
bool GetRepeat () const
 
void SetSecs (time_t t)
 
long GetSecs () const
 
time_t GetSetTime () const
 
ModuleGetOwner () const
 
virtual void Tick (time_t ctime)=0
 

Private Attributes

Moduleowner
 
time_t settime
 
time_t trigger
 
long secs
 
bool repeat
 

Detailed Description

Definition at line 18 of file timers.h.

Constructor & Destructor Documentation

Timer::Timer ( long  time_from_now,
time_t  now = Anope::CurTime,
bool  repeating = false 
)

Constructor, initializes the triggering time

Parameters
time_from_nowThe number of seconds from now to trigger the timer
nowThe time now
repeatingRepeat this timer every time_from_now if this is true

Definition at line 15 of file timers.cpp.

References TimerManager::AddTimer(), owner, repeat, secs, settime, and trigger.

Timer::Timer ( Module creator,
long  time_from_now,
time_t  now = Anope::CurTime,
bool  repeating = false 
)

Constructor, initializes the triggering time

Parameters
creatorThe creator of the timer
time_from_nowThe number of seconds from now to trigger the timer
nowThe time now
repeatingRepeat this timer every time_from_now if this is true

Definition at line 26 of file timers.cpp.

References TimerManager::AddTimer(), owner, repeat, secs, settime, and trigger.

Timer::~Timer ( )
virtual

Destructor, removes the timer from the list

Definition at line 37 of file timers.cpp.

References TimerManager::DelTimer().

Member Function Documentation

Module * Timer::GetOwner ( ) const

Returns the owner of this timer, if any

Returns
The owner of the timer

Definition at line 77 of file timers.cpp.

References owner.

bool Timer::GetRepeat ( ) const

Returns true if the timer is set to repeat

Returns
Returns true if the timer is set to repeat

Definition at line 54 of file timers.cpp.

References repeat.

Referenced by TimerManager::TickTimers().

long Timer::GetSecs ( ) const

Returns the interval between ticks

Returns
The interval

Definition at line 72 of file timers.cpp.

References secs.

Referenced by TimerManager::TickTimers().

time_t Timer::GetSetTime ( ) const

Returns the time this timer was created

Returns
The time this timer was created

Definition at line 59 of file timers.cpp.

References settime.

time_t Timer::GetTimer ( ) const

Retrieve the triggering time

Returns
The trigger time

Definition at line 49 of file timers.cpp.

References trigger.

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

void Timer::SetSecs ( time_t  t)

Set the interval between ticks t The new interval

Definition at line 64 of file timers.cpp.

References TimerManager::AddTimer(), Anope::CurTime, TimerManager::DelTimer(), secs, and trigger.

Referenced by ModuleProxyScan::OnReload().

void Timer::SetTimer ( time_t  t)

Set the trigger time to a new value

Parameters
tThe new time

Definition at line 42 of file timers.cpp.

References TimerManager::AddTimer(), TimerManager::DelTimer(), and trigger.

Referenced by TimerManager::TickTimers().

virtual void Timer::Tick ( time_t  ctime)
pure virtual

Field Documentation

Module* Timer::owner
private

The owner of the timer, if any

Definition at line 23 of file timers.h.

Referenced by GetOwner(), and Timer().

bool Timer::repeat
private

True if this is a repeating timer

Definition at line 39 of file timers.h.

Referenced by GetRepeat(), and Timer().

long Timer::secs
private

Numer of seconds between triggers

Definition at line 35 of file timers.h.

Referenced by GetSecs(), SetSecs(), and Timer().

time_t Timer::settime
private

The time this was created

Definition at line 27 of file timers.h.

Referenced by GetSetTime(), and Timer().

time_t Timer::trigger
private

The triggering time

Definition at line 31 of file timers.h.

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


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