WSF
WsfWeaponPlatformExtension.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11
12#ifndef WSFWEAPONPLATFORMEXTENSION_HPP
13#define WSFWEAPONPLATFORMEXTENSION_HPP
14
15#include "wsf_mil_export.h"
16
17class UtInput;
18#include "WsfComponent.hpp"
20#include "WsfNamed.hpp"
21class WsfPlatform;
22class WsfScenario;
23#include "WsfStringId.hpp"
24#include "WsfVariable.hpp"
26
29{
30public:
31 static void RegisterComponentFactory(WsfScenario& aScenario);
32
34 static WsfWeaponEngagement* GetWeaponEngagement(const WsfPlatform& aPlatform);
35 static bool SetWeaponEngagement(WsfPlatform& aPlatform, WsfWeaponEngagement* aEngagementPtr);
36
38 static WsfWeaponPlatformExtension* Find(const WsfPlatform& aPlatform);
39
44
46
47 WsfComponent* CloneComponent() const override { return new WsfWeaponPlatformExtension(*this); }
48 WsfStringId GetComponentName() const override { return GetNameId(); }
49 const int* GetComponentRoles() const override;
50 void* QueryInterface(int aRole) override;
51 void ComponentParentChanged(WsfPlatform* aPlatformPtr) override { mPlatformPtr = aPlatformPtr; }
53
54 bool Initialize(double aSimTime) override;
55
57
58
60
62 void SetWeaponEffectsType(WsfStringId aWeaponEffectsType) { mWeaponEffectsType = aWeaponEffectsType; }
63 void SetWeaponEffectsType(const WsfVariable<WsfStringId>& aWeaponEffectsType)
64 {
65 mWeaponEffectsType = aWeaponEffectsType;
66 }
67
68
70
71
72 WsfWeaponEngagement* GetWeaponEngagement() const { return mEngagementPtr; }
73 bool SetWeaponEngagement(WsfWeaponEngagement* aEngagementPtr);
75
76private:
77 WsfPlatform* mPlatformPtr;
78 WsfVariable<WsfStringId> mWeaponEffectsType;
79 WsfWeaponEngagement* mEngagementPtr;
80};
81
83
84#endif
#define WSF_DECLARE_COMPONENT_ROLE_TYPE(TYPE, ROLE)
Definition WsfComponentRoles.hpp:44
WsfComponentT< WsfPlatform > WsfPlatformComponent
A convenient typedef for a platform component.
Definition WsfComponent.hpp:171
@ cWSF_COMPONENT_WEAPON_PLATFORM_EXTENSION
Platform extension for weapon support.
Definition WsfMilComponentRoles.hpp:19
UtStringId WsfStringId
WsfStringId – the same thing as UtStringId.
Definition WsfStringId.hpp:23
Definition WsfComponent.hpp:39
WsfStringId GetNameId() const
Definition WsfNamed.hpp:36
WsfNamed()
Definition WsfNamed.cpp:17
Platforms represent a entity within the simulation.
Definition WsfPlatform.hpp:115
Contains the data required to create a simulation, and acts as the entry point for input file process...
Definition WsfScenario.hpp:111
Definition WsfVariable.hpp:149
Definition WsfWeaponEngagement.hpp:43
A platform component used to maintain weapon-related data.
Definition WsfWeaponPlatformExtension.hpp:29
WsfStringId GetComponentName() const override
Definition WsfWeaponPlatformExtension.hpp:48
static void RegisterComponentFactory(WsfScenario &aScenario)
Definition WsfWeaponPlatformExtension.cpp:76
WsfStringId GetWeaponEffectsType()
Get the weapon effects type for the platform.
Definition WsfWeaponPlatformExtension.cpp:188
const int * GetComponentRoles() const override
Definition WsfWeaponPlatformExtension.cpp:151
WsfWeaponEngagement * GetWeaponEngagement() const
If this is a weapon platform, return the pointer to the associated engagement object.
Definition WsfWeaponPlatformExtension.hpp:72
static WsfWeaponPlatformExtension & FindOrCreate(WsfPlatform &aPlatform)
Definition WsfWeaponPlatformExtension.cpp:260
void SetWeaponEffectsType(const WsfVariable< WsfStringId > &aWeaponEffectsType)
Definition WsfWeaponPlatformExtension.hpp:63
static WsfWeaponPlatformExtension * Find(const WsfPlatform &aPlatform)
Definition WsfWeaponPlatformExtension.cpp:252
void SetWeaponEffectsType(WsfStringId aWeaponEffectsType)
Set the name of the weapon effects associated with this platform.
Definition WsfWeaponPlatformExtension.hpp:62
WsfComponent * CloneComponent() const override
Definition WsfWeaponPlatformExtension.hpp:47
WsfWeaponPlatformExtension & operator=(const WsfWeaponPlatformExtension &)=delete
bool Initialize(double aSimTime) override
Definition WsfWeaponPlatformExtension.cpp:166
~WsfWeaponPlatformExtension() override
Definition WsfWeaponPlatformExtension.cpp:145
WsfWeaponPlatformExtension()
Definition WsfWeaponPlatformExtension.cpp:127
void ComponentParentChanged(WsfPlatform *aPlatformPtr) override
Definition WsfWeaponPlatformExtension.hpp:51
static bool SetWeaponEngagement(WsfPlatform &aPlatform, WsfWeaponEngagement *aEngagementPtr)
Definition WsfWeaponPlatformExtension.cpp:107
void * QueryInterface(int aRole) override
Definition WsfWeaponPlatformExtension.cpp:158
Copyrights Multiple, All Rights Reserved