NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: NDN, CCN, CCNx, content centric networks
API Documentation
ndn::util::scheduler::Scheduler Class Reference

Generic scheduler. More...

#include <scheduler.hpp>

Inheritance diagram for ndn::util::scheduler::Scheduler:
Collaboration diagram for ndn::util::scheduler::Scheduler:

Public Member Functions

 Scheduler (DummyIoService &ioService)
 
 ~Scheduler ()
 
EventId scheduleEvent (time::nanoseconds after, const EventCallback &callback)
 Schedule a one-time event after the specified delay. More...
 
void cancelEvent (const EventId &eid)
 Cancel a scheduled event. More...
 
void cancelAllEvents ()
 Cancel all scheduled events. More...
 

Detailed Description

Generic scheduler.

Definition at line 150 of file scheduler.hpp.

Constructor & Destructor Documentation

◆ Scheduler()

ndn::util::scheduler::Scheduler::Scheduler ( DummyIoService ioService)
explicit

Definition at line 92 of file scheduler.cpp.

◆ ~Scheduler()

ndn::util::scheduler::Scheduler::~Scheduler ( )

Definition at line 97 of file scheduler.cpp.

References cancelAllEvents().

Member Function Documentation

◆ scheduleEvent()

EventId ndn::util::scheduler::Scheduler::scheduleEvent ( time::nanoseconds  after,
const EventCallback callback 
)

Schedule a one-time event after the specified delay.

Returns
EventId that can be used to cancel the scheduled event

Definition at line 103 of file scheduler.cpp.

Referenced by ndn::Face::Impl::Impl(), nfd::scheduler::schedule(), ndn::InMemoryStorageEntry::scheduleMarkStale(), and ndn::util::SegmentFetcher::stop().

◆ cancelEvent()

void ndn::util::scheduler::Scheduler::cancelEvent ( const EventId eid)
inline

Cancel a scheduled event.

You may also invoke eid.cancel()

Definition at line 169 of file scheduler.hpp.

References ndn::detail::CancelHandle::cancel().

Referenced by ndn::util::SegmentFetcher::stop().

◆ cancelAllEvents()

void ndn::util::scheduler::Scheduler::cancelAllEvents ( )

Cancel all scheduled events.

Definition at line 141 of file scheduler.cpp.

Referenced by ~Scheduler().


The documentation for this class was generated from the following files: