WSF
wsf::comm::util Namespace Reference

Enumerations

enum  Recipient { cCOMMANDER = 1 , cPEERS = 2 , cSUBORDINATES = 4 }

Selection methods

CommSelectDevice (WsfPlatform *aSourcePtr, WsfPlatform *aTargetPtr)
void SelectRecipients (WsfCommandChain *aCmdChainPtr, int aRecipientMask, std::vector< WsfPlatform * > &aRecipients)
void SelectRecipients (WsfPlatform *aSenderPtr, WsfGroup *aGroupPtr, std::vector< WsfPlatform * > &aRecipients)
std::string LocalSlaveNetworkName (Comm &aComm)
std::string LocalMasterNetworkName (Comm &aComm)

Enumeration Type Documentation

◆ Recipient

These calls are temporary functionality to enable legacy comm behavior in various objects/plugins/etc. that have yet to be updated to fully utilize the new comm framework as intended. It is fully intended that the 'SelectDevice' and 'SelectRecipients' methods will be removed upon full adoption of the new comm enhancements, as these calls are typically needed due to tight coupling with the platform-targeted legacy comm model and command chains, which is undesirable.

Enumerator
cCOMMANDER 
cPEERS 
cSUBORDINATES 

Function Documentation

◆ LocalMasterNetworkName()

WSF_EXPORT std::string wsf::comm::util::LocalMasterNetworkName ( Comm & aComm)

The LocalMasterNetworkName returns the name of the correct network to join to (or already is a part of) when the provided comm device uses the legacy <local:master> value. This method exists to support the legacy use of creating networks based off of command chains.

Parameters
aCommThe WsfComm object that received the command.
Returns
THe proper network name, given the <local:master> value.

References WsfObject::GetName(), and WsfPlatformPart::GetPlatform().

Referenced by wsf::comm::NetworkManager::ManageComm().

◆ LocalSlaveNetworkName()

WSF_EXPORT std::string wsf::comm::util::LocalSlaveNetworkName ( Comm & aComm)

The LocalSlaveNetworkName returns the name of the correct network to join to (or already is a part of) when the provided comm device uses the legacy <local:slave> value. This method exists to support the legacy use of creating networks based off of command chains.

Parameters
aCommThe WsfComm object that received the command.
Returns
THe proper network name, given the <local:slave> value.

The following are methods are used to support legacy comms, or to help maintain the original behavior of the comms library.

These methods support legacy usage of the master/slave network name idiom. While this is not standard comm functionality, this provides legacy support and a generic way of specifying network inclusion (and by extension, comm addressing) that does not intrude on basic comm functionality. It simply provides a common way to specify string identifiers for networks based on the platform owning the comm and its relationship within a command chain.

References WsfComponentList::GetComponent(), WsfCommandChain::GetDefaultNameId(), and WsfPlatformPart::GetPlatform().

Referenced by wsf::comm::NetworkManager::ManageComm().

◆ SelectDevice()

WSF_EXPORT Comm * wsf::comm::util::SelectDevice ( WsfPlatform * aSourcePtr,
WsfPlatform * aTargetPtr )

Find a comm device on the sending platform over which a message can be sent and then received by the target platform. The algorithm will only choose a device which is valid only at the time of the request.

Parameters
aSourcePtrThe platform wishing to send the message.
aTargetPtrThe platform to whom the message is intended.
Returns
A pointer to the comm device on the source platform over which the message should be sent. The return value will be zero if an applicable device can not be determined.

References WsfComponentList::RoleIterator< T >::AtEnd().

Referenced by WsfBMDisseminateC2::SelectCommDevice(), and WsfTaskManager::SelectCommDevice().

◆ SelectRecipients() [1/2]

WSF_EXPORT void wsf::comm::util::SelectRecipients ( WsfCommandChain * aCmdChainPtr,
int aRecipientMask,
std::vector< WsfPlatform * > & aRecipients )

A helper method to select the recipient platforms from a command chain.

Parameters
aCmdChainPtrThe command chain from which the recipients are to be selected.
aRecipientMaskA bit mask of 'Recipient' values indicating which recipients are to be selected.
aRecipientsAn updated list of platforms containing the selected recipients. The selected platforms are appended to the list!

References cCOMMANDER, cPEERS, cSUBORDINATES, WsfCommandChain::GetCommander(), WsfCommandChain::GetPeers(), WsfCommandChain::GetPlatform(), WsfCommandChain::GetSubordinates(), and platformPtr.

Referenced by WsfL16::ComputerPart::SendJMessage(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().

◆ SelectRecipients() [2/2]

WSF_EXPORT void wsf::comm::util::SelectRecipients ( WsfPlatform * aSenderPtr,
WsfGroup * aGroupPtr,
std::vector< WsfPlatform * > & aRecipients )

A helper method to select the recipient addresses from a group.

Parameters
aSenderPtrThe platform sending the message.
aGroupPtrThe group from which the recipients are to be selected.
aRecipientsAn updated list of platforms containing the selected recipients. The selected platforms are appended to the list!

References WsfGroup::GetMembers(), WsfSimulation::GetPlatformByIndex(), and WsfPlatform::GetSimulation().

Copyrights Multiple, All Rights Reserved