WSF
wsf::cyber::ScenarioExtension Class Reference

The WSF scenario extension for cyber. More...

#include <WsfCyberScenarioExtension.hpp>

Inheritance diagram for wsf::cyber::ScenarioExtension:
Collaboration diagram for wsf::cyber::ScenarioExtension:

Public Member Functions

void AddedToScenario () override
bool ProcessInput (UtInput &aInput) override
void SimulationCreated (WsfSimulation &aSimulation) override
AttackTypesGetAttackTypes () const
EffectTypesGetEffectTypes () const
ProtectTypesGetProtectTypes () const
ConstraintTypesGetConstraintTypes () const
TriggerTypes & GetTriggerTypes () const
Public Member Functions inherited from WsfScenarioExtension
 WsfScenarioExtension ()
 ~WsfScenarioExtension () override
WsfScenarioGetScenario () const
WsfApplicationGetApplication () const
virtual void FileLoaded (const std::string &aFileName)
virtual bool Complete ()
virtual bool Complete2 ()
virtual bool AlwaysCreate ()
Public Member Functions inherited from WsfExtension
virtual ~WsfExtension ()=default
const std::string & GetExtensionName () const

Static Public Member Functions

static ScenarioExtensionGet (const WsfScenario &aScenario)
 Return a reference to the cyber scenario extension.

GetAttackTypeInputRequirement

Given the name of the attack and the input requirement being tested, returns a boolean value if any of the effects associated with the attack have the specified input requirement.

AttackTypesmAttackTypesPtr
EffectTypesmEffectTypesPtr
ProtectTypesmProtectTypesPtr
ConstraintTypesmConstraintTypesPtr
TriggerTypes * mTriggerTypesPtr
bool mDrawEnabled {false}
bool GetAttackTypeInputRequirement (const std::string &aNamedAttack, Effect::InputRequirement aRequirement) const
bool IsDrawEnabled () const

Type Existence Queries

These methods return if a particular type exists without required knowledge of the types themselves (no needed header)

bool GetAttackTypeExists (const std::string &aNamedAttack) const
bool GetEffectTypeExists (const std::string &aNamedEffect) const
bool GetProtectTypeExists (const std::string &aNamedProtection) const
bool GetTriggerTypeExists (const std::string &aNamedTrigger) const
bool GetConstraintTypesExists (const std::string &aNamedConstraint) const

Additional Inherited Members

Protected Member Functions inherited from WsfExtension
void InitializeExtensionName (const std::string &aName)

Detailed Description

The WSF scenario extension for cyber.

Member Function Documentation

◆ AddedToScenario()

void wsf::cyber::ScenarioExtension::AddedToScenario ( )
overridevirtual

Called when the extension has been added to the scenario. This is typically used to register new component type objects and object factories, e.g.:

WsfScenario& scenario(GetScenario());
WsfMoverTypes::Get(scenario).AddCoreType("MY_MOVER", new MyMover(scenario));
WsfAntennaPatterTypes::Get(scenario).AddObjectFactor(MyAntennaPattern::ObjectFactory);
static WSF_EXPORT WsfMoverTypes & Get(WsfScenario &aScenario)
Return a modifiable reference to the type list associated with the specified scenario.
Definition WsfMoverTypes.cpp:53
bool AddCoreType(WsfStringId aId, std::unique_ptr< T > aDefinitionPtr)
Definition WsfObjectTypeList.hpp:102
WsfScenario & GetScenario() const
Definition WsfScenarioExtension.hpp:46
friend class WsfScenario
Definition WsfScenarioExtension.hpp:39

Script classes must NOT be registered here because they are global to the entire application. They should be registered in WsfApplication::AddedToApplication.

Note
GetScenario() and GetApplication() are now valid.

Reimplemented from WsfScenarioExtension.

References WsfScenario::AddTypeList(), WsfEventPipeExtension::Find(), WsfScenarioExtension::GetScenario(), mAttackTypesPtr, mConstraintTypesPtr, mEffectTypesPtr, mProtectTypesPtr, mTriggerTypesPtr, wsf::cyber::ConstraintTypes::RegisterComponentFactory(), wsf::cyber::Protect::RegisterComponentFactory(), and wsf::cyber::EventPipe::RegisterEvents().

◆ Get()

◆ GetAttackTypeExists()

bool wsf::cyber::ScenarioExtension::GetAttackTypeExists ( const std::string & aNamedAttack) const

References mAttackTypesPtr.

◆ GetAttackTypeInputRequirement()

bool wsf::cyber::ScenarioExtension::GetAttackTypeInputRequirement ( const std::string & aNamedAttack,
Effect::InputRequirement aRequirement ) const

References mAttackTypesPtr, and mEffectTypesPtr.

◆ GetAttackTypes()

AttackTypes & wsf::cyber::ScenarioExtension::GetAttackTypes ( ) const
inline

◆ GetConstraintTypes()

ConstraintTypes & wsf::cyber::ScenarioExtension::GetConstraintTypes ( ) const
inline

◆ GetConstraintTypesExists()

bool wsf::cyber::ScenarioExtension::GetConstraintTypesExists ( const std::string & aNamedConstraint) const

References mConstraintTypesPtr.

◆ GetEffectTypeExists()

bool wsf::cyber::ScenarioExtension::GetEffectTypeExists ( const std::string & aNamedEffect) const

References mEffectTypesPtr.

◆ GetEffectTypes()

EffectTypes & wsf::cyber::ScenarioExtension::GetEffectTypes ( ) const
inline

◆ GetProtectTypeExists()

bool wsf::cyber::ScenarioExtension::GetProtectTypeExists ( const std::string & aNamedProtection) const

References mProtectTypesPtr.

◆ GetProtectTypes()

ProtectTypes & wsf::cyber::ScenarioExtension::GetProtectTypes ( ) const
inline

◆ GetTriggerTypeExists()

bool wsf::cyber::ScenarioExtension::GetTriggerTypeExists ( const std::string & aNamedTrigger) const

References mTriggerTypesPtr.

◆ GetTriggerTypes()

TriggerTypes & wsf::cyber::ScenarioExtension::GetTriggerTypes ( ) const
inline

References mTriggerTypesPtr.

◆ IsDrawEnabled()

bool wsf::cyber::ScenarioExtension::IsDrawEnabled ( ) const
inline

References mDrawEnabled.

◆ ProcessInput()

bool wsf::cyber::ScenarioExtension::ProcessInput ( UtInput & aInput)
overridevirtual

Process potential input for the extension. This method examines the current input command to determine if it is one that is recognized by the extension. If it is one recognized by the extension then it processes the command and returns 'true', otherwise it returns 'false'.

Parameters
aInputa reference to a UtInput object.
Returns
'true' if the command was one recognized by the extension or 'false' if not.
Exceptions
UtInput::ExceptionBase(or an object derived from it) if the command was recognized but contains some sort of error.

Reimplemented from WsfScenarioExtension.

References mDrawEnabled.

◆ SimulationCreated()

void wsf::cyber::ScenarioExtension::SimulationCreated ( WsfSimulation & aSimulation)
overridevirtual

Called when a simulation has been created. (Technically this is called upon entry to WsfSimulation::Initialize()). This is typically used when a scenario extension also requires a simulation extension. The method would typically register the simulation extension as follows:

aSimulation.RegisterExtension("my_ext", new MySimulationExtension());
Parameters
aSimulationThe simulation that is being created. See note below!
Note
This is called upon entry to WsfSimulation::Initialize() and nothing can be assumed about the state of the simulation.
See also
WsfSimulationExtension, WsfApplicationExtension::SimulationCreated

Reimplemented from WsfScenarioExtension.

References WsfSimulation::RegisterExtension().

Member Data Documentation

◆ mAttackTypesPtr

AttackTypes* wsf::cyber::ScenarioExtension::mAttackTypesPtr

◆ mConstraintTypesPtr

ConstraintTypes* wsf::cyber::ScenarioExtension::mConstraintTypesPtr

◆ mDrawEnabled

bool wsf::cyber::ScenarioExtension::mDrawEnabled {false}

Referenced by IsDrawEnabled(), and ProcessInput().

◆ mEffectTypesPtr

EffectTypes* wsf::cyber::ScenarioExtension::mEffectTypesPtr

◆ mProtectTypesPtr

ProtectTypes* wsf::cyber::ScenarioExtension::mProtectTypesPtr

◆ mTriggerTypesPtr

TriggerTypes* wsf::cyber::ScenarioExtension::mTriggerTypesPtr

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