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

Event that is automatically cancelled upon destruction. More...

#include <scheduler-scoped-event-id.hpp>

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

Public Member Functions

 ScopedEventId (Scheduler &scheduler)
 Construct ScopedEventId tied to the specified scheduler. More...
 
 ScopedEventId (ScopedEventId &&other) noexcept
 move constructor More...
 
ScopedEventIdoperator= (const EventId &event)
 assigns an event More...
 
 ~ScopedEventId ()
 cancels the event More...
 
void cancel ()
 cancels the event manually More...
 
void release ()
 releases the event so that it won't be canceled when this ScopedEventId is destructed More...
 

Detailed Description

Event that is automatically cancelled upon destruction.

Definition at line 33 of file scheduler-scoped-event-id.hpp.

Constructor & Destructor Documentation

ndn::util::scheduler::ScopedEventId::ScopedEventId ( Scheduler scheduler)
explicit

Construct ScopedEventId tied to the specified scheduler.

Parameters
schedulerScheduler to which the event is tied. Behavior is undefined if scheduler is destructed before an uncanceled ScopedEventId.

Definition at line 33 of file scheduler-scoped-event-id.cpp.

ndn::util::scheduler::ScopedEventId::ScopedEventId ( ScopedEventId &&  other)
noexcept

move constructor

Definition at line 38 of file scheduler-scoped-event-id.cpp.

ndn::util::scheduler::ScopedEventId::~ScopedEventId ( )

cancels the event

Definition at line 55 of file scheduler-scoped-event-id.cpp.

References ndn::util::scheduler::Scheduler::cancelEvent().

Member Function Documentation

ScopedEventId & ndn::util::scheduler::ScopedEventId::operator= ( const EventId event)

assigns an event

If a different event has been assigned to this instance previously, that event will be cancelled immediately.

Note
The caller should ensure that ScopedEventId is tied to a correct scheduler. Behavior is undefined when assigning event scheduled in another scheduler instance.

Definition at line 46 of file scheduler-scoped-event-id.cpp.

References ndn::util::scheduler::Scheduler::cancelEvent().

void ndn::util::scheduler::ScopedEventId::cancel ( )

cancels the event manually

Definition at line 61 of file scheduler-scoped-event-id.cpp.

References ndn::util::scheduler::Scheduler::cancelEvent().

void ndn::util::scheduler::ScopedEventId::release ( )

releases the event so that it won't be canceled when this ScopedEventId is destructed

Definition at line 67 of file scheduler-scoped-event-id.cpp.


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