WSF
WsfWeaponPlatformExtension Class Reference

A platform component used to maintain weapon-related data. More...

#include <WsfWeaponPlatformExtension.hpp>

Inheritance diagram for WsfWeaponPlatformExtension:
Collaboration diagram for WsfWeaponPlatformExtension:

Public Member Functions

 WsfWeaponPlatformExtension ()
 WsfWeaponPlatformExtension (const WsfWeaponPlatformExtension &aSrc)
 ~WsfWeaponPlatformExtension () override
WsfWeaponPlatformExtensionoperator= (const WsfWeaponPlatformExtension &)=delete
Public Member Functions inherited from WsfNamed
 WsfNamed ()
 WsfNamed (WsfStringId aName)
 WsfNamed (const WsfNamed &)=default
WsfNamedoperator= (const WsfNamed &)=default
virtual ~WsfNamed ()=default
const std::string & GetName () const
WsfStringId GetNameId () const
void SetName (WsfStringId aName)
Public Member Functions inherited from WsfComponentT< WsfPlatform >
 WsfComponentT ()
 WsfComponentT (const WsfComponentT &) noexcept
WsfComponentToperator= (const WsfComponentT &) noexcept
 ~WsfComponentT () override=default
ParentTypeGetComponentParent () const
void SetComponentParent (ParentType *aParentPtr)
Public Member Functions inherited from WsfComponent
virtual ~WsfComponent ()=default
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 bool Initialize2 (double aSimTime)
virtual void PreInput ()
virtual bool ProcessInput (UtInput &aInput)

Static Public Member Functions

static void RegisterComponentFactory (WsfScenario &aScenario)
static WsfStringId GetWeaponEffectsType (WsfPlatform &aPlatform)
static WsfWeaponEngagementGetWeaponEngagement (const WsfPlatform &aPlatform)
static bool SetWeaponEngagement (WsfPlatform &aPlatform, WsfWeaponEngagement *aEngagementPtr)
static WsfWeaponPlatformExtensionFindOrCreate (WsfPlatform &aPlatform)
static WsfWeaponPlatformExtensionFind (const WsfPlatform &aPlatform)

Weapon engagement data.

WsfWeaponEngagementGetWeaponEngagement () const
 If this is a weapon platform, return the pointer to the associated engagement object.
bool SetWeaponEngagement (WsfWeaponEngagement *aEngagementPtr)

Component infrastructure methods

WsfComponentCloneComponent () const override
WsfStringId GetComponentName () const override
const int * GetComponentRoles () const override
void * QueryInterface (int aRole) override
void ComponentParentChanged (WsfPlatform *aPlatformPtr) override
bool Initialize (double aSimTime) override

Weapon effects methods.

WsfStringId GetWeaponEffectsType ()
 Get the weapon effects type for the platform.
void SetWeaponEffectsType (WsfStringId aWeaponEffectsType)
 Set the name of the weapon effects associated with this platform.
void SetWeaponEffectsType (const WsfVariable< WsfStringId > &aWeaponEffectsType)

Additional Inherited Members

Public Types inherited from WsfComponentT< WsfPlatform >
typedef WsfPlatform ParentType
 This is needed to support the WsfComponentList template.

Detailed Description

A platform component used to maintain weapon-related data.

Constructor & Destructor Documentation

◆ WsfWeaponPlatformExtension() [1/2]

WsfWeaponPlatformExtension::WsfWeaponPlatformExtension ( )

◆ WsfWeaponPlatformExtension() [2/2]

WsfWeaponPlatformExtension::WsfWeaponPlatformExtension ( const WsfWeaponPlatformExtension & aSrc)

◆ ~WsfWeaponPlatformExtension()

WsfWeaponPlatformExtension::~WsfWeaponPlatformExtension ( )
override

Member Function Documentation

◆ CloneComponent()

WsfComponent * WsfWeaponPlatformExtension::CloneComponent ( ) const
inlineoverridevirtual

Clones a component. May return null if component does not support clone.

Implements WsfComponent.

References WsfWeaponPlatformExtension().

◆ ComponentParentChanged()

void WsfWeaponPlatformExtension::ComponentParentChanged ( WsfPlatform * aParentPtr)
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.

Parameters
aParentPtrPointer to the new parent. The new parent may be null if the attachment was severed.

Reimplemented from WsfComponentT< WsfPlatform >.

◆ Find()

◆ FindOrCreate()

WsfWeaponPlatformExtension & WsfWeaponPlatformExtension::FindOrCreate ( WsfPlatform & aPlatform)
static

◆ GetComponentName()

WsfStringId WsfWeaponPlatformExtension::GetComponentName ( ) const
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 WsfNamed::GetNameId().

◆ GetComponentRoles()

const int * WsfWeaponPlatformExtension::GetComponentRoles ( ) const
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:

return roles;
@ cWSF_COMPONENT_SENSOR
A 'sensor' component (WsfSensor).
Definition WsfComponentRoles.hpp:105
@ cWSF_COMPONENT_PLATFORM_PART
The component derives from WsfPlatformPart.
Definition WsfComponentRoles.hpp:98
@ cWSF_COMPONENT_ARTICULATED_PART
The component derives from WsfArticulatedPart.
Definition WsfComponentRoles.hpp:99

Implements WsfComponent.

References cWSF_COMPONENT_WEAPON_PLATFORM_EXTENSION.

◆ GetWeaponEffectsType() [1/2]

WsfStringId WsfWeaponPlatformExtension::GetWeaponEffectsType ( )

Get the weapon effects type for the platform.

References WsfVariable< T >::Initialize().

Referenced by WsfWeaponEffects::GetWeaponEffectsType().

◆ GetWeaponEffectsType() [2/2]

WsfStringId WsfWeaponPlatformExtension::GetWeaponEffectsType ( WsfPlatform & aPlatform)
static

◆ GetWeaponEngagement() [1/2]

WsfWeaponEngagement * WsfWeaponPlatformExtension::GetWeaponEngagement ( ) const
inline

If this is a weapon platform, return the pointer to the associated engagement object.

Referenced by WsfWeaponEngagement::Find().

◆ GetWeaponEngagement() [2/2]

WsfWeaponEngagement * WsfWeaponPlatformExtension::GetWeaponEngagement ( const WsfPlatform & aPlatform)
static

◆ Initialize()

bool WsfWeaponPlatformExtension::Initialize ( double aSimTime)
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.

Parameters
aSimTimeThe current simulation time.
Returns
true if successful or false if unsuccessful (bad input data, etc.)
Note
This method should NOT add any other components to the platform. This MUST be done in PreInitialize().

Reimplemented from WsfComponent.

References ok.

◆ operator=()

WsfWeaponPlatformExtension & WsfWeaponPlatformExtension::operator= ( const WsfWeaponPlatformExtension & )
delete

◆ QueryInterface()

void * WsfWeaponPlatformExtension::QueryInterface ( int aRole)
overridevirtual

Requests a component's role interface. A component can support one or more roles.

Parameters
aRoleThe role whose interface is to be returned.
Returns
A pointer to the object if it supports the indicated role, or 'null' if it does not. Usage: WsfProcessor* procPtrOrNull = (WsfProcessor*)componentPtr->QueryComponentInterface(cWSF_COMPONENT_PROCESSOR);

Implements WsfComponent.

References cWSF_COMPONENT_WEAPON_PLATFORM_EXTENSION.

◆ RegisterComponentFactory()

void WsfWeaponPlatformExtension::RegisterComponentFactory ( WsfScenario & aScenario)
static

◆ SetWeaponEffectsType() [1/2]

void WsfWeaponPlatformExtension::SetWeaponEffectsType ( const WsfVariable< WsfStringId > & aWeaponEffectsType)
inline

◆ SetWeaponEffectsType() [2/2]

void WsfWeaponPlatformExtension::SetWeaponEffectsType ( WsfStringId aWeaponEffectsType)
inline

Set the name of the weapon effects associated with this platform.

◆ SetWeaponEngagement() [1/2]

bool WsfWeaponPlatformExtension::SetWeaponEngagement ( WsfPlatform & aPlatform,
WsfWeaponEngagement * aEngagementPtr )
static

◆ SetWeaponEngagement() [2/2]

bool WsfWeaponPlatformExtension::SetWeaponEngagement ( WsfWeaponEngagement * aEngagementPtr)

Attach the weapon engagement object to the platform. Any existing weapon engagement object is simply deleted. Any required initialization of the weapon engagement object will be performed.

Parameters
aEngagementPtrPointer to the engagement object. The platform assumes ownership of the object.
Returns
true if successful or false if the weapon engagement could not be initialized. If false is returned then the engagement object is deleted.
Note
This is really only useful if the platform represents a weapon.

References WsfWeaponEngagement::Delete(), WsfNamed::GetName(), ok, and SetWeaponEngagement().


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