|
WSF
|
#include <WsfExternalLinks.hpp>

Classes | |
| struct | CommandChainTarget |
| class | ExternalLink |
Public Types | |
| enum class | CommandChainRecipient : unsigned int { cCOMMANDER , cSUBORDINATES , cPEERS , cNONE } |
| using | Address = comm::Address |
| using | LinkVec = std::vector<ExternalLink> |
| using | LinkIt = LinkVec::iterator |
| using | LinkConstIt = LinkVec::const_iterator |
| using | CommPair = std::pair<WsfStringId, WsfStringId> |
| using | AddressVec = std::vector<Address> |
Public Member Functions | |
| ExternalLinks ()=default | |
| virtual | ~ExternalLinks ()=default |
| bool | HasLinks () const |
| bool | Initialize (double aSimTime, WsfPlatform *aPlatformPtr) |
| bool | ProcessInput (UtInput &aInput) |
| bool | CommandChainCommand (const std::string &aCommand, CommandChainRecipient &aReportType) |
| void | SendMessage (double aSimTime, const WsfMessage &aMessage) |
| void | SendMessage (double aSimTime, const WsfMessage &aMessage, WsfStringId aExcludedPlatformName) |
| WsfSimulation * | GetSimulation () const |
| WsfPlatform * | GetPlatform () const |
Recipient management methods. | |
| LinkVec | mLinks {} |
| WsfPlatform * | mPlatformPtr {nullptr} |
| bool | mDebug {false} |
| bool | AddRecipient (WsfStringId aXmtrName, const Address &aRcvrAddress) |
| bool | AddRecipient (WsfStringId aXmtrName, WsfStringId aCommGroupName) |
| bool | AddRecipient (WsfStringId aXmtrName, const CommandChainTarget &aCommandChainTarget) |
| bool | AddRecipient (WsfStringId aXmtrName, const CommPair &aCommPair) |
| bool | RemoveRecipient (WsfStringId aXmtrName, const Address &aRcvrAddress) |
| bool | RemoveRecipient (WsfStringId aXmtrName, WsfStringId aCommGroupName) |
| bool | RemoveRecipient (WsfStringId aXmtrName, const CommandChainTarget &aCommandChainTarget) |
| bool | RemoveRecipient (WsfStringId aXmtrName, const CommPair &aCommPair) |
| void | DeleteAllRecipients () |
| size_t | GetRecipientCount () const |
| size_t | GetRecipientCount (WsfStringId aXmtrName) const |
| size_t | GetLinkCount () const |
| ExternalLink & | GetLink (size_t aIndex) |
| LinkIt | FindLink (WsfStringId aXmtrName) |
| LinkConstIt | FindLink (WsfStringId aXmtrName) const |
The external link object is a standardized API for designating how an object (typically a platform component) communicates. Any communication between objects in AFSIM that are not local to the same platform are considered external, and require the usage of this object (along with appropriate communication modeling) to enable the transmission and reception of data using an external link. As such, external links do NOT define new linkage between comm objects in AFSIM, but SPECIFY the endpoints of communication to be used to transfer information. Note that what data is sent is based on the implementation of the sending object utilizing external linkage.
Note that this class does NOT handle transfer of data local to a platform, (beyond the initial transfer of data to the sending comm) as this is handled by the Internal Link object. Thus, if a user wishes any data received by a comm device to be forwarded to a specific platform component locally, the user should use this class in conjunction with internal links to forward the data to the correct local component.
External linkage requires a single transmitter, and one or more receivers (comm objects). Comm objects may be identified in multiple ways, such as a WsfComm object reference, a platform name / comm name pair, or comm address. Multiple receivers may be specified as well, by using the intrinsic comm functionality available via broadcasting, multicasting (if available), or via specification of multiple comm objects via a WsfGroup object. In the case of using a WsfGroup object of comm receivers, the method of comm transport of such messages is multiple unicast transmissions.
Note: This class has been modified to utilize the changes to the AFSIM comms framework. Previously, it was sufficient to use the command chain to specify the target of a transmission. This is too ambiguous now, and has modified. While one may still use such commands to specify a particular set of platforms to send to, a commonly named comm must also be specified (that is consistent) across all members of the command chain to continue using command chains in this way.
| using wsf::ExternalLinks::AddressVec = std::vector<Address> |
| using wsf::ExternalLinks::CommPair = std::pair<WsfStringId, WsfStringId> |
| using wsf::ExternalLinks::LinkConstIt = LinkVec::const_iterator |
| using wsf::ExternalLinks::LinkIt = LinkVec::iterator |
| using wsf::ExternalLinks::LinkVec = std::vector<ExternalLink> |
|
strong |
|
default |
Referenced by FindLink(), and wsf::ExternalLinks::ExternalLink::SetParent().
|
virtualdefault |
| bool wsf::ExternalLinks::AddRecipient | ( | WsfStringId | aXmtrName, |
| const Address & | aRcvrAddress ) |
References wsf::ExternalLinks::ExternalLink::AddAddressRecipient(), FindLink(), mLinks, and wsf::ExternalLinks::ExternalLink::SetXmtrName().
Referenced by ProcessInput().
| bool wsf::ExternalLinks::AddRecipient | ( | WsfStringId | aXmtrName, |
| const CommandChainTarget & | aCommandChainTarget ) |
| bool wsf::ExternalLinks::AddRecipient | ( | WsfStringId | aXmtrName, |
| const CommPair & | aCommPair ) |
| bool wsf::ExternalLinks::AddRecipient | ( | WsfStringId | aXmtrName, |
| WsfStringId | aCommGroupName ) |
| bool wsf::ExternalLinks::CommandChainCommand | ( | const std::string & | aCommand, |
| CommandChainRecipient & | aReportType ) |
References cCOMMANDER, cNONE, cPEERS, and cSUBORDINATES.
Referenced by ProcessInput().
| void wsf::ExternalLinks::DeleteAllRecipients | ( | ) |
References mLinks.
Referenced by ProcessInput().
|
protected |
References wsf::ExternalLinks::ExternalLink::GetXmtrName(), and mLinks.
Referenced by AddRecipient(), AddRecipient(), AddRecipient(), AddRecipient(), GetRecipientCount(), RemoveRecipient(), RemoveRecipient(), RemoveRecipient(), and RemoveRecipient().
|
protected |
References ExternalLinks().
|
inline |
References mLinks.
Referenced by getLinkedAndReachablePlatformParts().
|
inline |
References mLinks.
Referenced by getLinkedAndReachablePlatformParts().
|
inline |
References mPlatformPtr.
Referenced by SendMessage(), and SendMessage().
| size_t wsf::ExternalLinks::GetRecipientCount | ( | ) | const |
Note: Do not use these calls prior to simulation pending start. They require full initialization of the comm framework to resolve addressing.
References mLinks.
| size_t wsf::ExternalLinks::GetRecipientCount | ( | WsfStringId | aXmtrName | ) | const |
References FindLink(), and mLinks.
| WsfSimulation * wsf::ExternalLinks::GetSimulation | ( | ) | const |
References mPlatformPtr.
Referenced by SendMessage().
|
inline |
References mLinks.
Referenced by WsfBatchTrackReporting::ReportFusedTracks(), and WsfBatchTrackReporting::ReportRawTracks().
| bool wsf::ExternalLinks::Initialize | ( | double | aSimTime, |
| WsfPlatform * | aPlatformPtr ) |
Ensure that any and all links have valid transmitters.
We won't check for actual existence of any addresses, command chains, or groups. These objects may not be available during initialization, or may be dynamic in nature.
References mLinks, mPlatformPtr, and ok.
| bool wsf::ExternalLinks::ProcessInput | ( | UtInput & | aInput | ) |
Multiple versions of the report_to/external_link command may be used, depending on how the user wishes to ultimately designate which comm device the message gets sent to. The difference is that comms now require an explicit target receiver for all transmissions, and will not accept ambiguous targets (such as a platform, since it may have multiple comms). The input has changed slightly to reflect this, while attempting to minimize changes to the greatest extent possible. The updates are as follows: A. Command chains may still be used to designate the target platform. However, the transmitter is now required to be named (using the 'via' token, as was done previously). In addition, comms require a target receiver be named for a destination. This may be explicitly named by using the 'to' token, or it is assumed implicitly to be the same name as the transmitter. B. Groups of platforms are no longer sufficient as recipients. These are now replaced by groups of comms. C. Linkage now has the added capability to be specified by a platform-name comm-name pair, or via specifying a specific address. Using an address as the link target allows for non-standard methods of reporting, such that an appropriate broadcast or multicast address will result in those methods being used for external link message transmissions (as opposed to unicast).
References AddRecipient(), cNONE, CommandChainCommand(), DeleteAllRecipients(), wsf::ExternalLinks::CommandChainTarget::mChainName, mDebug, wsf::ExternalLinks::CommandChainTarget::mRcvrName, wsf::ExternalLinks::CommandChainTarget::mReportType, and wsf::comm::Address::ProcessInput().
Referenced by WsfMessageProcessor::Action::ProcessInput().
| bool wsf::ExternalLinks::RemoveRecipient | ( | WsfStringId | aXmtrName, |
| const Address & | aRcvrAddress ) |
References FindLink(), and mLinks.
| bool wsf::ExternalLinks::RemoveRecipient | ( | WsfStringId | aXmtrName, |
| const CommandChainTarget & | aCommandChainTarget ) |
References FindLink(), and mLinks.
| bool wsf::ExternalLinks::RemoveRecipient | ( | WsfStringId | aXmtrName, |
| const CommPair & | aCommPair ) |
References FindLink(), and mLinks.
| bool wsf::ExternalLinks::RemoveRecipient | ( | WsfStringId | aXmtrName, |
| WsfStringId | aCommGroupName ) |
References FindLink(), and mLinks.
| void wsf::ExternalLinks::SendMessage | ( | double | aSimTime, |
| const WsfMessage & | aMessage ) |
References WsfObject::GetName(), GetPlatform(), mDebug, and mLinks.
Referenced by SendMessage(), and WsfTrackProcessor::SendTrackP().
| void wsf::ExternalLinks::SendMessage | ( | double | aSimTime, |
| const WsfMessage & | aMessage, | ||
| WsfStringId | aExcludedPlatformName ) |
Legacy method used by the track manager to avoid reporting tracks back to the last contributor.
References WsfSimulation::GetCommNetworkManager(), WsfObject::GetName(), GetPlatform(), WsfSimulation::GetPlatformByName(), GetSimulation(), mDebug, mLinks, and SendMessage().
|
protected |
Referenced by ProcessInput(), SendMessage(), and SendMessage().
|
protected |
Referenced by AddRecipient(), AddRecipient(), AddRecipient(), AddRecipient(), DeleteAllRecipients(), FindLink(), GetLink(), GetLinkCount(), GetRecipientCount(), GetRecipientCount(), HasLinks(), Initialize(), RemoveRecipient(), RemoveRecipient(), RemoveRecipient(), RemoveRecipient(), SendMessage(), and SendMessage().
|
protected |
Referenced by GetPlatform(), GetSimulation(), and Initialize().