WSF
wsf::comm::Layer Class Reference

#include <WsfCommLayer.hpp>

Inheritance diagram for wsf::comm::Layer:
Collaboration diagram for wsf::comm::Layer:

Public Types

enum class  LayerType : size_t {
  cPHYSICAL , cDATALINK , cNETWORK , cTRANSPORT ,
  cSESSION , cPRESENTATION , cAPPLICATION , cNONE
}

Public Member Functions

 Layer (Layer::LayerType aCommLayerType, LayerImp *aCommLayerImpPtr)
virtual ~Layer ()
Public Member Functions inherited from WsfUniqueId
 WsfUniqueId ()
 Construtor initializes the unique identifier to 0.
 WsfUniqueId (const WsfUniqueId &)
 Copy constructor initializes the unique identifier to 0.
WsfUniqueIdoperator= (const WsfUniqueId &)
unsigned int GetUniqueId () const
 Get the unique identifier assigned to this object.
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.

Runtime assignment of unique id.

Wrapper for WsfUniqueId::AssignUniqueId for public usage.

void SetID (WsfSimulation &aSim)
void SetUpperLayer (Layer *aLayerPtr)
void SetLowerLayer (Layer *aLayerPtr)
void SetIndex (size_t aIndex)
LayerGetUpperLayer () const
LayerGetLowerLayer () const
LayerImpGetCommLayerImp ()
 Layer (const Layer &aSrc)
 Copy constructor (for Clone()).

Common infrastructure methods.

virtual LayerClone () const
virtual bool Initialize (double aSimTime)
virtual bool Initialize2 (double aSimTime)
virtual bool ProcessInput (UtInput &aInput)

Send/Receive methods

virtual bool Receive (double aSimTime, Comm *aXmtrPtr, Message &aMessage)
virtual bool Send (double aSimTime, Message &aMessage)

Comm event methods.

virtual bool ProcessLayerMessage (double aSimTime, layer::Message aLayerMessage, Message *aCommMessagePtr)
 Process a layer event.

Methods to access the owning communication device.

CommParent () const
void SetParent (Comm *aParentCommPtr)
void SetDebugEnabled (bool aDebugEnabled)
LayerType GetLayerType () const

Additional Inherited Members

Protected Member Functions inherited from WsfUniqueId
void AssignUniqueId (WsfSimulation *aSimulationPtr)

Detailed Description

A base class for layers in the communication stack. It uses a bridge pattern to decouple the integration with the AFSIM simulation from the detailed implementation in a layer. Each layer has a unique ID assigned at initialization for potential runtime management of layers.

Member Enumeration Documentation

◆ LayerType

enum class wsf::comm::Layer::LayerType : size_t
strong

Communication layer as defined by the Open Systems Interconnection (OSI) model

Enumerator
cPHYSICAL 
cDATALINK 
cNETWORK 
cTRANSPORT 
cSESSION 
cPRESENTATION 
cAPPLICATION 
cNONE 

Constructor & Destructor Documentation

◆ Layer() [1/2]

wsf::comm::Layer::Layer ( Layer::LayerType aCommLayerType,
LayerImp * aCommLayerImpPtr )

◆ ~Layer()

wsf::comm::Layer::~Layer ( )
virtual

◆ Layer() [2/2]

wsf::comm::Layer::Layer ( const Layer & aSrc)
protected

Member Function Documentation

◆ Clone()

Layer * wsf::comm::Layer::Clone ( ) const
virtual

References Layer().

Referenced by Layer().

◆ GetCommLayerImp()

◆ GetLayerType()

LayerType wsf::comm::Layer::GetLayerType ( ) const
inline

◆ GetLowerLayer()

Layer * wsf::comm::Layer::GetLowerLayer ( ) const
inline

References Layer().

◆ GetUpperLayer()

Layer * wsf::comm::Layer::GetUpperLayer ( ) const
inline

References Layer().

◆ Initialize()

bool wsf::comm::Layer::Initialize ( double aSimTime)
virtual

◆ Initialize2()

bool wsf::comm::Layer::Initialize2 ( double aSimTime)
virtual

◆ Parent()

Comm * wsf::comm::Layer::Parent ( ) const

Referenced by Initialize(), and Layer().

◆ ProcessInput()

bool wsf::comm::Layer::ProcessInput ( UtInput & aInput)
virtual

◆ ProcessLayerMessage()

bool wsf::comm::Layer::ProcessLayerMessage ( double aSimTime,
layer::Message aLayerMessage,
Message * aCommMessagePtr )
virtual

Process a layer event.

References GetCommLayerImp(), and wsf::comm::LayerImp::ProcessLayerMessage().

◆ Receive()

bool wsf::comm::Layer::Receive ( double aSimTime,
Comm * aXmtrPtr,
Message & aMessage )
virtual

Receive a message. It is the responsibility of the receiver to actually determine if the message can be received (i.e. line-of-sight, enough power, etc).

Parameters
aSimTimeThe current simulation time.
aXmtrPtrThe comm device that sent the message.
aMessageThe received message.
Returns
true if the message was received or false if it could not.

References GetCommLayerImp(), wsf::comm::LayerImp::Receive(), and success.

◆ Send()

bool wsf::comm::Layer::Send ( double aSimTime,
Message & aMessage )
virtual

Send a message to a specific platform.

Parameters
aSimTimeThe current simulation time.
aMessageThe message to be sent.

References GetCommLayerImp(), wsf::comm::LayerImp::Send(), and success.

◆ SetDebugEnabled()

void wsf::comm::Layer::SetDebugEnabled ( bool aDebugEnabled)

◆ SetID()

void wsf::comm::Layer::SetID ( WsfSimulation & aSim)

◆ SetIndex()

void wsf::comm::Layer::SetIndex ( size_t aIndex)

◆ SetLowerLayer()

void wsf::comm::Layer::SetLowerLayer ( Layer * aLayerPtr)

References Layer().

◆ SetParent()

void wsf::comm::Layer::SetParent ( Comm * aParentCommPtr)

◆ SetUpperLayer()

void wsf::comm::Layer::SetUpperLayer ( Layer * aLayerPtr)

Methods to inform a layer of its neighbors and location in the protocol stack. These methods also propagate such data to the implementation for more complicated layer implementation that may need to know this data at runtime.

References Layer().


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