WSF
WsfStatusMessage Class Reference

A 'status message' provides status about an operation. More...

#include <WsfStatusMessage.hpp>

Inheritance diagram for WsfStatusMessage:
Collaboration diagram for WsfStatusMessage:

Public Member Functions

 WsfStatusMessage ()
 Constructor, for XIO (de)serialization (create a Status message).
 WsfStatusMessage (WsfSimulation &aSimulation)
 WsfStatusMessage (WsfPlatform *aPlatformPtr)
 WsfStatusMessage (WsfStringId aStatusId, WsfPlatform *aPlatformPtr)
WsfMessageClone () const override
const char * GetScriptClassName () const override
Public Member Functions inherited from WsfMessage
 WsfMessage (WsfStringId aType)
 Constructor for XIO (de)serialization.
 WsfMessage (WsfStringId aType, const wsf::comm::Address &aSrcAddr, WsfSimulation &aSimulation)
 WsfMessage (WsfPlatform *aPlatformPtr)
 WsfMessage (WsfStringId aType, WsfPlatform *aPlatformPtr)
 WsfMessage (WsfStringId aType, WsfStringId aSubType, WsfPlatform *aPlatformPtr)
 WsfMessage (WsfSimulation &aSimulation)
WsfMessageoperator= (const WsfMessage &aRhs)=default
 ~WsfMessage () override
const char * GetScriptClassName () const override
WsfSimulationGetSimulation () const
 Get the simulation that owns the message.
void SetSimulation (WsfSimulation *aSimulationPtr)
WsfStringId GetOriginator () const
void SetOriginator (WsfPlatform *aPlatformPtr)
 Set the originator of this message.
size_t GetOriginatorIndex () const
int GetSizeBits () const
void SetSizeBits (int aSizeBits)
int GetSizeBytes () const
void SetSizeBytes (int aSizeBytes)
unsigned int GetSerialNumber () const
void SetSerialNumber (unsigned int aSerialNumber)
double GetDataTag () const
void SetDataTag (double aDataTag)
WsfStringId GetStaticType () const
WsfStringId GetType () const
void SetType (WsfStringId aType)
WsfStringId GetSubType () const
void SetSubType (WsfStringId aSubType)
int GetPriority () const
void SetPriority (int aPriority)
const wsf::comm::AddressGetSrcAddr () const
void SetSrcAddr (const wsf::comm::Address &aSrcAddr)
const wsf::comm::AddressGetDstAddr () const
void SetDstAddr (const wsf::comm::Address &aDstAddr)
const wsf::comm::AddressGetNextHopAddr () const
void SetNextHopAddr (const wsf::comm::Address &aNextHopAddr)
virtual bool CanBeReplacedBy (const WsfMessage &aMessage) const
WsfStringId GetGroup () const
void SetGroup (WsfStringId aGroup) const
void PrintDataTagPrecise (std::ostream &aStream, std::streamsize aPrecision) const
template<typename T>
void Serialize (T &aBuff)
 (De)serializer for XIO
virtual WsfStringId GetComponentNameId () const
virtual WsfStringId GetComponentTypeId () const
virtual WsfStringId GetComponentModeId () const
Public Member Functions inherited from WsfAuxDataEnabled
 WsfAuxDataEnabled ()=default
 WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default
WsfAuxDataEnabledoperator= (const WsfAuxDataEnabled &aRhs)
 WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default
WsfAuxDataEnabledoperator= (WsfAuxDataEnabled &&)=default
virtual ~WsfAuxDataEnabled () noexcept
void SetAuxData (const WsfAttributeContainer &aAuxData)
void DeleteAuxData ()
 Delete the aux data container from the object.
void MergeAuxData (const WsfAuxDataEnabled &aSrc)
 Merge the object's aux data with aux data from an existing object.
void UpdateAuxData (const WsfAuxDataEnabled &aSrc)
 Update the object's aux data with aux data from an existing object.
bool HasAuxData () const
 Returns true if this object has aux data.
bool ProcessInput (UtInput &aInput)
template<typename T>
void Serialize (T &aBuff)
 (De)serialization for XIO
WsfAttributeContainerGetAuxData ()
const WsfAttributeContainerGetAuxData () const noexcept
const WsfAttributeContainerGetAuxDataConst () const noexcept

Static Public Member Functions

static std::unique_ptr< UtScriptClass > CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr)
static WsfStringId GetTypeId ()
Static Public Member Functions inherited from WsfMessage
static WsfStringId GetTypeId ()

Platform methods.

A status may sometimes deal with another platform (such as a spawned object).

Note
This is not the platform that is issuing the message. The base class 'Originator' methods define who is sending the message.
WsfTrackId mRequestId
 The request ID to which the status pertains.
WsfStringId mSystemNameId
 The system name ID to which the status pertains.
size_t mPlatformIndex
 The other platform index.
WsfPlatformGetPlatform () const
size_t GetPlatformIndex () const
void SetPlatform (WsfPlatform *aPlatformPtr)
void SetPlatformIndex (size_t aPlatformIndex)
template<typename T>
void Serialize (T &aBuff)
 For XIO (de)serialization.

Status methods.

The message status is a string ID that represents the status being reported. The status values and their interpretation are defined by convention.

WsfStringId GetStatusId () const
 Get the status (string ID form).
const std::string & GetStatus () const
 Get the Status (string form).
void SetStatusId (WsfStringId aStatusId)
 Set the status (string ID form).
void SetStatus (WsfStringId aStatus)

Request ID methods.

A status may be associated with a particular request (e.g.: a command). These methods are concerned with the identifier of the request.

const WsfTrackIdGetRequestId () const
 Get the request ID to which the status applies.
void SetRequestId (const WsfTrackId &aRequestId)
 Set the request ID to which the status applies.

System name methods.

A status may be associated with a particular system (e.g.: sensor, comm, mover, etc.) These methods are concerned the name of the system to which the status applies.

WsfStringId GetSystemNameId () const
std::string GetSystemName () const
void SetSystemNameId (WsfStringId aSystemNameId)
void SetSystemName (const std::string &aSystemName)

Additional Inherited Members

Static Public Attributes inherited from WsfMessage
static constexpr size_t cBITS_IN_BYTE = 8U
Static Public Attributes inherited from WsfAuxDataEnabled
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataAccessed
static UtCallbackListN< void(const WsfAuxDataEnabled *)> AuxDataDestroyed
 WsfMessage (const WsfMessage &aSrc)=default

Detailed Description

A 'status message' provides status about an operation.

Constructor & Destructor Documentation

◆ WsfStatusMessage() [1/4]

WsfStatusMessage::WsfStatusMessage ( )

Constructor, for XIO (de)serialization (create a Status message).

References GetTypeId(), mPlatformIndex, mRequestId, mSystemNameId, and WsfMessage::WsfMessage().

Referenced by Clone(), and WsfStatusMessage().

◆ WsfStatusMessage() [2/4]

WsfStatusMessage::WsfStatusMessage ( WsfSimulation & aSimulation)

◆ WsfStatusMessage() [3/4]

WsfStatusMessage::WsfStatusMessage ( WsfPlatform * aPlatformPtr)

Constructor (create a Status message)

Parameters
aPlatformPtrThe originator of the message.

References GetTypeId(), mPlatformIndex, mRequestId, mSystemNameId, and WsfMessage::WsfMessage().

◆ WsfStatusMessage() [4/4]

WsfStatusMessage::WsfStatusMessage ( WsfStringId aStatusId,
WsfPlatform * aPlatformPtr )

Constructor (create a Status message)

Parameters
aStatusIdThe status as a string ID.
aPlatformPtrThe originator of the message.

References GetTypeId(), mPlatformIndex, mRequestId, mSystemNameId, and WsfMessage::WsfMessage().

Member Function Documentation

◆ Clone()

WsfMessage * WsfStatusMessage::Clone ( ) const
overridevirtual

Create a clone of this message (the 'virtual copy constructor').

Returns
The pointer to the copy of this message.

Reimplemented from WsfMessage.

References WsfMessage::WsfMessage(), and WsfStatusMessage().

◆ CreateScriptClass()

std::unique_ptr< UtScriptClass > WsfStatusMessage::CreateScriptClass ( const std::string & aClassName,
UtScriptTypes * aScriptTypesPtr )
static

Create the 'class' object for the script system. This is invoked once by WsfScriptManager to create the 'class' object that defines the interface to instances of this class from the script system.

Referenced by WsfScriptManager::RegisterTypes(), and WsfStatusMessage().

◆ GetPlatform()

WsfPlatform * WsfStatusMessage::GetPlatform ( ) const

Get the pointer to the other platform.

Returns
The pointer to the platform or 0 if the status does not have an associated platform or if the associated platform has been deleted.

References WsfSimulation::GetPlatformByIndex(), WsfMessage::GetSimulation(), and mPlatformIndex.

◆ GetPlatformIndex()

size_t WsfStatusMessage::GetPlatformIndex ( ) const
inline

◆ GetRequestId()

const WsfTrackId & WsfStatusMessage::GetRequestId ( ) const
inline

Get the request ID to which the status applies.

References mRequestId.

Referenced by WsfTrackStateController::ProcessMessage().

◆ GetScriptClassName()

const char * WsfStatusMessage::GetScriptClassName ( ) const
override

◆ GetStatus()

const std::string & WsfStatusMessage::GetStatus ( ) const

Get the Status (string form).

References WsfMessage::GetSubType().

Referenced by WsfTrackStateController::ProcessMessage().

◆ GetStatusId()

WsfStringId WsfStatusMessage::GetStatusId ( ) const
inline

Get the status (string ID form).

References WsfMessage::GetSubType().

Referenced by WsfPlatformPart::ProcessMessage(), and WsfTrackStateController::ProcessMessage().

◆ GetSystemName()

std::string WsfStatusMessage::GetSystemName ( ) const

Get the system name (string form).

Returns
The system name, or an empty string if the status is not associated with a particular system.

References mSystemNameId.

◆ GetSystemNameId()

WsfStringId WsfStatusMessage::GetSystemNameId ( ) const
inline

Get the system name (string ID form).

Returns
The string ID of the system name, or zero if the status is not associated with a particular system.

References mSystemNameId.

Referenced by WsfMessageProcessor::Selector::Matches(), and WsfPlatformPart::ProcessMessage().

◆ GetTypeId()

◆ Serialize()

template<typename T>
void WsfStatusMessage::Serialize ( T & aBuff)
inline

For XIO (de)serialization.

References mPlatformIndex, mRequestId, mSystemNameId, and WsfMessage::Serialize().

◆ SetPlatform()

void WsfStatusMessage::SetPlatform ( WsfPlatform * aPlatformPtr)

Set the pointer to the other platform.

Parameters
aPlatformPtrThe pointer to the

References WsfPlatform::GetIndex(), and mPlatformIndex.

Referenced by WsfExplicitWeapon::AddWeaponToSimulation().

◆ SetPlatformIndex()

void WsfStatusMessage::SetPlatformIndex ( size_t aPlatformIndex)
inline

◆ SetRequestId()

void WsfStatusMessage::SetRequestId ( const WsfTrackId & aRequestId)
inline

Set the request ID to which the status applies.

References mRequestId.

Referenced by WsfExplicitWeapon::AddWeaponToSimulation().

◆ SetStatus()

void WsfStatusMessage::SetStatus ( WsfStringId aStatus)

Set the Status (string form).

Parameters
aStatusThe status.

References WsfMessage::SetSubType().

◆ SetStatusId()

void WsfStatusMessage::SetStatusId ( WsfStringId aStatusId)
inline

Set the status (string ID form).

References WsfMessage::SetSubType().

◆ SetSystemName()

void WsfStatusMessage::SetSystemName ( const std::string & aSystemName)

Set the system name (string form).

Parameters
aSystemNameThe system name to which the status applied. If empty then the status does not apply to a particular system.

References mSystemNameId.

◆ SetSystemNameId()

void WsfStatusMessage::SetSystemNameId ( WsfStringId aSystemNameId)
inline

Set the system name (string ID form).

Parameters
aSystemNameIdThe string ID of the system name to which the status applied. If zero then the status does not apply to a particular system.

References mSystemNameId.

Referenced by WsfExplicitWeapon::AddWeaponToSimulation(), WsfPlatformPart::PartBroken(), WsfPlatformPart::SetNonOperational(), WsfPlatformPart::SetOperational(), WsfPlatformPart::TurnOff(), and WsfPlatformPart::TurnOn().

Member Data Documentation

◆ mPlatformIndex

size_t WsfStatusMessage::mPlatformIndex
protected

◆ mRequestId

WsfTrackId WsfStatusMessage::mRequestId
protected

The request ID to which the status pertains.

Referenced by GetRequestId(), Serialize(), SetRequestId(), WsfStatusMessage(), WsfStatusMessage(), and WsfStatusMessage().

◆ mSystemNameId

WsfStringId WsfStatusMessage::mSystemNameId
protected

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