WSF
wsf::comm::LayerEvent Class Reference

#include <WsfCommLayerEvent.hpp>

Inheritance diagram for wsf::comm::LayerEvent:
Collaboration diagram for wsf::comm::LayerEvent:

Public Member Functions

 LayerEvent (double aSimTime, size_t aLayerIndex, Comm *aXmtrPtr, layer::Message aMessage, Message *aCommMessagePtr)
 ~LayerEvent () override=default
EventDisposition Execute () override
Public Member Functions inherited from WsfEvent
 WsfEvent ()=default
 WsfEvent (double aSimTime, int aPriority=0)
 WsfEvent (const WsfEvent &aSrc)=delete
 Copy constructor and copy assignment deleted to prevent copying.
WsfEventoperator= (const WsfEvent &aRhs)=delete
virtual ~WsfEvent ()=default
double GetTime () const
int GetPriority () const
bool ShouldExecute () const
void SetTime (double aSimTime)
void SetPriority (int aPriority)
void SetShouldExecute (bool aExecute)
WsfSimulationGetSimulation () const
void AddedToEventQueue (WsfSimulation &aSimulation)
 Called when the event is added to the event queue of the specified simulation.

Static Public Member Functions

static void ScheduleCommLayerEvent (double aSimTime, size_t aLayerIndex, Comm *aXmtrPtr, layer::Message aMessage, Message *aCommMessagePtr=nullptr)
 This message is just a wrapper for a generic event, to avoid.

Public Attributes

size_t mCommLayerIndex
size_t mXmtrPlatformIndex
CommmXmtrPtr
layer::Message mLayerMessage
std::unique_ptr< MessagemCommMessagePtr

Additional Inherited Members

Public Types inherited from WsfEvent
enum  EventDisposition { cDELETE , cRESCHEDULE }

Constructor & Destructor Documentation

◆ LayerEvent()

wsf::comm::LayerEvent::LayerEvent ( double aSimTime,
size_t aLayerIndex,
Comm * aXmtrPtr,
layer::Message aMessage,
Message * aCommMessagePtr )

Note: The message is cloned in a layer event, as these objects may be scheduled beyond the lifetime of the passed message object. As a smart pointer object, they are automatically deallocated when the protocol event being fired is completed. If the passed message object requires an extended lifetime, it must be cloned or moved from the event object.

References mCommLayerIndex, mCommMessagePtr, mLayerMessage, mXmtrPlatformIndex, mXmtrPtr, and WsfEvent::WsfEvent().

◆ ~LayerEvent()

wsf::comm::LayerEvent::~LayerEvent ( )
overridedefault

Member Function Documentation

◆ Execute()

WsfEvent::EventDisposition wsf::comm::LayerEvent::Execute ( )
overridevirtual

Execute the specified event.

Returns
The disposition of the event. This indicates to the event manager what should be done with the event. If cRESCHEDULE then Execute should have called SetTime to set the time for which the event manager should reschedule the event.

Implements WsfEvent.

References WsfEvent::cDELETE, WsfSimulation::GetPlatformByIndex(), WsfEvent::GetSimulation(), WsfEvent::GetTime(), mCommLayerIndex, mCommMessagePtr, mLayerMessage, mXmtrPlatformIndex, and mXmtrPtr.

◆ ScheduleCommLayerEvent()

Member Data Documentation

◆ mCommLayerIndex

size_t wsf::comm::LayerEvent::mCommLayerIndex

Referenced by Execute(), and LayerEvent().

◆ mCommMessagePtr

std::unique_ptr<Message> wsf::comm::LayerEvent::mCommMessagePtr

Referenced by Execute(), and LayerEvent().

◆ mLayerMessage

layer::Message wsf::comm::LayerEvent::mLayerMessage

Referenced by Execute(), and LayerEvent().

◆ mXmtrPlatformIndex

size_t wsf::comm::LayerEvent::mXmtrPlatformIndex

Referenced by Execute(), and LayerEvent().

◆ mXmtrPtr

Comm* wsf::comm::LayerEvent::mXmtrPtr

Referenced by Execute(), and LayerEvent().


The documentation for this class was generated from the following files:
Copyrights Multiple, All Rights Reserved