#include <Timer.h>
Provides methods for scheduling timers. Derived classes must override the pure virtual timeout() method.
Definition at line 164 of file Timer.h.
Public Member Functions | |
Timer () | |
virtual | ~Timer () |
void | schedule_at (struct timeval *when) |
void | schedule_in (int milliseconds) |
void | schedule_immediate () |
bool | cancel () |
bool | pending () |
bool | cancelled () |
struct timeval | when () |
virtual void | timeout (const struct timeval &now)=0 |
Protected Types | |
enum | cancel_flags_t { NO_DELETE = 0, DELETE_ON_CANCEL = 1 } |
Enum type for cancel flags related to memory management. More... | |
Protected Attributes | |
struct timeval | when_ |
When the timer should fire. | |
bool | pending_ |
Is the timer currently pending. | |
bool | cancelled_ |
Is this timer cancelled. | |
cancel_flags_t | cancel_flags_ |
Should we keep the timer around or delete it when the cancelled timer bubbles to the top. | |
Friends | |
class | TimerSystem |
class | TimerCompare |
enum oasys::Timer::cancel_flags_t [protected] |
virtual oasys::Timer::~Timer | ( | ) | [inline, virtual] |
void oasys::Timer::schedule_at | ( | struct timeval * | when | ) | [inline] |
Definition at line 181 of file Timer.h.
Referenced by dtn::BundleDaemon::add_to_pending(), dtn::CustodyTimer::CustodyTimer(), dtn::Registration::init_expiration_timer(), dtn::ProphetAckAgeTimer::reschedule(), and dtn::ProphetTableAgeTimer::reschedule().
void oasys::Timer::schedule_in | ( | int | milliseconds | ) | [inline] |
Definition at line 186 of file Timer.h.
Referenced by dtn::ContactManager::handle_link_unavailable(), oasys::RateEstimator::RateEstimator(), oasys::BerkeleyDBStore::DeadlockTimer::reschedule(), and oasys::RateEstimator::timeout().
bool oasys::Timer::cancel | ( | ) | [inline] |
Definition at line 195 of file Timer.h.
Referenced by dtn::Registration::cleanup_expiration_timer(), dtn::BundleDaemon::delete_from_pending(), dtn::ContactManager::handle_link_available(), dtn::ProphetController::shutdown(), and oasys::BerkeleyDBStore::~BerkeleyDBStore().
bool oasys::Timer::pending | ( | ) | [inline] |
Definition at line 200 of file Timer.h.
References pending_.
Referenced by dtn::BundleDaemon::handle_custody_timeout().
bool oasys::Timer::cancelled | ( | ) | [inline] |
Definition at line 205 of file Timer.h.
References cancelled_.
Referenced by dtn::BundleDaemon::handle_custody_timeout().
struct timeval oasys::Timer::when | ( | ) | [inline, read] |
virtual void oasys::Timer::timeout | ( | const struct timeval & | now | ) | [pure virtual] |
friend class TimerSystem [friend] |
friend class TimerCompare [friend] |
struct timeval oasys::Timer::when_ [read, protected] |
When the timer should fire.
Definition at line 227 of file Timer.h.
Referenced by oasys::TimerCompare::operator()(), oasys::TimerSystem::run_expired_timers(), oasys::TimerSystem::schedule_at(), and when().
bool oasys::Timer::pending_ [protected] |
Is the timer currently pending.
Definition at line 228 of file Timer.h.
Referenced by oasys::TimerSystem::cancel(), pending(), oasys::TimerSystem::schedule_at(), ~Timer(), and oasys::TimerSystem::~TimerSystem().
bool oasys::Timer::cancelled_ [protected] |
Is this timer cancelled.
Definition at line 229 of file Timer.h.
Referenced by oasys::TimerSystem::cancel(), cancelled(), and oasys::TimerSystem::schedule_at().
cancel_flags_t oasys::Timer::cancel_flags_ [protected] |