WSF
engage::ApplicationExtension Class Reference

#include <ApplicationExtension.hpp>

Inheritance diagram for engage::ApplicationExtension:
Collaboration diagram for engage::ApplicationExtension:

Public Member Functions

 ApplicationExtension ()
void ScenarioCreated (WsfScenario &aScenario) override
void SimulationCreated (WsfSimulation &aSimulation) override
void AddedToApplication (WsfApplication &aApplication) override
Public Member Functions inherited from WsfApplicationExtension
 WsfApplicationExtension ()
 Constructor.
 ~WsfApplicationExtension () override
WsfApplicationGetApplication () const
virtual int ProcessCommandLine (WsfStandardApplication::Options &aOptions, int aArgc, char *aArgv[])
virtual void PrintCommandLineArguments () const
virtual void PrintGrammar (std::ostream &aOut)
virtual void ProcessCommandLineCommands ()
Public Member Functions inherited from WsfExtension
virtual ~WsfExtension ()=default
const std::string & GetExtensionName () const

Additional Inherited Members

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

Constructor & Destructor Documentation

◆ ApplicationExtension()

engage::ApplicationExtension::ApplicationExtension ( )

Member Function Documentation

◆ AddedToApplication()

void engage::ApplicationExtension::AddedToApplication ( WsfApplication & aApplication)
overridevirtual

Called in response to WsfApplication::RegisterExtension. This is typically used to register script classes and methods, e.g.:

UtScriptTypes* scriptTypesPtr(aApplication.GetScriptTypes());
scriptTypesPtr->Register(MySensor::CreateScriptClass("MY_SENSOR", scriptTypesPtr));
Note
GetApplication() is now valid.

Reimplemented from WsfApplicationExtension.

References engage::ExtendScriptClasses(), WsfApplication::GetScriptTypes(), and WsfApplicationExtension::WsfApplication.

◆ ScenarioCreated()

void engage::ApplicationExtension::ScenarioCreated ( WsfScenario & aScenario)
overridevirtual

Called in response to the creation of a WsfScenario object. This is called at the end of the WsfScenario constructor. A derived class may provide this method to do the following:

  • Register a scenario extension to register new types and access the input stream to interpret commands, e.g.:
    aScenario.RegisterExtension("my_extension", new MyScenarioExtension);
  • If a scenario extension is not being created, register new type objects or object factories, e.g.:
    aScenario.GetMoverTypes().AddCoreType("MY_MOVER", new MyMover(aScenario));
    aScenario.GetAntennaPatternTypes().AddObjectFactor(MyAntennaPattern::ObjectFactory);
Parameters
aScenarioThe scenario object that is being created.
See also
WsfScenarioExtension.

Reimplemented from WsfApplicationExtension.

References WsfScenario::RegisterExtension().

◆ SimulationCreated()

void engage::ApplicationExtension::SimulationCreated ( WsfSimulation & aSimulation)
overridevirtual

Called in response to the creation of a WsfSimulation object. This is actually called when the WsfSimulation::Initialize() is called. A derived class will override this method if it needs to concern itself the creation of a simulation.

Notes concerning creation of simulation extensions:

  • If an application extension requires a simulation extension but not a scenario extension (probably a rare occurrence), then the simulation extension should be created here, e.g.:
    aSimulation.RegisterExtension("my_extension", new MySimulationExtension);
  • If, however, the application extension requires both a scenario extension (created by WsfApplicationExtension::ScenarioCreated) and a simulation extension, the simulation extension should be created in WsfScenarioExtension::SimulationCreated. This ensures that any dependencies registered by WsfApplication::ExtensionDepends are honored.
Parameters
aSimulationThe simulation object that is being created.
See also
WsfSimulationExtension.

Reimplemented from WsfApplicationExtension.


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