NS-3 based Named Data Networking (NDN) simulator
ndnSIM 2.5: 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 () noexcept
 cancels the event More...
 
void cancel ()
 cancels the event manually More...
 
void release () noexcept
 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

◆ ScopedEventId() [1/2]

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.

◆ ScopedEventId() [2/2]

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

move constructor

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

◆ ~ScopedEventId()

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

cancels the event

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

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

Member Function Documentation

◆ operator=()

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().

◆ cancel()

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().

◆ release()

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

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: