|
WSF
|
#include <WsfUCI_Component.hpp>


Definitions to support templated component methods. | |
| static const int | cWSF_COMPONENT_UCI = 1234568 |
| UCI_Component (const WsfScenario &aScenario, int aPartType) | |
| UCI_Component (const UCI_Component &aSrc) | |
| virtual | ~UCI_Component () |
| UCI_Interface * | GetInterface () |
| double | GetUpdateInterval () const override |
| void | SetUpdateInterval (double aUpdateInterval) override |
| virtual std::set< std::string > | GetCapabilityUUIDs () const |
Component infrastructure methods. | |
| std::string | mSubsystemUUID |
| std::string | mSubsystemLabel |
| WsfStringId | GetComponentName () const override |
| const int * | GetComponentRoles () const override |
| void * | QueryInterface (int aRole) override |
| virtual bool | InjectConditionally (double aSimTime, WsfPlatform &aPlatform) |
| bool | Initialize2 (double aSimTime) override |
| bool | ProcessInput (UtInput &aInput) override |
| bool | IsActive () |
| Is this interface active (i.e., it has a valid corresponding UCI interface; otherwise it does nothing). | |
| bool | RegisterWithInterface (double aSimTime) |
| void | DeregisterWithInterface () |
| void | RegisterCapabilitiesWithInterface () |
| void | DeregisterCapabilitiesWithInterface () |
| virtual void | ReceiveUCI_Message (const uci::type::MessageType *aMessagePtr) |
| WsfSimulation & | GetSimulation () const |
| Convenience Methods. | |
| bool | CanHandleMessage () const |
Additional Inherited Members | |
| Public Types inherited from WsfPlatformPart | |
| enum | { cLEVEL_ONE_DEBUG = 0x00000001 , cLEVEL_TWO_DEBUG = 0x00000002 } |
| using | InternalMessageQueue = std::queue<WsfMessage*> |
| using | RecipientMessageQueue = std::queue<std::pair<WsfPlatformPart*, WsfMessage*>> |
| Public Types inherited from WsfObject | |
| typedef std::vector< WsfStringId > | TypeList |
| The list of types returned by GetTypeList. | |
| Public Types inherited from WsfComponentT< WsfPlatform > | |
| typedef WsfPlatform | ParentType |
| This is needed to support the WsfComponentList template. | |
| Public Member Functions inherited from WsfPlatformPart | |
| WsfPlatformPart (const WsfScenario &aScenario, int aPartType) | |
| WsfPlatformPart & | operator= (const WsfPlatformPart &aRhs)=delete |
| ~WsfPlatformPart () override | |
| const int * | GetComponentRoles () const override |
| void * | QueryInterface (int aRole) override |
| bool | DebugEnabled () const |
| Returns 'true' if debugging is enabled for this instance. | |
| void | SetDebugEnabled (bool aDebugEnabled) |
| unsigned int | GetDebugMask () |
| bool | IsExternallyControlled () const |
| virtual void | SetExternallyControlled (double aSimTime, bool aIsExternallyControlled) |
| int | GetPartType () const |
| const char * | GetScriptClassName () const override |
| WsfSimulation * | GetSimulation () const |
| const WsfScenario & | GetScenario () const |
| WsfStringId | GetComponentName () const override |
| void | ComponentParentChanged (WsfPlatform *aPlatformPtr) override |
| bool | Initialize (double aSimTime) override |
| bool | Initialize2 (double aSimTime) override |
| bool | ProcessInput (UtInput &aInput) override |
| virtual void | Update (double aSimTime) |
| WsfPlatform * | GetPlatform () const |
| virtual void | SetPlatform (WsfPlatform *aPlatformPtr) |
| virtual void | PlatformAdded (double aSimTime, WsfPlatform *aPlatformPtr) |
| virtual void | PlatformDeleted (WsfPlatform *aPlatformPtr) |
| double | GetLastStatusChangeTime () const |
| void | SetLastStatusChangeTime (double aSimTime) |
| Allows a system to set the time at which the device was initialized. | |
| bool | CanBeMadeOperational () const |
| Returns an indication that this system can be made operational. | |
| bool | CanBeMadeNonOperational () const |
| Returns an indication that this system can be made non-operational. | |
| bool | CanBeTurnedOn () const |
| Returns an indication that this system can be turned on. | |
| bool | CanBeTurnedOff () const |
| Returns an indication that this system can be turned off. | |
| bool | IsTurnedOn () const |
| bool | InitiallyTurnedOn () const |
| Is the system to be turned 'on' when added to the simulation? | |
| void | SetInitiallyTurnedOn (bool aInitiallyTurnedOn) |
| Sets if the system is turned on when added to the simulation. | |
| virtual void | TurnOff (double aSimTime) |
| virtual void | TurnOn (double aSimTime) |
| virtual void | SetOperational (double aSimTime) |
| virtual void | SetNonOperational (double aSimTime) |
| virtual void | PartBroken (double aSimTime) |
| virtual void | Restore (double aSimTime) |
| bool | IsOperational () const |
| bool | SetOperational (double aSimTime, bool aMakeOperational) |
| double | GetDamageFactor () const |
| bool | SetDamageFactor (double aSimTime, double aDamageFactor) |
| bool | IsCritical () const |
| void | SetCritical (bool aValue) |
| virtual void | OnPlatformBrokenEvent (double aSimTime) |
| Owning platform has issued a broken event. | |
| bool | IsBroken () const |
| WsfInternalLinks & | GetInternalLinks () |
| Return the internal links for this part. | |
| virtual bool | HasInternalLinks () const |
| Does this platform part have a communication link to other platform parts? | |
| virtual bool | ProcessMessage (double aSimTime, const WsfMessage &aMessage) |
| virtual bool | ReceiveMessage (double aSimTime, const WsfMessage &aMessage) |
| virtual void | SendMessage (double aSimTime, const WsfMessage &aMessage) |
| virtual void | SendMessageTo (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId) |
| void | SendMessageToProcessor (double aSimTime, const WsfMessage &aMessage, WsfStringId aRecipientId) |
| virtual void | SendQueuedMessages (double aSimTime) |
| const WsfCategoryList & | GetCategories () const |
| Get the categories to which this part belongs. | |
| void | AddCategory (WsfStringId aCategoryId) |
| Adds the provided category to the platform part's category list. | |
| bool | IsCategoryMember (WsfStringId aCategoryId) const |
| const WsfGroupList & | GetGroups () const |
| Get the groups to which this platform part belongs. | |
| void | JoinGroup (WsfGroup *aGroupPtr) |
| Join the given group. | |
| void | LeaveGroup (WsfGroup *aGroupPtr) |
| Leave the given group. | |
| bool | IsGroupMember (WsfStringId aGroupId) |
| unsigned int | GetUpdateEventEpoch () const |
| void | IncrementUpdateEventEpoch () |
| bool | UpdateEventActive () const |
| Is an 'Update' event active? | |
| void | SetUpdateEventActive (bool aUpdateEventActive) |
| Indicate if the 'Update' event is active. | |
| Public Member Functions inherited from WsfObject | |
| WsfObject () | |
| This is the constructor for the WsfObject class. | |
| ~WsfObject () override | |
| This is the destructor for the WsfObject class. | |
| const char * | GetScriptClassName () const override |
| virtual WsfObject * | Clone () const =0 |
| const std::string & | GetType () const |
| WsfStringId | GetTypeId () const |
| Get the string ID of the 'type' of the object. | |
| void | SetType (WsfStringId aType) |
| const std::string & | GetBaseType () const |
| WsfStringId | GetBaseTypeId () const |
| const TypeList & | GetTypeList () const |
| bool | IsA_TypeOf (WsfStringId aType) const |
| WsfObject & | operator= (const WsfObject &aRhs) |
| Assignment operator. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| const std::string & | GetName () const |
| WsfStringId | GetNameId () const |
| void | SetName (WsfStringId aName) |
| 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 |
| virtual WsfComponent * | CloneComponent () const =0 |
| virtual int | GetComponentInitializationOrder () const |
| 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 void | PreInput () |
| Public Member Functions inherited from WsfUniqueId | |
| WsfUniqueId () | |
| Construtor initializes the unique identifier to 0. | |
| WsfUniqueId (const WsfUniqueId &) | |
| Copy constructor initializes the unique identifier to 0. | |
| WsfUniqueId & | operator= (const WsfUniqueId &) |
| unsigned int | GetUniqueId () const |
| Get the unique identifier assigned to this object. | |
| template<typename T> | |
| void | Serialize (T &aBuff) |
| For XIO (de)serialization. | |
| Public Member Functions inherited from WsfAuxDataEnabled | |
| WsfAuxDataEnabled ()=default | |
| WsfAuxDataEnabled (const WsfAuxDataEnabled &aSrc)=default | |
| WsfAuxDataEnabled & | operator= (const WsfAuxDataEnabled &aRhs) |
| WsfAuxDataEnabled (WsfAuxDataEnabled &&)=default | |
| WsfAuxDataEnabled & | operator= (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 | |
| WsfAttributeContainer & | GetAuxData () |
| const WsfAttributeContainer & | GetAuxData () const noexcept |
| const WsfAttributeContainer & | GetAuxDataConst () const noexcept |
| Static Public Attributes inherited from WsfAuxDataEnabled | |
| static UtCallbackListN< void(const WsfAuxDataEnabled *)> | AuxDataAccessed |
| static UtCallbackListN< void(const WsfAuxDataEnabled *)> | AuxDataDestroyed |
| WsfPlatformPart (const WsfPlatformPart &aSrc) | |
| Copy constructor (for Clone()). | |
| WsfObject (const WsfObject &aSrc) | |
| Copy constructor (for Clone()). | |
| Protected Member Functions inherited from WsfUniqueId | |
| void | AssignUniqueId (WsfSimulation *aSimulationPtr) |
An example of a simple platform component (See WsfSimplePlatformCompoent). UCI_ are meant to be single instances on platforms with only a defined quantity.
| wsf::UCI_Component::UCI_Component | ( | const WsfScenario & | aScenario, |
| int | aPartType ) |
| wsf::UCI_Component::UCI_Component | ( | const UCI_Component & | aSrc | ) |
References mSubsystemLabel, mSubsystemUUID, UCI_Component(), and WsfPlatformPart::WsfPlatformPart().
|
virtual |
References DeregisterWithInterface().
|
inline |
References WsfPlatformPart::IsOperational(), and WsfPlatformPart::IsTurnedOn().
Referenced by wsf::UCI_PartComponent::GetCapabilityAvailability(), wsf::UCI_SensorComponent::GetCapabilityAvailability(), wsf::UCI_Computer::ProcessMessage(), wsf::UCI_IRST_Component::ProcessMessage(), wsf::UCI_PartComponent::ProcessMessage(), wsf::UCI_AMTI_Component::ReceiveMessage(), wsf::UCI_ESM_Component::ReceiveMessage(), wsf::UCI_WeaponComponent::ReceiveMessage(), wsf::UCI_Computer::ReceiveUCI_Message(), wsf::UCI_WeaponComponent::SendActivityMessage(), wsf::UCI_WeaponComponent::SendCapabilityMessage(), wsf::UCI_WeaponComponent::SendCapabilityStatusMessage(), wsf::UCI_PartComponent::SendControlRequestStatusMessage(), wsf::UCI_SensorComponent::SendControlRequestStatusMessage(), wsf::UCI_PartComponent::SendControlStatusMessage(), wsf::UCI_SensorComponent::SendControlStatusMessage(), wsf::UCI_SensorComponent::SendEntityMessage(), wsf::UCI_PartComponent::SendSubsystemStatusMessage(), wsf::UCI_PartComponent::SendSystemStatusMessage(), wsf::UCI_PartComponent::UpdateCapabilityStatusMessage(), and wsf::UCI_SensorComponent::UpdateCapabilityStatusMessage().
| void wsf::UCI_Component::DeregisterCapabilitiesWithInterface | ( | ) |
References wsf::UCI_Interface::DeregisterCapabilities(), and GetInterface().
| void wsf::UCI_Component::DeregisterWithInterface | ( | ) |
References WsfPlatformPart::DebugEnabled(), wsf::UCI_Interface::DeregisterComponent(), GetInterface(), and WsfObject::GetName().
Referenced by ~UCI_Component().
|
inlinevirtual |
Reimplemented in wsf::UCI_PartComponent.
Referenced by wsf::UCI_Interface::DeregisterCapabilities(), and wsf::UCI_Interface::RegisterCapabilities().
|
inlineoverridevirtual |
Returns the component's name. Each component in a component list has a unique name. Names are usually defined by the user, but they may also be generated by code and prefixed with a '#' to guarantee no collisions with user-defined names.
Implements WsfComponent.
References WsfObject::GetNameId().
|
overridevirtual |
Returns a zero-terminated array of component roles. Note that the array should be in decreasing order of specificity and should generally the inheritance hierarchy. The first entry should be the components 'primary' role. For example a sensor would do the following:
Implements WsfComponent.
Reimplemented in wsf::UCI_Computer, wsf::UCI_ESM_Component, wsf::UCI_IRST_Component, wsf::UCI_PartComponent, wsf::UCI_SensorComponent, and wsf::UCI_WeaponComponent.
References cWSF_COMPONENT_NULL, cWSF_COMPONENT_PLATFORM_PART, and cWSF_COMPONENT_UCI.
| UCI_Interface * wsf::UCI_Component::GetInterface | ( | ) |
References wsf::UCI_InterfaceExtension::Get(), GetInterface(), and GetSimulation().
Referenced by wsf::UCI_WeaponComponent::CommandWeapon(), DeregisterCapabilitiesWithInterface(), DeregisterWithInterface(), GetInterface(), wsf::UCI_PartComponent::HandleControlRequestMessage(), wsf::UCI_WeaponComponent::HandleDMPI_Message(), wsf::UCI_AMTI_Component::Initialize2(), wsf::UCI_ESM_Component::Initialize2(), wsf::UCI_IRST_Component::Initialize2(), wsf::UCI_PartComponent::Initialize2(), wsf::UCI_WeaponComponent::Initialize2(), wsf::UCI_SensorComponent::InitializeModeData(), IsActive(), RegisterCapabilitiesWithInterface(), RegisterWithInterface(), and wsf::UCI_SensorComponent::SendEntityMessage().
|
inline |
Convenience Methods.
Get the simulation of which this component is a part.
References WsfComponentT< WsfPlatform >::GetComponentParent(), and WsfPlatform::GetSimulation().
Referenced by wsf::UCI_SensorComponent::Attach(), GetInterface(), wsf::UCI_PartComponent::HandleControlRequestMessage(), wsf::UCI_Computer::Initialize(), wsf::UCI_WeaponComponent::Initialize2(), wsf::UCI_Computer::ProcessMessage(), wsf::UCI_Computer::ReceiveUCI_Message(), wsf::UCI_SensorComponent::SendEntityMessage(), wsf::UCI_SensorComponent::SlewComplete(), and wsf::UCI_PartComponent::TurnOn().
|
overridevirtual |
Get interval at which Update() is called. This value is set by calling WsfSimulation::GetInstance().SetProcessorUpdateInterval();
Implements WsfPlatformPart.
|
overridevirtual |
Save whether this component was successfully initialized. In overriding this method, this base class method should be called last. (see destructor).
Reimplemented from WsfComponent.
Reimplemented in wsf::UCI_ESM_Component, wsf::UCI_IRST_Component, wsf::UCI_PartComponent, wsf::UCI_SensorComponent, and wsf::UCI_WeaponComponent.
References WsfPlatformPart::Initialize2().
Referenced by wsf::UCI_PartComponent::Initialize2().
|
inlinevirtual |
Reimplemented in wsf::UCI_AMTI_Component, wsf::UCI_ESM_Component, and wsf::UCI_IRST_Component.
|
inline |
Is this interface active (i.e., it has a valid corresponding UCI interface; otherwise it does nothing).
References GetInterface().
Referenced by wsf::UCI_AMTI_Component::Initialize2(), wsf::UCI_IRST_Component::Initialize2(), wsf::UCI_PartComponent::Initialize2(), wsf::UCI_SensorComponent::Initialize2(), wsf::UCI_WeaponComponent::Initialize2(), and wsf::UCI_SensorComponent::PreInitialize().
|
overridevirtual |
Process input from a generic source.
Examine the current input command. If it is NOT one of the commands recognized by this class then it simply returns 'false'. If it is one of the commands recognized by this class then it processes the command and returns 'true'.
| aInput | a reference to a UtInput object. |
| UtInput::ExceptionBase | (or an object derived from it) if the command was recognized but contains some sort of error. |
Reimplemented from WsfObject.
Reimplemented in wsf::UCI_PartComponent, wsf::UCI_SensorComponent, and wsf::UCI_WeaponComponent.
References mSubsystemLabel, mSubsystemUUID, and WsfPlatformPart::ProcessInput().
Referenced by wsf::UCI_PartComponent::ProcessInput().
|
overridevirtual |
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.
Reimplemented in wsf::UCI_Computer, wsf::UCI_ESM_Component, wsf::UCI_IRST_Component, wsf::UCI_PartComponent, wsf::UCI_SensorComponent, and wsf::UCI_WeaponComponent.
References cWSF_COMPONENT_PLATFORM_PART, cWSF_COMPONENT_UCI, and WsfPlatformPart::WsfPlatformPart().
Referenced by wsf::UCI_PartComponent::QueryInterface().
|
inlinevirtual |
Receive a raw UCI message. By default do nothing.
Reimplemented in wsf::UCI_Computer.
| void wsf::UCI_Component::RegisterCapabilitiesWithInterface | ( | ) |
| bool wsf::UCI_Component::RegisterWithInterface | ( | double | aSimTime | ) |
References WsfPlatformPart::DebugEnabled(), GetInterface(), WsfObject::GetName(), and wsf::UCI_Interface::RegisterComponent().
Referenced by wsf::UCI_Computer::PreInitialize().
|
overridevirtual |
Set the time interval between the periodic calls to Update(). A value of less than or equal to zero indicates periodic updates are not to be performed.
| aUpdateInterval | The new update interval. |
Implements WsfPlatformPart.
|
static |
Referenced by wsf::UCI_AMTI_Component::GetComponentRoles(), GetComponentRoles(), wsf::UCI_Computer::GetComponentRoles(), wsf::UCI_ESM_Component::GetComponentRoles(), wsf::UCI_IRST_Component::GetComponentRoles(), wsf::UCI_PartComponent::GetComponentRoles(), wsf::UCI_SensorComponent::GetComponentRoles(), wsf::UCI_WeaponComponent::GetComponentRoles(), QueryInterface(), wsf::UCI_Computer::QueryInterface(), wsf::UCI_ESM_Component::QueryInterface(), and wsf::UCI_IRST_Component::QueryInterface().
|
protected |
|
protected |