IBR-DTNSuite
0.8
|
#include <Timer.h>
Classes | |
class | StopTimerException |
Public Types | |
typedef size_t | time_t |
Public Member Functions | |
Timer (TimerCallback &callback, size_t timeout=0) | |
virtual | ~Timer () |
void | set (size_t timeout) |
void | reset () |
void | pause () |
size_t | getTimeout () const |
Static Public Member Functions | |
static time_t | get_current_time () |
Protected Member Functions | |
void | run () |
void | __cancellation () |
typedef size_t ibrcommon::Timer::time_t |
ibrcommon::Timer::Timer | ( | TimerCallback & | callback, |
size_t | timeout = 0 |
||
) |
ibrcommon::Timer::~Timer | ( | ) | [virtual] |
Definition at line 34 of file Timer.cpp.
References ibrcommon::JoinableThread::join(), and ibrcommon::JoinableThread::stop().
void ibrcommon::Timer::__cancellation | ( | ) | [protected, virtual] |
Implements ibrcommon::Thread.
Definition at line 40 of file Timer.cpp.
References ibrcommon::Conditional::abort(), and ibrcommon::StatefulConditional< T, block >::setState().
Timer::time_t ibrcommon::Timer::get_current_time | ( | ) | [static] |
Definition at line 19 of file Timer.cpp.
Referenced by dtn::api::Registration::isPersistent(), and dtn::api::Registration::setPersistent().
size_t ibrcommon::Timer::getTimeout | ( | ) | const |
void ibrcommon::Timer::pause | ( | ) |
This method stops the timer. Use reset() to start it again.
Definition at line 60 of file Timer.cpp.
References ibrcommon::StatefulConditional< T, block >::setState().
Referenced by dtn::core::WallClock::componentDown(), dtn::daemon::StatisticLogger::componentDown(), and dtn::api::ApiServer::componentDown().
void ibrcommon::Timer::reset | ( | ) |
This method resets the timer.
Definition at line 54 of file Timer.cpp.
References ibrcommon::StatefulConditional< T, block >::setState().
Referenced by dtn::core::WallClock::componentUp().
void ibrcommon::Timer::run | ( | ) | [protected, virtual] |
Abstract interface for thread context run method.
Implements ibrcommon::Thread.
Definition at line 71 of file Timer.cpp.
References ibrcommon::Conditional::ConditionalAbortException::COND_ABORT, ibrcommon::Conditional::ConditionalAbortException::COND_ERROR, ibrcommon::Conditional::ConditionalAbortException::COND_TIMEOUT, ibrcommon::StatefulConditional< T, block >::ifState(), ibrcommon::Conditional::ConditionalAbortException::reason, ibrcommon::StatefulConditional< T, block >::setState(), ibrcommon::TimerCallback::timeout(), ibrcommon::Conditional::wait(), and ibrcommon::Thread::yield().
void ibrcommon::Timer::set | ( | size_t | timeout | ) |
Definition at line 47 of file Timer.cpp.
References ibrcommon::StatefulConditional< T, block >::setState().
Referenced by dtn::daemon::StatisticLogger::componentUp().