A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
ns3::EventImpl Class Referenceabstract

A simulation event. More...

#include "event-impl.h"

+ Inheritance diagram for ns3::EventImpl:
+ Collaboration diagram for ns3::EventImpl:

Public Member Functions

 EventImpl ()
 Default constructor.
 
virtual ~EventImpl ()=0
 Destructor.
 
void Cancel ()
 Marks the event as 'canceled'.
 
void Invoke ()
 Called by the simulation engine to notify the event that it is time to execute.
 
bool IsCancelled ()
 
- Public Member Functions inherited from ns3::SimpleRefCount< EventImpl >
 SimpleRefCount ()
 Default constructor.
 
 SimpleRefCount (const SimpleRefCount &o)
 Copy constructor.
 
uint32_t GetReferenceCount () const
 Get the reference count of the object.
 
SimpleRefCountoperator= (const SimpleRefCount &o)
 Assignment operator.
 
void Ref () const
 Increment the reference count.
 
void Unref () const
 Decrement the reference count.
 

Protected Member Functions

virtual void Notify ()=0
 Implementation for Invoke().
 

Private Attributes

bool m_cancel
 Has this event been cancelled.
 

Detailed Description

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 34 of file event-impl.h.

Constructor & Destructor Documentation

◆ EventImpl()

ns3::EventImpl::EventImpl ( )

Default constructor.

Definition at line 29 of file event-impl.cc.

References NS_LOG_FUNCTION.

◆ ~EventImpl()

ns3::EventImpl::~EventImpl ( )
pure virtual

Destructor.

Definition at line 24 of file event-impl.cc.

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Cancel()

void ns3::EventImpl::Cancel ( )

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 46 of file event-impl.cc.

References m_cancel, and NS_LOG_FUNCTION.

Referenced by ns3::DefaultSimulatorImpl::Remove(), ns3::DistributedSimulatorImpl::Remove(), and ns3::NullMessageSimulatorImpl::Remove().

+ Here is the caller graph for this function:

◆ Invoke()

void ns3::EventImpl::Invoke ( )

Called by the simulation engine to notify the event that it is time to execute.

Definition at line 36 of file event-impl.cc.

References m_cancel, Notify(), and NS_LOG_FUNCTION.

Referenced by ns3::EmlsrManager::NotifyMgtFrameReceived(), ns3::DefaultSimulatorImpl::ProcessOneEvent(), ns3::DistributedSimulatorImpl::ProcessOneEvent(), ns3::NullMessageSimulatorImpl::ProcessOneEvent(), and ns3::RealtimeSimulatorImpl::ProcessOneEvent().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ IsCancelled()

bool ns3::EventImpl::IsCancelled ( )
Returns
true if the event has been canceled.

Checked by the simulation engine before calling Invoke().

Definition at line 53 of file event-impl.cc.

References m_cancel, and NS_LOG_FUNCTION.

◆ Notify()

virtual void ns3::EventImpl::Notify ( )
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().

+ Here is the caller graph for this function:

Member Data Documentation

◆ m_cancel

bool ns3::EventImpl::m_cancel
private

Has this event been cancelled.

Definition at line 69 of file event-impl.h.

Referenced by Cancel(), Invoke(), and IsCancelled().


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