|
WSF
|
#include <WsfApplicationExtension.hpp>


Public Member Functions | |
| WsfApplicationExtension () | |
| Constructor. | |
| ~WsfApplicationExtension () override | |
| WsfApplication & | GetApplication () const |
| Public Member Functions inherited from WsfExtension | |
| virtual | ~WsfExtension ()=default |
| const std::string & | GetExtensionName () const |
Friends | |
| class | WsfApplication |
Notifications from WsfApplication to support 'standard application' methods. | |
| virtual int | ProcessCommandLine (WsfStandardApplication::Options &aOptions, int aArgc, char *aArgv[]) |
| virtual void | PrintCommandLineArguments () const |
| virtual void | PrintGrammar (std::ostream &aOut) |
| virtual void | ProcessCommandLineCommands () |
Notifications from WsfApplication. | |
| virtual void | AddedToApplication (WsfApplication &aApplication) |
| virtual void | ScenarioCreated (WsfScenario &aScenario) |
| virtual void | SimulationCreated (WsfSimulation &aSimulation) |
Additional Inherited Members | |
| Protected Member Functions inherited from WsfExtension | |
| void | InitializeExtensionName (const std::string &aName) |
An application extension represents an optional capability that can be added to an application.
An application extension provides an interface to add functionality to a scenario or simulation. A program creates a WsfApplication object and registers the desired application extensions to provide the capabilities it requires.
The program registers application extensions using:
This is acceptable if the program knows if the list of extensions is always the same. If, however, the list varies then it becomes unwieldy to maintain not only the program but the associated CMake files. To alleviate this problem a convention has been developed to allow the definition of 'optional' extensions that can be automatically included or excluded from a build simply by their presence or absence from the build directory. To make use of this capability:
Following this convention allows the extension to be included or excluded from the application based simply on its presence or absence from the build tree. Even if one does not want to use the capability, it still simplifies the main program by eliminating the need for the include file:
| WsfApplicationExtension::WsfApplicationExtension | ( | ) |
Constructor.
Referenced by engage::ApplicationExtension::ApplicationExtension(), and WsfApplication.
|
override |
|
virtual |
Called in response to WsfApplication::RegisterExtension. This is typically used to register script classes and methods, e.g.:
Reimplemented in engage::ApplicationExtension, wsf::cyber::ApplicationExtension, and wsf::dis::ApplicationExtension.
References WsfApplication.
|
inline |
Returns the application to which this extension is registered.
References WsfApplication.
|
virtual |
Called by WsfApplication::ShowUsage to let the application display its supported arguments. The usage should be displayed on standard output.
Reimplemented in WsfProfilingApplicationExtension.
Referenced by WsfStandardApplication::ShowUsage().
|
virtual |
If the extension provides input processing, this method can output the associated grammar. This is not necessary if the extension installs a .ag file in the appropriate location.
| aOut | The output stream to which the grammar should be written. |
|
virtual |
Called by WsfApplication::ProcessCommandLine to examine the current argument and process if necessary. If the application extension recognizes the argument, this method should return the number of entries processed.
| aOptions | The application options used to start the application |
| aArgc | The number of arguments remaining in the argument list. |
| aArgv | Any array of the arguments remaining in the argument list. |
Reimplemented in WsfGrammarExtension, and WsfProfilingApplicationExtension.
Referenced by WsfStandardApplication::ProcessCommandLine().
|
virtual |
Called by WsfApplication::ProcessCommandLineCommands to let the application extension process any commands included in the command line.
Reimplemented in WsfGrammarExtension.
Referenced by WsfStandardApplication::ProcessCommandLineCommands().
|
virtual |
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:
| aScenario | The scenario object that is being created. |
Reimplemented in engage::ApplicationExtension, wsf::cyber::ApplicationExtension, wsf::dis::ApplicationExtension, and WsfDefaultApplicationExtension< SCENARIO_EXTENSION >.
|
virtual |
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:
| aSimulation | The simulation object that is being created. |
Reimplemented in engage::ApplicationExtension.
|
friend |
References WsfApplication, and WsfApplicationExtension().
Referenced by engage::ApplicationExtension::AddedToApplication(), wsf::cyber::ApplicationExtension::AddedToApplication(), wsf::dis::ApplicationExtension::AddedToApplication(), AddedToApplication(), WsfGrammarExtension::Find(), GetApplication(), WsfApplication, wsf::cyber::ApplicationExtension::~ApplicationExtension(), and wsf::dis::ApplicationExtension::~ApplicationExtension().