utils: Removing concept of periodic event from Scheduler
Change-Id: I66563ec50a54e959974b516ae45357bc4797b67f
Refs: #1670
diff --git a/src/util/scheduler.cpp b/src/util/scheduler.cpp
index 9cf2357..d51f83d 100644
--- a/src/util/scheduler.cpp
+++ b/src/util/scheduler.cpp
@@ -63,10 +63,8 @@
};
Scheduler::EventInfo::EventInfo(const time::nanoseconds& after,
- const time::nanoseconds& period,
const Event& event)
: m_scheduledTime(time::steady_clock::now() + after)
- , m_period(period)
, m_event(event)
{
}
@@ -74,7 +72,6 @@
Scheduler::EventInfo::EventInfo(const time::steady_clock::TimePoint& when,
const EventInfo& previousEvent)
: m_scheduledTime(when)
- , m_period(previousEvent.m_period)
, m_event(previousEvent.m_event)
, m_eventId(previousEvent.m_eventId)
{
@@ -102,15 +99,7 @@
Scheduler::scheduleEvent(const time::nanoseconds& after,
const Event& event)
{
- return schedulePeriodicEvent(after, time::nanoseconds(-1), event);
-}
-
-EventId
-Scheduler::schedulePeriodicEvent(const time::nanoseconds& after,
- const time::nanoseconds& period,
- const Event& event)
-{
- EventQueue::iterator i = m_events.insert(EventInfo(after, period, event));
+ EventQueue::iterator i = m_events.insert(EventInfo(after, event));
// On OSX 10.9, boost, and C++03 the following doesn't work without ndn::
// because the argument-dependent lookup prefers STL to boost
@@ -178,19 +167,8 @@
EventQueue::iterator head = m_events.begin();
Event event = head->m_event;
- if (head->m_period < time::nanoseconds::zero())
- {
- head->m_eventId->invalidate();
- m_events.erase(head);
- }
- else
- {
- // "reschedule" and update EventId data of the event
- EventInfo event(now + head->m_period, *head);
- EventQueue::iterator i = m_events.insert(event);
- i->m_eventId->reset(i);
- m_events.erase(head);
- }
+ head->m_eventId->invalidate();
+ m_events.erase(head);
event();
}