A simulation event. More...
#include "event-impl.h"
Public Member Functions | |
EventImpl () | |
Default constructor. More... | |
virtual | ~EventImpl ()=0 |
Destructor. More... | |
void | Cancel (void) |
Marks the event as 'canceled'. More... | |
void | Invoke (void) |
Called by the simulation engine to notify the event that it is time to execute. More... | |
bool | IsCancelled (void) |
Public Member Functions inherited from ns3::SimpleRefCount< EventImpl > | |
SimpleRefCount () | |
Default constructor. More... | |
SimpleRefCount (const SimpleRefCount &o[[maybe_unused]]) | |
Copy constructor. More... | |
uint32_t | GetReferenceCount (void) const |
Get the reference count of the object. More... | |
SimpleRefCount & | operator= ([[maybe_unused]] const SimpleRefCount &o) |
Assignment operator. More... | |
void | Ref (void) const |
Increment the reference count. More... | |
void | Unref (void) const |
Decrement the reference count. More... | |
Protected Member Functions | |
virtual void | Notify (void)=0 |
Implementation for Invoke(). More... | |
Private Attributes | |
bool | m_cancel |
Has this event been cancelled. More... | |
A simulation event.
Each subclass of this base class represents a simulation event. The Invoke() method will be called by the simulation engine when it reaches the time associated to this event. Most subclasses are usually created by one of the many Simulator::Schedule methods.
Definition at line 44 of file event-impl.h.
ns3::EventImpl::EventImpl | ( | ) |
|
pure virtual |
void ns3::EventImpl::Cancel | ( | void | ) |
Marks the event as 'canceled'.
The event is not removed from the event list but the simulation engine will check its canceled status before calling Invoke().
Definition at line 56 of file event-impl.cc.
References m_cancel, and NS_LOG_FUNCTION.
void ns3::EventImpl::Invoke | ( | void | ) |
Called by the simulation engine to notify the event that it is time to execute.
Definition at line 46 of file event-impl.cc.
References m_cancel, Notify(), and NS_LOG_FUNCTION.
Referenced by ns3::DefaultSimulatorImpl::ProcessOneEvent(), ns3::DistributedSimulatorImpl::ProcessOneEvent(), and ns3::NullMessageSimulatorImpl::ProcessOneEvent().
bool ns3::EventImpl::IsCancelled | ( | void | ) |
Checked by the simulation engine before calling Invoke().
Definition at line 63 of file event-impl.cc.
References m_cancel, and NS_LOG_FUNCTION.
|
protectedpure virtual |
Implementation for Invoke().
This typically calls a method or function pointer with the arguments bound by a call to one of the MakeEvent() functions.
Referenced by Invoke().
|
private |
Has this event been cancelled.
Definition at line 79 of file event-impl.h.
Referenced by Cancel(), Invoke(), and IsCancelled().