WSF
WsfMessage Class Reference

A base class for messages sent among simulation communication objects, processors and sensors. More...

#include <WsfMessage.hpp>

Inheritance diagram for WsfMessage:
Collaboration diagram for WsfMessage:

Public Member Functions

 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
virtual WsfMessageClone () const
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
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 WsfStringId GetTypeId ()

Static Public Attributes

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

Optional Group Specification Accessor/Mutator

Provides the ability to set the group identification for a message. Used by the communications framework for identifying where a message is supposed to go without using addressing for legacy support. This is only for internal usage, and must be placed on the WsfMessage object as legacy usage of comms still utilizes the WsfMessage object instead of WsfCommMessage.

Note
Because many of the use cases for this message is a const WsfMessage, a const mutator is being provided until more widespread modification are acceptable.
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
WSF_EXPORT std::ostream & operator<< (std::ostream &aOut, const WsfMessage &aMessage)
 WsfMessage (const WsfMessage &aSrc)=default

Component Info Interface

These optional methods define an interface that can be used by subclasses to provide additional information on the component that either generated the message or the data contained in the message. They can be used to filter messages based on the information returned. The methods in the base class will return a null (0) WsfStringId.

virtual WsfStringId GetComponentNameId () const
virtual WsfStringId GetComponentTypeId () const
virtual WsfStringId GetComponentModeId () const

Detailed Description

A base class for messages sent among simulation communication objects, processors and sensors.

Constructor & Destructor Documentation

◆ WsfMessage() [1/7]

WsfMessage::WsfMessage ( WsfStringId aType)

Constructor for XIO (de)serialization.

Referenced by WsfAssetMessage::CanBeReplacedBy(), CanBeReplacedBy(), WsfSA_EntityMessage::CanBeReplacedBy(), WsfTrackMessage::CanBeReplacedBy(), wsf::UCI_MessageType< Type, Factory, Reader, Writer, Listener, TypeName >::Clone(), WsfAssetMessage::Clone(), WsfAssociationMessage::Clone(), WsfControlMessage::Clone(), WsfImageMessage::Clone(), WsfL16::JMessage::Clone(), Clone(), WsfSA_EntityMessage::Clone(), WsfStatusMessage::Clone(), WsfTaskAssignMessage::Clone(), WsfTaskCancelMessage::Clone(), WsfTaskControlMessage::Clone(), WsfTaskStatusMessage::Clone(), WsfTrackDropMessage::Clone(), WsfTrackMessage::Clone(), WsfTrackNotifyMessage::Clone(), WsfVideoMessage::Clone(), WsfL16::JMessage::JMessage(), WsfL16::JMessage::JMessage(), operator<<, WsfL16::JMessage::operator=(), operator=(), WsfTaskAssignMessage::operator=(), wsf::UCI_MessageBaseType::UCI_MessageBaseType(), WsfAssetMessage::WsfAssetMessage(), WsfAssetMessage::WsfAssetMessage(), WsfAssetMessage::WsfAssetMessage(), WsfAssociationMessage::WsfAssociationMessage(), WsfAssociationMessage::WsfAssociationMessage(), WsfAssociationMessage::WsfAssociationMessage(), WsfBMAssignmentMessage::WsfBMAssignmentMessage(), WsfBMAssignmentMessage::WsfBMAssignmentMessage(), WsfBMAssignmentMessage::WsfBMAssignmentMessage(), WsfBMAssignmentMessage::WsfBMAssignmentMessage(), WsfBMAssignmentStatusMessage::WsfBMAssignmentStatusMessage(), WsfBMAssignmentStatusMessage::WsfBMAssignmentStatusMessage(), WsfBMAssignmentStatusMessage::WsfBMAssignmentStatusMessage(), WsfBMAssignmentStatusMessage::WsfBMAssignmentStatusMessage(), WsfBMAssignmentTrackMessage::WsfBMAssignmentTrackMessage(), WsfBMAssignmentTrackMessage::WsfBMAssignmentTrackMessage(), WsfBMAssignmentTrackMessage::WsfBMAssignmentTrackMessage(), WsfBMAssignmentTrackMessage::WsfBMAssignmentTrackMessage(), WsfBMCueMessage::WsfBMCueMessage(), WsfBMCueMessage::WsfBMCueMessage(), WsfBMCueMessage::WsfBMCueMessage(), WsfBMCueMessage::WsfBMCueMessage(), WsfBMStatusMessage::WsfBMStatusMessage(), WsfBMStatusMessage::WsfBMStatusMessage(), WsfBMStatusMessage::WsfBMStatusMessage(), WsfBMStatusMessage::WsfBMStatusMessage(), WsfBMTrackMessage::WsfBMTrackMessage(), WsfBMTrackMessage::WsfBMTrackMessage(), WsfBMTrackMessage::WsfBMTrackMessage(), WsfBMTrackMessage::WsfBMTrackMessage(), WsfControlMessage::WsfControlMessage(), WsfControlMessage::WsfControlMessage(), WsfControlMessage::WsfControlMessage(), WsfImageMessage::WsfImageMessage(), WsfImageMessage::WsfImageMessage(), WsfMessage(), WsfMessage(), WsfMessage(), WsfSA_EntityMessage::WsfSA_EntityMessage(), WsfSA_EntityMessage::WsfSA_EntityMessage(), WsfSA_EntityMessage::WsfSA_EntityMessage(), WsfSA_EntityMessage::WsfSA_EntityMessage(), WsfStatusMessage::WsfStatusMessage(), WsfStatusMessage::WsfStatusMessage(), WsfStatusMessage::WsfStatusMessage(), WsfStatusMessage::WsfStatusMessage(), WsfTaskAssignMessage::WsfTaskAssignMessage(), WsfTaskAssignMessage::WsfTaskAssignMessage(), WsfTaskAssignMessage::WsfTaskAssignMessage(), WsfTaskCancelMessage::WsfTaskCancelMessage(), WsfTaskCancelMessage::WsfTaskCancelMessage(), WsfTaskCancelMessage::WsfTaskCancelMessage(), WsfTaskControlMessage::WsfTaskControlMessage(), WsfTaskControlMessage::WsfTaskControlMessage(), WsfTaskStatusMessage::WsfTaskStatusMessage(), WsfTaskStatusMessage::WsfTaskStatusMessage(), WsfTaskStatusMessage::WsfTaskStatusMessage(), WsfTrackDropMessage::WsfTrackDropMessage(), WsfTrackDropMessage::WsfTrackDropMessage(), WsfTrackMessage::WsfTrackMessage(), WsfTrackMessage::WsfTrackMessage(), WsfTrackMessage::WsfTrackMessage(), WsfTrackMessage::WsfTrackMessage(), WsfTrackNotifyMessage::WsfTrackNotifyMessage(), WsfVideoMessage::WsfVideoMessage(), and WsfVideoMessage::~WsfVideoMessage().

◆ WsfMessage() [2/7]

WsfMessage::WsfMessage ( WsfStringId aType,
const wsf::comm::Address & aSrcAddr,
WsfSimulation & aSimulation )

Constructor

Parameters
aTypeThe message type as a string ID.
aSrcAddrThe address of the interface that originated the message.
aSimulationThe simulation

References WsfSimulation::GetCommNetworkManager(), WsfSimulation::GetPlatformByName(), and platformPtr.

◆ WsfMessage() [3/7]

WsfMessage::WsfMessage ( WsfPlatform * aPlatformPtr)

Constructor.

Parameters
aPlatformPtrThe originator of the message.

References WsfMessage().

◆ WsfMessage() [4/7]

WsfMessage::WsfMessage ( WsfStringId aType,
WsfPlatform * aPlatformPtr )

Constructor.

Parameters
aTypeThe message type as a string ID.
aPlatformPtrThe originator of the message.

References WsfMessage().

◆ WsfMessage() [5/7]

WsfMessage::WsfMessage ( WsfStringId aType,
WsfStringId aSubType,
WsfPlatform * aPlatformPtr )

Constructor.

Parameters
aTypeThe message type as a string ID.
aSubTypeThe message sub-type as a string ID.
aPlatformPtrThe originator of the message.

References GetSimulation().

◆ WsfMessage() [6/7]

WsfMessage::WsfMessage ( WsfSimulation & aSimulation)

Constructor. //!

Parameters
aSimulationThe simulation

◆ ~WsfMessage()

WsfMessage::~WsfMessage ( )
override

◆ WsfMessage() [7/7]

WsfMessage::WsfMessage ( const WsfMessage & aSrc)
protecteddefault

References WsfMessage().

Member Function Documentation

◆ CanBeReplacedBy()

bool WsfMessage::CanBeReplacedBy ( const WsfMessage & aMessage) const
virtual

Can this message be replaced by the new message.

This routine can be used by communications devices to determine if a message that is to be sent should replace a message is in the queue for transmission. For example, a new track update message should replace any queued track update message for the same track ID.

Parameters
aMessageThe new message.
Returns
'true' if the supplied message is a replacement for this message.
Note
The default implementation returns 'false' (the message cannot replace the current message).

Reimplemented in WsfAssetMessage, WsfSA_EntityMessage, and WsfTrackMessage.

References WsfMessage().

◆ Clone()

◆ GetComponentModeId()

virtual WsfStringId WsfMessage::GetComponentModeId ( ) const
inlinevirtual
Returns
The string ID of the related component's mode

Reimplemented in WsfImageMessage, WsfTrackMessage, and WsfVideoMessage.

Referenced by WsfMessageProcessor::Selector::Matches().

◆ GetComponentNameId()

virtual WsfStringId WsfMessage::GetComponentNameId ( ) const
inlinevirtual
Returns
The string ID of the related component's name

Reimplemented in WsfImageMessage, WsfTrackMessage, and WsfVideoMessage.

Referenced by WsfMessageProcessor::Selector::Matches().

◆ GetComponentTypeId()

virtual WsfStringId WsfMessage::GetComponentTypeId ( ) const
inlinevirtual
Returns
The string ID of the related component's type

Reimplemented in WsfImageMessage, WsfTrackMessage, and WsfVideoMessage.

Referenced by WsfMessageProcessor::Selector::Matches().

◆ GetDataTag()

double WsfMessage::GetDataTag ( ) const
inline

Get the data tag of the underlying data. This is an optional value that may be used to identify the contents of the message. When an object (e.g.: a track or an image) is sent in a message, the data tag from the object is copied to the message. This allows the data to be tracked through the network, even though it may happen through several messages, with interruptions.

Returns
The data tag attached to the message. This will be zero if it none has been assigned.

Referenced by PrintDataTagPrecise().

◆ GetDstAddr()

const wsf::comm::Address & WsfMessage::GetDstAddr ( ) const
inline

Get the address of the final destination interface for which this message in destined.

Returns
The address of the destination interface.

Referenced by WsfXIO_AutoDisMapping::ForwardMessage(), WsfTaskManager::GetMessageSender(), operator<<, and WsfRIPRProcessor::ReceiveMessage().

◆ GetGroup()

WsfStringId WsfMessage::GetGroup ( ) const
inline

◆ GetNextHopAddr()

const wsf::comm::Address & WsfMessage::GetNextHopAddr ( ) const
inline

Get the address of the next-hop interface for which this message in destined.

Returns
The address of the next-hop interface.

Referenced by WsfXIO_AutoDisMapping::ForwardMessage().

◆ GetOriginator()

WsfStringId WsfMessage::GetOriginator ( ) const
inline

Get the platform name identifier of the message originator.

Returns
The Platform Name ID of the message originator.

Referenced by WsfTaskManager::GetMessageSender(), WsfDirectionFinderProcessor::ProcessMessage(), and WsfTrackProcessor::ProcessMessage().

◆ GetOriginatorIndex()

size_t WsfMessage::GetOriginatorIndex ( ) const
inline

Get the platform index of the message originator.

Returns
The platform index of the message originator.

◆ GetPriority()

int WsfMessage::GetPriority ( ) const
inline

Get the priority of the message.

Returns
Returns the message's priority as an integer (0 being the lowest priority).

Referenced by WsfMessageTable::SetMessageProp().

◆ GetScriptClassName()

const char * WsfMessage::GetScriptClassName ( ) const
override

Referenced by operator=().

◆ GetSerialNumber()

◆ GetSimulation()

◆ GetSizeBits()

int WsfMessage::GetSizeBits ( ) const
inline

Get the length of the message in bits .

Returns
The length of the message in bits.

Referenced by operator<<, and WsfMessageTable::SetMessageProp().

◆ GetSizeBytes()

int WsfMessage::GetSizeBytes ( ) const
inline

Get the length of the message in bytes .

Returns
The length of the message in bytes.

References cBITS_IN_BYTE.

◆ GetSrcAddr()

const wsf::comm::Address & WsfMessage::GetSrcAddr ( ) const
inline

Get the address of the source interface that sent this message.

Returns
The address of the source interface.

Referenced by WsfXIO_AutoDisMapping::ForwardMessage(), and WsfMessageProcessor::Selector::Matches().

◆ GetStaticType()

WsfStringId WsfMessage::GetStaticType ( ) const
inline

Get the 'static type' of the message. Initially the static type is the same as the message type, but the static type may not be changed.

Returns
The static message type as a string ID.

◆ GetSubType()

◆ GetType()

WsfStringId WsfMessage::GetType ( ) const
inline

Get the 'type' of the message.

Returns
The message type as a string ID.

Referenced by WsfAssetMessage::CanBeReplacedBy(), WsfSA_EntityMessage::CanBeReplacedBy(), WsfTrackMessage::CanBeReplacedBy(), WsfTaskManager::CheckMessageAcknowledged(), WsfTaskManager::DropFromPurgedTaskList(), WsfXIO_AutoDisMapping::HandleDisMessage(), WsfXIO_MessageService::HandleMessage(), WsfMessageProcessor::Selector::Matches(), WsfDefaultAssetManagerImpl::on_message(), wsf::event::utils::PrintMessageData(), wsf::event::utilsCSV::PrintMessageData(), wsf::UCI_Computer::ProcessMessage(), wsf::UCI_IRST_Component::ProcessMessage(), wsf::UCI_PartComponent::ProcessMessage(), WsfCompositeSensor::ProcessMessage(), WsfCuedLaserWeapon::ProcessMessage(), WsfDirectionFinderProcessor::ProcessMessage(), WsfImageProcessor::ProcessMessage(), WsfMessageProcessor::ProcessMessage(), WsfPerceptionProcessor::ProcessMessage(), WsfPlatformPart::ProcessMessage(), WsfRF_Jammer::ProcessMessage(), WsfRIPRProcessor::ProcessMessage(), WsfSA_Perceive::ProcessMessage(), WsfScriptMessageHandler::ProcessMessage(), WsfTaskManager::ProcessMessage(), WsfTrackProcessor::ProcessMessage(), WsfTrackStateController::ProcessMessage(), WsfUplinkProcessor::ProcessMessage(), WsfWeaponTrackProcessor::ProcessMessage(), wsf::UCI_AMTI_Component::ReceiveMessage(), wsf::UCI_ESM_Component::ReceiveMessage(), wsf::UCI_WeaponComponent::ReceiveMessage(), WsfFusionCenter::ReceiveMessage(), WsfImageProcessor::ReceiveMessage(), WsfMessageProcessor::ReceiveMessage(), WsfRIPRProcessor::ReceiveMessage(), WsfTaskManager::ReceiveMessage(), WsfInternalLinks::SendMessage(), WsfInternalLinks::SendMessage(), and WsfMessageTable::SetMessageProp().

◆ GetTypeId()

WsfStringId WsfMessage::GetTypeId ( )
static

Get the message type ID for messages of this class.

Returns
The integer message type ID for messages of this type.

Referenced by WsfScriptMessageClass::Create(), and operator=().

◆ operator=()

WsfMessage & WsfMessage::operator= ( const WsfMessage & aRhs)
default

◆ PrintDataTagPrecise()

void WsfMessage::PrintDataTagPrecise ( std::ostream & aStream,
std::streamsize aPrecision ) const

Print function to output a data tag at the provided decimal precision

Parameters
aStreamThe output stream to which to print the data tag
aPrecisionThe desired print precision

References GetDataTag().

◆ Serialize()

◆ SetDataTag()

void WsfMessage::SetDataTag ( double aDataTag)
inline

Set the 'data tag' to be associated with the data in the message.

Parameters
aDataTagThe data tag to be attached to the message.

Referenced by WsfTrackMessage::SetTrack(), WsfImageMessage::WsfImageMessage(), and WsfVideoMessage::WsfVideoMessage().

◆ SetDstAddr()

void WsfMessage::SetDstAddr ( const wsf::comm::Address & aDstAddr)
inline

Set the address of the final destination interface for which this message is destined.

Parameters
aDstAddrThe address of the destination interface.

Referenced by WsfXIO_AutoDisMapping::ForwardMessage().

◆ SetGroup()

void WsfMessage::SetGroup ( WsfStringId aGroup) const
inline

◆ SetNextHopAddr()

void WsfMessage::SetNextHopAddr ( const wsf::comm::Address & aNextHopAddr)

Set the address of the next-hop interface for which this message is destined.

Parameters
aNextHopAddrThe address of the next-hop interface.

Referenced by WsfXIO_AutoDisMapping::ForwardMessage().

◆ SetOriginator()

void WsfMessage::SetOriginator ( WsfPlatform * aPlatformPtr)

Set the originator of this message.

References WsfPlatform::GetIndex(), and WsfObject::GetNameId().

Referenced by WsfXIO_AutoDisMapping::HandleDisMessage().

◆ SetPriority()

void WsfMessage::SetPriority ( int aPriority)
inline

Sets the priority of the message.

Parameters
aPriorityThe message's priority (0 being the lowest priority).

Referenced by WsfSensorProcessor::SendTrackUpdateMessage(), WsfSensor::SetMessageParameters(), and WsfMessageTable::SetMessageProp().

◆ SetSerialNumber()

void WsfMessage::SetSerialNumber ( unsigned int aSerialNumber)
inline

Set the serial number of this message. The simulation object should be used to get the next available serial number to ensure uniqueness.

Parameters
aSerialNumberThe serial number for this message.

Referenced by WsfScriptAssetMessageClass::Create(), WsfScriptMessageClass::Create(), and WsfScriptSA_EntityMessage::Create().

◆ SetSimulation()

void WsfMessage::SetSimulation ( WsfSimulation * aSimulationPtr)
inline

Set the simulation that owns the message.

Note
This should be used ONLY where a message is being created and will be populated later. This prevents the need to have a lot of specialized constructors.

Referenced by WsfScriptAssetMessageClass::Create(), WsfScriptMessageClass::Create(), WsfScriptSA_EntityMessage::Create(), WsfXIO_AutoDisMapping::HandleDisMessage(), and WsfBMTrackMessage::WsfBMTrackMessage().

◆ SetSizeBits()

void WsfMessage::SetSizeBits ( int aSizeBits)
inline

◆ SetSizeBytes()

void WsfMessage::SetSizeBytes ( int aSizeBytes)
inline

Set the message size in bytes.

Parameters
aSizeBytesThe message size in bytes.

References cBITS_IN_BYTE.

◆ SetSrcAddr()

void WsfMessage::SetSrcAddr ( const wsf::comm::Address & aSrcAddr)

Set the address of the source interface that sent this message.

Parameters
aSrcAddrThe address of the source interface.

References platformPtr.

Referenced by WsfXIO_AutoDisMapping::ForwardMessage().

◆ SetSubType()

void WsfMessage::SetSubType ( WsfStringId aSubType)
inline

Set the 'sub-type' of the message.

Parameters
aSubTypeThe message sub-type as a string ID.

Referenced by WsfControlMessage::SetFunction(), WsfStatusMessage::SetStatus(), and WsfStatusMessage::SetStatusId().

◆ SetType()

void WsfMessage::SetType ( WsfStringId aType)
inline

Set the 'type' of the message.

Parameters
aTypeThe message type as a string ID.

◆ operator<<

WSF_EXPORT std::ostream & operator<< ( std::ostream & aOut,
const WsfMessage & aMessage )
friend

Member Data Documentation

◆ cBITS_IN_BYTE

size_t WsfMessage::cBITS_IN_BYTE = 8U
staticconstexpr

Referenced by GetSizeBytes(), and SetSizeBytes().


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