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

A handle for a scheduled event. More...

#include <scheduler.hpp>

Inheritance diagram for ndn::scheduler::EventId:
Collaboration diagram for ndn::scheduler::EventId:

Public Member Functions

 EventId () noexcept=default
 Constructs an empty EventId. More...
 operator bool () const noexcept
 Determine whether the event is valid. More...
void reset () noexcept
 Clear this EventId without canceling. More...
- Public Member Functions inherited from ndn::detail::CancelHandle
 CancelHandle () noexcept
 CancelHandle (std::function< void()> cancel) noexcept
void cancel () const
 Cancel the operation. More...


class Scheduler
bool operator== (const EventId &lhs, const EventId &rhs) noexcept
 Determine whether this and other refer to the same event, or are both empty/expired/cancelled. More...
bool operator!= (const EventId &lhs, const EventId &rhs) noexcept
std::ostream & operator<< (std::ostream &os, const EventId &eventId)

Detailed Description

A handle for a scheduled event.

EventId eid = scheduler.schedule(10_ms, [] { doSomething(); });
eid.cancel(); // cancel the event
Canceling an expired (executed) or canceled event has no effect.
Canceling an event after the scheduler has been destructed may trigger undefined behavior.

Definition at line 58 of file scheduler.hpp.

Constructor & Destructor Documentation

◆ EventId()

ndn::scheduler::EventId::EventId ( )

Constructs an empty EventId.

Member Function Documentation

◆ operator bool()

ndn::scheduler::EventId::operator bool ( ) const

Determine whether the event is valid.

Return values
trueThe event is valid.
falseThis EventId is empty, or the event is expired or cancelled.

Definition at line 61 of file scheduler.cpp.

◆ reset()

void ndn::scheduler::EventId::reset ( )

Clear this EventId without canceling.


Definition at line 68 of file scheduler.cpp.

Friends And Related Function Documentation

◆ Scheduler

friend class Scheduler

Definition at line 105 of file scheduler.hpp.

◆ operator==

bool operator== ( const EventId lhs,
const EventId rhs 

Determine whether this and other refer to the same event, or are both empty/expired/cancelled.

Definition at line 86 of file scheduler.hpp.

◆ operator!=

bool operator!= ( const EventId lhs,
const EventId rhs 

Definition at line 94 of file scheduler.hpp.

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const EventId eventId 

Definition at line 73 of file scheduler.cpp.

The documentation for this class was generated from the following files:
EventId() noexcept=default
Constructs an empty EventId.
Definition: scheduler.cpp:27