27 prefix_ senf::scheduler::detail::TimerDispatcher::TimerDispatcher()
28 : source_ (new PollTimerSource())
31 prefix_ senf::scheduler::detail::TimerDispatcher::~TimerDispatcher()
33 TimerSet::iterator i (timers_.begin());
34 TimerSet::iterator
const i_end (timers_.end());
35 for (; i != i_end; ++i)
36 FIFORunner::instance().dequeue(&(*i));
39 void senf::scheduler::detail::TimerDispatcher::add(TimerEvent & event)
41 TimerSet::iterator i (timers_.insert(event));
42 FIFORunner::instance().enqueue(&(*i));
45 prefix_ void senf::scheduler::detail::TimerDispatcher::remove(TimerEvent & event)
47 TimerSet::iterator i (TimerSet::s_iterator_to(event));
48 if (i == timers_.end())
50 FIFORunner::instance().dequeue(&(*i));
54 prefix_ void senf::scheduler::detail::TimerDispatcher::prepareRun()
56 TimerSet::iterator i (timers_.begin());
57 TimerSet::iterator
const i_end (timers_.end());
58 ClockService::clock_type
const &
now (FdManager::instance().
eventTime());
59 for (; i != i_end && i->timeout_ <=
now ; ++i)
63 prefix_ void senf::scheduler::detail::TimerDispatcher::reschedule()
68 source_->timeout(timers_.begin()->timeout_);
74 prefix_ void senf::scheduler::TimerEvent::v_run()
80 prefix_ char const * senf::scheduler::TimerEvent::v_type()
86 prefix_ std::string senf::scheduler::TimerEvent::v_info()
90 ss.imbue( std::locale(ss.getloc(),
91 new boost::posix_time::time_facet(
"%Y-%m-%d %H:%M:%S.%f-0000")) );
TimerDispatcher public header.
ClockService::clock_type const & now()
Return (approximate) current time.
ClockService::clock_type const & eventTime()
Return timestamp of last event.
static abstime_type abstime(clock_type const &clock)
Convert clock to absolute time.
void disable()
Disable timer.