All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ndn::Scheduler Class Reference

Generic scheduler. More...

#include <scheduler.hpp>

Public Types

typedef function< void()> Event
 

Public Member Functions

 Scheduler (boost::asio::io_service &ioService)
 
EventId scheduleEvent (const time::nanoseconds &after, const Event &event)
 Schedule one time event after the specified delay. More...
 
EventId schedulePeriodicEvent (const time::nanoseconds &after, const time::nanoseconds &period, const Event &event)
 Schedule periodic event that should be fired every specified period. More...
 
void cancelEvent (const EventId &eventId)
 Cancel scheduled event. More...
 

Friends

struct EventIdImpl
 

Detailed Description

Generic scheduler.

Definition at line 24 of file scheduler.hpp.

Member Typedef Documentation

typedef function<void()> ndn::Scheduler::Event

Definition at line 27 of file scheduler.hpp.

Constructor & Destructor Documentation

ndn::Scheduler::Scheduler ( boost::asio::io_service &  ioService)

Definition at line 78 of file scheduler.cpp.

Member Function Documentation

void ndn::Scheduler::cancelEvent ( const EventId eventId)

Cancel scheduled event.

Definition at line 115 of file scheduler.cpp.

EventId ndn::Scheduler::scheduleEvent ( const time::nanoseconds &  after,
const Event event 
)

Schedule one time event after the specified delay.

Returns
EventId that can be used to cancel the scheduled event

Definition at line 86 of file scheduler.cpp.

EventId ndn::Scheduler::schedulePeriodicEvent ( const time::nanoseconds &  after,
const time::nanoseconds &  period,
const Event event 
)

Schedule periodic event that should be fired every specified period.

   First event will be fired after the specified delay.
Returns
EventId that can be used to cancel the scheduled event

Definition at line 93 of file scheduler.cpp.

Friends And Related Function Documentation

friend struct EventIdImpl
friend

Definition at line 89 of file scheduler.hpp.