|
WSF
|
#include <WsfCommandChain.hpp>


Public Types | |
| typedef std::vector< WsfPlatform * > | PlatformList |
| typedef std::vector< WsfPlatform * >::iterator | PlatformListIter |
| Public Types inherited from WsfComponentT< WsfPlatform > | |
| typedef WsfPlatform | ParentType |
| This is needed to support the WsfComponentList template. | |
Public Member Functions | |
| WsfCommandChain () | |
| WsfCommandChain (WsfStringId aCommandChainName, WsfStringId aCommanderName) | |
| Constructor with chain name and commander. | |
| ~WsfCommandChain () override=default | |
| Public Member Functions inherited from WsfSimpleComponentT< WsfPlatformComponent > | |
| WsfSimpleComponentT ()=default | |
| Empty constructor for serialization. | |
| WsfSimpleComponentT (int aRole, WsfStringId aName) | |
| WsfSimpleComponentT (int aRole) | |
| WsfSimpleComponentT (WsfStringId aName) | |
| WsfSimpleComponentT (const WsfSimpleComponentT &aSrc) | |
| WsfSimpleComponentT & | operator= (const WsfSimpleComponentT &aRhs) |
| ~WsfSimpleComponentT () override=default | |
| WsfStringId | GetComponentName () const override |
| const int * | GetComponentRoles () const override |
| Public Member Functions inherited from WsfComponentT< WsfPlatform > | |
| WsfComponentT () | |
| WsfComponentT (const WsfComponentT &) noexcept | |
| WsfComponentT & | operator= (const WsfComponentT &) noexcept |
| ~WsfComponentT () override=default | |
| ParentType * | GetComponentParent () const |
| void | SetComponentParent (ParentType *aParentPtr) |
| Public Member Functions inherited from WsfComponent | |
| virtual | ~WsfComponent ()=default |
| template<typename T> | |
| bool | QueryInterfaceT (T *&aRolePtr) |
| bool | ComponentHasRole (int aRole) |
| Returns true if the component has the specified role. | |
| virtual bool | PreInitialize (double aSimTime) |
| virtual bool | Initialize2 (double aSimTime) |
| virtual void | PreInput () |
| virtual bool | ProcessInput (UtInput &aInput) |
| Public Member Functions inherited from WsfNamed | |
| WsfNamed () | |
| WsfNamed (WsfStringId aName) | |
| WsfNamed (const WsfNamed &)=default | |
| WsfNamed & | operator= (const WsfNamed &)=default |
| virtual | ~WsfNamed ()=default |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
Static Public Member Functions | |
| static void | RegisterComponentFactory (WsfScenario &aScenario) |
| static std::unique_ptr< UtScriptClass > | CreateScriptClass (const std::string &aClassName, UtScriptTypes *aScriptTypesPtr) |
| static std::string | GetDefaultName () |
| Get the name to be used for the default command chain. | |
| static WsfStringId | GetDefaultNameId () |
| Get the name (string ID) to be used for the default command chain. | |
Simulation infrastructure methods. | |
| static bool | LoadInstance (UtInput &aInput, WsfCommandChain *&aInstancePtr) |
| bool | Initialize (double aSimTime) override |
| void | PlatformAdded (WsfPlatform *aPlatformPtr) |
| void | PlatformDeleted (WsfPlatform *aPlatformPtr) |
| WsfCommandChain (const WsfCommandChain &aSrc) | |
| Copy constructor (for Clone()). | |
| WsfCommandChain & | operator= (const WsfCommandChain &aRhs) |
Component infrastructure methods | |
| WsfComponent * | CloneComponent () const override |
| void * | QueryInterface (int aRole) override |
| int | GetComponentInitializationOrder () const override |
| void | ComponentParentChanged (WsfPlatform *aPlatformPtr) override |
| WsfPlatform * | GetPlatform () const |
Commander methods. | |
| WsfPlatform * | GetCommander () const |
| void | SetCommander (WsfPlatform *aPlatformPtr) |
| std::string | GetCommanderName () const |
| Get the name of the commander. | |
| WsfStringId | GetCommanderNameId () const |
| Get the name ID of the commander;. | |
Peer methods. | |
| PlatformList & | GetPeers () |
| void | AddPeer (WsfPlatform *aPlatformPtr) |
| Adds the given platform to the list of peers in the command chain. | |
| void | RemovePeer (WsfPlatform *aPlatformPtr) |
| Removes the given platform from the list of peers in the command chain. | |
Subordinate methods. | |
| PlatformList & | GetSubordinates () |
| void | AddSubordinate (WsfPlatform *aPlatformPtr) |
| Adds the given platform to the list of subordinates in the command chain. | |
| void | RemoveSubordinate (WsfPlatform *aPlatformPtr) |
| Removes the given platform from the list of subordinates in the command chain. | |
Additional Inherited Members | |
| int | mRoles [2] |
The command and control reporting structure of a platform.
This object indicates the immediate commander, peers and of a specific platform within a specific command chain.
| typedef std::vector<WsfPlatform*> WsfCommandChain::PlatformList |
| typedef std::vector<WsfPlatform*>::iterator WsfCommandChain::PlatformListIter |
| WsfCommandChain::WsfCommandChain | ( | ) |
References cWSF_COMPONENT_COMMAND_CHAIN.
Referenced by CloneComponent(), LoadInstance(), operator=(), PlatformAdded(), PlatformDeleted(), SetCommander(), and WsfCommandChain().
| WsfCommandChain::WsfCommandChain | ( | WsfStringId | aCommandChainName, |
| WsfStringId | aCommanderName ) |
Constructor with chain name and commander.
References cWSF_COMPONENT_COMMAND_CHAIN.
|
overridedefault |
|
protected |
Copy constructor (for Clone()).
References WsfCommandChain().
| void WsfCommandChain::AddPeer | ( | WsfPlatform * | aPlatformPtr | ) |
Adds the given platform to the list of peers in the command chain.
Referenced by PlatformAdded(), and SetCommander().
| void WsfCommandChain::AddSubordinate | ( | WsfPlatform * | aPlatformPtr | ) |
Adds the given platform to the list of subordinates in the command chain.
Referenced by PlatformAdded(), and SetCommander().
|
inlineoverridevirtual |
Clones a component. May return null if component does not support clone.
Implements WsfComponent.
References WsfCommandChain().
|
inlineoverridevirtual |
The parent to which the component is attached has been updated. This virtual method is called whenever the components parent attachment has been changed. This is provided so derived class receives notification of the change.
| aParentPtr | Pointer to the new parent. The new parent may be null if the attachment was severed. |
Reimplemented from WsfComponentT< WsfPlatform >.
|
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().
|
inline |
Get the commander of the command chain
Referenced by checkUpCommandChain(), checkUpCommandChain(), checkUpCommandChain(), checkUpCommandChain(), WsfRIPRProcessor::CommanderPlatform(), WsfRIPRProcessor::CommanderProcessor(), wsf::comm::util::SelectRecipients(), WsfXIO_PlatformInfoService::SendCommandChain(), WsfBMDisseminateC2::SendMessage(), WsfPerceptionProcessor::TruthAssets(), WsfSA_Perceive::TruthAssets(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
| std::string WsfCommandChain::GetCommanderName | ( | ) | const |
Get the name of the commander.
Referenced by WsfExplicitWeapon::InitializeCommandChains().
|
inline |
Get the name ID of the commander;.
Referenced by WsfXIO_ObjectInfoLoad::Load_Platform(), WsfMessageProcessor::Selector::Matches(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
|
inlineoverridevirtual |
Forces a specific initialization order. Components are initialized in increasing initialization order value.
Reimplemented from WsfComponent.
References cWSF_INITIALIZE_ORDER_COMMAND_CHAIN.
|
static |
Get the name to be used for the default command chain.
Referenced by WsfRIPRProcessor::CommanderPlatform(), WsfRIPRProcessor::CommanderProcessor(), WsfExplicitWeapon::ProcessInput(), WsfRIPRProcessor::SubordinatePlatforms(), WsfRIPRProcessor::SubordinateProcessors(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
|
static |
Get the name (string ID) to be used for the default command chain.
Referenced by checkFullCommandChain(), checkFullCommandChain(), WsfBMUtils::GetCommander(), getManagingSensorsManager(), WsfL16::ComputerPart::Initialize(), LoadInstance(), wsf::comm::util::LocalSlaveNetworkName(), WsfMessageProcessor::Selector::Matches(), PlatformAdded(), PlatformDeleted(), WsfBMDisseminateC2::SendMessage(), WsfWeaponServer::SetCommander(), WsfRIPRProcessor::Subordinates(), WsfPerceptionProcessor::TruthAssets(), WsfSA_Perceive::TruthAssets(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().
|
inline |
Get the list of peers in the command chain
Referenced by WsfMessageProcessor::Selector::Matches(), wsf::comm::util::SelectRecipients(), WsfBMDisseminateC2::SendMessage(), WsfPerceptionProcessor::TruthAssets(), WsfSA_Perceive::TruthAssets(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
|
inline |
Get the platform associated with this node in the command chain.
Referenced by wsf::comm::util::SelectRecipients(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().
|
inline |
Get the list of subordinates in the command chain
Referenced by checkDownCommandChain(), checkDownCommandChain(), getAllPartsDownCommandChain(), WsfMessageProcessor::Selector::Matches(), wsf::comm::util::SelectRecipients(), WsfXIO_PlatformInfoService::SendCommandChain(), WsfBMDisseminateC2::SendMessage(), SetCommander(), WsfRIPRProcessor::SubordinatePlatforms(), WsfRIPRProcessor::SubordinateProcessors(), WsfRIPRProcessor::Subordinates(), WsfPerceptionProcessor::TruthAssets(), WsfSA_Perceive::TruthAssets(), UT_DEFINE_SCRIPT_METHOD(), UT_DEFINE_SCRIPT_METHOD(), and WsfPlatformScriptMethods::UT_DEFINE_SCRIPT_METHOD_EXT().
|
overridevirtual |
Perform phase 1 initialization. This is called by WsfPlatform::Initialize() during phase 1 initialization of the platform. The component should complete validation of input data that could not be done by ProcessInput, as well as any other functions to prepare for simulation use (subject to the next paragraph).
The order in which components are initialized is defined by GetComponentInitializationOrder. In general a component implementation of this method should not be dependent on the state of another component, i.e.: it should not assume that the other components Initialize() method has been called. If such a dependency exists one should use Initialize2() if possible, or specify a value GetComponentInitializationOrder to force things to initialize in a particular order.
| aSimTime | The current simulation time. |
Reimplemented from WsfComponent.
References ok.
Referenced by SetCommander().
|
static |
Create a command chain with the specified input.
| aInput | A generic input. |
| aInstancePtr | [output] The command chain to be created. |
References GetDefaultNameId(), and WsfCommandChain().
|
protected |
| void WsfCommandChain::PlatformAdded | ( | WsfPlatform * | aPlatformPtr | ) |
Perform initialization associated with a platform's being added to the simulation.
| aPlatformPtr | The platform (WsfPlatform*) that was just added. |
References AddPeer(), AddSubordinate(), WsfComponentList::GetComponent(), GetDefaultNameId(), WsfNamed::GetNameId(), WsfObject::GetNameId(), SetCommander(), and WsfCommandChain().
Referenced by WsfPlatform::PlatformAdded().
| void WsfCommandChain::PlatformDeleted | ( | WsfPlatform * | aPlatformPtr | ) |
Perform cleanup associated with a platform's being deleted from the simulation.
| aPlatformPtr | The platform (WsfPlatform*) that is about to be deleted. |
References GetDefaultNameId(), WsfNamed::GetNameId(), RemovePeer(), RemoveSubordinate(), and WsfCommandChain().
Referenced by WsfPlatform::PlatformDeleted().
|
inlineoverridevirtual |
Requests a component's role interface. A component can support one or more roles.
| aRole | The role whose interface is to be returned. |
Implements WsfComponent.
References WsfSimpleComponentT< WsfPlatformComponent >::mRoles.
|
static |
References WsfScenario::RegisterComponentFactory().
| void WsfCommandChain::RemovePeer | ( | WsfPlatform * | aPlatformPtr | ) |
Removes the given platform from the list of peers in the command chain.
Referenced by PlatformDeleted(), and SetCommander().
| void WsfCommandChain::RemoveSubordinate | ( | WsfPlatform * | aPlatformPtr | ) |
Removes the given platform from the list of subordinates in the command chain.
Referenced by PlatformDeleted(), and SetCommander().
| void WsfCommandChain::SetCommander | ( | WsfPlatform * | aPlatformPtr | ) |
Define a new commander for this command chain.
| aPlatformPtr | The new commander. |
References AddPeer(), AddSubordinate(), WsfNamed::GetNameId(), WsfObject::GetNameId(), GetSubordinates(), Initialize(), RemovePeer(), RemoveSubordinate(), and WsfCommandChain().
Referenced by PlatformAdded(), WsfWeaponServer::SetCommander(), UT_DEFINE_SCRIPT_METHOD(), and UT_DEFINE_SCRIPT_METHOD().