Public Member Functions | Private Attributes

Timer Class Reference

#include <timers.h>

Inherited by CallBack, DNS::Request, ExpireTimer, MyManager, NickServCollide, NickServHeld, NickServRelease, ReconnectTimer, TCPSocket::Client, and UpdateTimer.

Public Member Functions

 Timer (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
virtual void Tick (time_t ctime)=0

Private Attributes

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_now The number of seconds from now to trigger the timer
now The time now
repeating Repeat this timer every time_from_now if this is true

Definition at line 15 of file timers.cpp.

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

Timer::~Timer (  )  [virtual]

Destructor, removes the timer from the list

Definition at line 25 of file timers.cpp.

References TimerManager::DelTimer().


Member Function Documentation

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 40 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 59 of file timers.cpp.

References secs.

Referenced by CSSeen::OnReload(), and TimerManager::TickTimers().

time_t Timer::GetSetTime (  )  const

Returns the time this timer was created

Returns:
The time this timer was created

Definition at line 45 of file timers.cpp.

References settime.

Referenced by NickServCollide::Tick().

time_t Timer::GetTimer (  )  const

Retrieve the triggering time

Returns:
The trigger time

Definition at line 35 of file timers.cpp.

References trigger.

Referenced by TimerManager::TimerComparison().

void Timer::SetSecs ( time_t  t  ) 

Set the interval between ticks t The new interval

Definition at line 50 of file timers.cpp.

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

Referenced by ModuleProxyScan::OnReload(), and CSSeen::OnReload().

void Timer::SetTimer ( time_t  t  ) 

Set the trigger time to a new value

Parameters:
t The new time

Definition at line 30 of file timers.cpp.

References trigger.

Referenced by TimerManager::TickTimers().

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

Field Documentation

bool Timer::repeat [private]

True if this is a repeating timer

Definition at line 35 of file timers.h.

Referenced by GetRepeat(), and Timer().

long Timer::secs [private]

Numer of seconds between triggers

Definition at line 31 of file timers.h.

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

time_t Timer::settime [private]

The time this was created

Definition at line 23 of file timers.h.

Referenced by GetSetTime(), and Timer().

time_t Timer::trigger [private]

The triggering time

Definition at line 27 of file timers.h.

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


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