A Discrete-Event Network Simulator
API
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. 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...
 
SimpleRefCountoperator= ([[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...
 

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

Constructor & Destructor Documentation

◆ EventImpl()

ns3::EventImpl::EventImpl ( )

Default constructor.

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

References NS_LOG_FUNCTION.

◆ ~EventImpl()

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

Destructor.

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

References NS_LOG_FUNCTION.

Member Function Documentation

◆ Cancel()

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.

◆ Invoke()

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

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

◆ IsCancelled()

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

Checked by the simulation engine before calling Invoke().

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

References m_cancel, and NS_LOG_FUNCTION.

◆ Notify()

virtual void ns3::EventImpl::Notify ( void  )
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 79 of file event-impl.h.

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


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