Kea 2.5.8
isc::dhcp::TimerMgrImpl Class Reference

Implementation of the TimerMgr. More...

Public Member Functions

 TimerMgrImpl ()
 Constructor.
 
void cancel (const std::string &timer_name)
 Cancels the execution of the interval timer.
 
bool isTimerRegistered (const std::string &timer_name)
 Checks if the timer with a specified name has been registered.
 
void registerTimer (const std::string &timer_name, const asiolink::IntervalTimer::Callback &callback, const long interval, const asiolink::IntervalTimer::Mode &scheduling_mode)
 Registers new timer in the TimerMgr.
 
void setIOService (const IOServicePtr &io_service)
 Sets IO service to be used by the Timer Manager.
 
void setup (const std::string &timer_name)
 Schedules the execution of the interval timer.
 
size_t timersCount () const
 Returns the number of registered timers.
 
void unregisterTimer (const std::string &timer_name)
 Unregisters specified timer.
 
void unregisterTimers ()
 Unregisters all timers.
 

Detailed Description

Implementation of the TimerMgr.

Definition at line 83 of file timer_mgr.cc.

Constructor & Destructor Documentation

◆ TimerMgrImpl()

isc::dhcp::TimerMgrImpl::TimerMgrImpl ( )

Constructor.

Definition at line 232 of file timer_mgr.cc.

Member Function Documentation

◆ cancel()

void isc::dhcp::TimerMgrImpl::cancel ( const std::string &  timer_name)

Cancels the execution of the interval timer.

Parameters
timer_nameUnique timer name.
Exceptions
BadValueif the timer hasn't been registered.

Definition at line 391 of file timer_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

+ Here is the call graph for this function:

◆ isTimerRegistered()

bool isc::dhcp::TimerMgrImpl::isTimerRegistered ( const std::string &  timer_name)

Checks if the timer with a specified name has been registered.

Parameters
timer_nameName of the timer.
Returns
true if the timer with the specified name has been registered, false otherwise.

Definition at line 343 of file timer_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

+ Here is the call graph for this function:

◆ registerTimer()

void isc::dhcp::TimerMgrImpl::registerTimer ( const std::string &  timer_name,
const asiolink::IntervalTimer::Callback callback,
const long  interval,
const asiolink::IntervalTimer::Mode scheduling_mode 
)

Registers new timer in the TimerMgr.

Parameters
timer_nameUnique name for the timer.
callbackPointer to the callback function to be invoked when the timer elapses, e.g. function processing expired leases in the DHCP server.
intervalTimer interval in milliseconds.
scheduling_modeScheduling mode of the timer as described in asiolink::IntervalTimer::Mode.
Exceptions
BadValueif the timer name is invalid or duplicate.

Definition at line 246 of file timer_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

+ Here is the call graph for this function:

◆ setIOService()

void isc::dhcp::TimerMgrImpl::setIOService ( const IOServicePtr io_service)

Sets IO service to be used by the Timer Manager.

Parameters
io_servicePointer to the IO service.

Definition at line 237 of file timer_mgr.cc.

References isc_throw.

◆ setup()

void isc::dhcp::TimerMgrImpl::setup ( const std::string &  timer_name)

Schedules the execution of the interval timer.

This method schedules the timer, i.e. the callback will be executed after specified interval elapses. The interval has been specified during timer registration. Depending on the mode selected during the timer registration, the callback will be executed once after it has been scheduled or until it is cancelled. Though, in the former case the timer can be re-scheduled in the callback function.

Parameters
timer_nameUnique timer name.
Exceptions
BadValueif the timer hasn't been registered.

Definition at line 363 of file timer_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

+ Here is the call graph for this function:

◆ timersCount()

size_t isc::dhcp::TimerMgrImpl::timersCount ( ) const

Returns the number of registered timers.

Definition at line 353 of file timer_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

+ Here is the call graph for this function:

◆ unregisterTimer()

void isc::dhcp::TimerMgrImpl::unregisterTimer ( const std::string &  timer_name)

Unregisters specified timer.

This method cancels the timer if it is setup and removes the timer from the internal collection of timers.

Parameters
timer_nameName of the timer to be unregistered.
Exceptions
BadValueif the specified timer hasn't been registered.

Definition at line 286 of file timer_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

+ Here is the call graph for this function:

◆ unregisterTimers()

void isc::dhcp::TimerMgrImpl::unregisterTimers ( )

Unregisters all timers.

This method must be explicitly called prior to termination of the process.

Definition at line 314 of file timer_mgr.cc.

References isc::util::MultiThreadingMgr::instance().

+ Here is the call graph for this function:

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