ndn::util::scheduler::ScopedEventId Class Reference

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

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

Public Member Functions

 ScopedEventId (Scheduler &scheduler) noexcept
 Construct ScopedEventId tied to the specified scheduler. More...
 
 ScopedEventId (const ScopedEventId &)=delete
 
 ScopedEventId (ScopedEventId &&) noexcept
 Move constructor. More...
 
 ~ScopedEventId ()
 Destructor, automatically cancels the event. More...
 
void cancel ()
 Manually cancel the event. More...
 
ScopedEventIdoperator= (const ScopedEventId &)=delete
 
ScopedEventIdoperator= (ScopedEventId &&) noexcept
 Move assignment operator. More...
 
ScopedEventIdoperator= (EventId event)
 Assign an event. More...
 
void release () noexcept
 Release 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)
explicitnoexcept

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 28 of file scheduler-scoped-event-id.cpp.

ndn::util::scheduler::ScopedEventId::ScopedEventId ( const ScopedEventId )
delete
ndn::util::scheduler::ScopedEventId::ScopedEventId ( ScopedEventId &&  )
inlinedefaultnoexcept

Move constructor.

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

Destructor, automatically cancels the event.

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

Member Function Documentation

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

Manually cancel the event.

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

ScopedEventId& ndn::util::scheduler::ScopedEventId::operator= ( const ScopedEventId )
delete
ScopedEventId & ndn::util::scheduler::ScopedEventId::operator= ( ScopedEventId &&  )
inlinedefaultnoexcept

Move assignment operator.

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

Assign 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 this ScopedEventId is tied to the correct Scheduler. Behavior is undefined when assigning an event scheduled in another Scheduler instance.

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

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

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

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