WSF
WsfSimulationExtension Class Reference

#include <WsfSimulationExtension.hpp>

Inheritance diagram for WsfSimulationExtension:
Collaboration diagram for WsfSimulationExtension:

Public Member Functions

 WsfSimulationExtension ()
 ~WsfSimulationExtension () override=default
WsfSimulationGetSimulation () const
const WsfScenarioGetScenario () const
Public Member Functions inherited from WsfExtension
virtual ~WsfExtension ()=default
const std::string & GetExtensionName () const

Friends

class WsfSimulation

Notifications from the simulation.

These are called in the order they are listed.

virtual void AddedToSimulation ()
virtual bool Initialize ()
virtual bool PrepareExtension ()
virtual bool PlatformsInitialized ()
virtual void PendingStart ()
virtual void Start ()
virtual void Complete (double aSimTime)
static void __private_SetSim (WsfSimulationExtension &aExtension, WsfSimulation *aSimPtr)

Additional Inherited Members

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

Detailed Description

A base class for 'simulation extensions'.

An simulation extension is a object created and registered with an simulation object. The simulation object will notify registered simulation extensions when the simulation is initialized, started or completed.

An application extension may instantiate and register a derived version of this class, typically from within the derived class method WsfApplicationExtension::SimulationCreated(). A simulation extension is TYPICALLY necessary only if the application extension also registered an input extension as the simulation extension typically uses the data read by the input extension. There may be cases, however, where an input extension is created but the inputs are only used by instances of extension-created type objects. In this case a simulation extension MAY not be necessary. Your mileage may vary...

Note
The instance is owned by the simulation object once it is registered.

Constructor & Destructor Documentation

◆ WsfSimulationExtension()

◆ ~WsfSimulationExtension()

WsfSimulationExtension::~WsfSimulationExtension ( )
overridedefault

Member Function Documentation

◆ __private_SetSim()

void WsfSimulationExtension::__private_SetSim ( WsfSimulationExtension & aExtension,
WsfSimulation * aSimPtr )
inlinestatic

◆ AddedToSimulation()

◆ Complete()

void WsfSimulationExtension::Complete ( double aSimTime)
virtual

Called in response to a call to WsfSimulation::Complete. This method is used to release any resources (close files or sockets, delete objects, etc.) that were allocated by the Initialize/PrepareExtension methods or otherwise allocated during the execution of the simulation. No other events or observer callbacks will be dispatched after this is called.

Parameters
aSimTimeThe final simulation time of the simulation.

Reimplemented in wsf::coverage::SimulationExtension, wsf::six_dof::ObjectManager, and WsfP6DOF_ObjectManager.

Referenced by WsfSimulation::Complete().

◆ GetScenario()

◆ GetSimulation()

WsfSimulation & WsfSimulationExtension::GetSimulation ( ) const
inline

Returns the simulation to which this extension is registered.

Note
This is not valid until AddedToSimulation() has been called.

References WsfSimulation.

Referenced by WsfDisInterface::ActivateConnection(), WsfMilDisInterface::AddedToDisInterface(), engage::SimulationExtension::AddedToSimulation(), IADSC2SimulationExtension::AddedToSimulation(), wsf::AirCombat::EventPipeInterface::AddedToSimulation(), wsf::altloc::SimulationExtension::AddedToSimulation(), wsf::annotation::EventPipeInterface::AddedToSimulation(), wsf::cyber::SimulationExtension::AddedToSimulation(), wsf::p6dof::EventPipeInterface::AddedToSimulation(), wsf::simdis::Interface::AddedToSimulation(), wsf::six_dof::EventPipeInterface::AddedToSimulation(), wsf::six_dof::ObjectManager::AddedToSimulation(), wsf::space::EventPipeInterface::AddedToSimulation(), WsfEventPipeInterface::AddedToSimulation(), WsfL16::Interface::AddedToSimulation(), WsfMilInterface::AddedToSimulation(), WsfMTT_Interface::AddedToSimulation(), WsfP6DOF_ObjectManager::AddedToSimulation(), WsfScriptObserver::AddedToSimulation(), XWsfOSM_Traffic::AddedToSimulation(), WsfScriptObserver::AddEvent(), WsfLaserDesignations::AddOrUpdate(), XWsfOSM_Traffic::AddScriptedConvoy(), XWsfOSM_Traffic::AddScriptedVehicle(), engage::SimulationExtension::AdvanceTime(), XWsfRoadTraffic::AdvanceTime(), WsfEventPipeInterface::Bookmark(), wsf::coverage::SimulationExtension::Complete(), MTT_PerceivedCluster::CopyFrom(), WsfZoneDefinition::Draw(), WsfEclipseEventManager::Enable(), WsfScriptObserver::EnableOrDisable(), WsfScriptObserver::EventEntry(), WsfScriptObserver::EventExit(), WsfEclipseReport::EclipseEvent::Execute(), WsfScriptObserver::ExecuteScriptList(), WsfScriptObserver::ExecuteScriptList(), WsfDisInterface::ExecuteSensorUpdateEvent(), wsf::altloc::SimulationExtension::GetDraw(), WsfDisUtil::GetSimTime(), WsfDisUtil::GetSimulation(), WsfRIPRJob::GetSimulation(), WsfWeaponServer::GetSimulation(), WsfLaserDesignations::Spot::GetTargetAdjustedLocationWCS(), WsfL16::Interface::GetWeaponTrackNumbers(), XWsfSeaTraffic::HandleDeparture(), XWsfSeaTraffic::HandleEnterLoiter(), WsfEventPipeInterface::HandleScheduledEntityStateRequest(), engage::SimulationExtension::Initialize(), wsf::coverage::SimulationExtension::Initialize(), wsf::cyber::SimulationExtension::Initialize(), WsfAccessReport::Initialize(), WsfBallisticMissileLaunchComputerSharedData::Initialize(), WsfEclipseEventManager::Initialize(), WsfEclipseReport::Initialize(), WsfL16::Interface::Initialize(), WsfLOS_Manager::Initialize(), XWsfAirTraffic::Initialize(), XWsfOSM_Traffic::Initialize(), XWsfRoadTraffic::Initialize(), XWsfSeaTraffic::SeaPort::Initialize(), WsfLOS_Manager::IsTargetVisible(), WsfLOS_Manager::IsTargetVisible(), WsfLOS_Manager::IsTargetVisible(), WsfMilInterface::KillPlatform(), WsfLOS_Manager::LOS_DataExists(), WsfLOS_Manager::LOS_DataExists(), WsfLOS_Manager::LOS_DataExists(), WsfLOS_Manager::MaskedByTerrain(), WsfLOS_Manager::MaskedByTerrain(), WsfLOS_Manager::MaskedByTerrain(), WsfLOS_Manager::MaskedByVegetation(), WsfLOS_Manager::MaskedByVegetation(), WsfLOS_Manager::MaskedByVegetation(), wsf::event::output::SimulationExtension::OpenFile(), wsf::coverage::SimulationExtension::PendingStart(), WsfLaserDesignations::PlatformDeleted(), WsfLOS_Manager::PlatformDeleted(), WsfDisInterface::PrepareExtension(), WsfExtInterface::PrepareExtension(), XWsfAirTraffic::ProcessEvent(), WsfEventPipeInterface::RecordBool(), WsfEventPipeInterface::RecordDouble(), WsfEventPipeInterface::RecordInt(), WsfEventPipeInterface::RecordString(), WsfMilScriptObserver::Register_script_observer(), WsfLaserDesignations::Remove(), XWsfOSM_Traffic::ScriptGoOffroad(), WsfEventPipeInterface::SendModeActive(), WsfLOS_Manager::SetLOS_Data(), WsfLOS_Manager::SetLOS_Data(), WsfLOS_Manager::SetStateData(), WsfLOS_Manager::SetStateData(), WsfDisInterface::SimulationPausing(), WsfLOS_Manager::StateDataExists(), WsfLOS_Manager::StateDataExists(), WsfLaserDesignations::UpdateCallbacks(), XWsfAirTraffic::UpdateFlightStatus(), WsfMilDisPlatform::UpdateJammerSystem(), WsfEventPipeInterface::UpdatePartArticulation(), XWsfOSM_Traffic::UpdateScriptedVehicleRoute(), WsfLOS_Manager::UpdateStateData(), WsfLaserDesignations::Spot::UpdateTo(), UT_DEFINE_SCRIPT_METHOD(), engage::SimulationExtension::WeaponFired(), and engage::SimulationExtension::WeaponTerminated().

◆ Initialize()

bool WsfSimulationExtension::Initialize ( )
virtual

Called in response to WsfSimulation::Initialize. This is called to allow the extension to perform any initialization that is required.

Note
The extension should not assume that another extension has been initialized unless it this extension has been registered as a dependency of the other extension.

Reimplemented in engage::SimulationExtension, wsf::comm::NetworkManager, wsf::coverage::SimulationExtension, wsf::cyber::SimulationExtension, wsf::six_dof::ObjectManager, WsfAccessReport, WsfBallisticMissileLaunchComputerSharedData, WsfDisInterface, WsfEclipseEventManager, WsfEclipseReport, WsfL16::Interface, WsfLaserDesignations, WsfLOS_Manager, WsfMTT_Interface, WsfP6DOF_ObjectManager, WsfScriptObserver, WsfWeaponServer, XWsfAirTraffic, XWsfOSM_Traffic, XWsfRoadTraffic, and XWsfSeaTraffic.

Referenced by WsfL16::Interface::Initialize(), and WsfSimulation::Initialize().

◆ PendingStart()

void WsfSimulationExtension::PendingStart ( )
virtual

Called in response to a call to WsfSimulation::Initialize complete and pending start state. PendingStart is typically called immediately after the simulation is initialized in the main event loop. The simulation is in its pending start state, although the extension may also add additional platforms. using WsfSimulation::AddPlatform.

Reimplemented in wsf::comm::NetworkManager, and wsf::coverage::SimulationExtension.

Referenced by WsfSimulation::Initialize().

◆ PlatformsInitialized()

bool WsfSimulationExtension::PlatformsInitialized ( )
virtual

Called during WsfSimulation::Initialize, via WsfSimulation::AddInputPlatforms(), after all platforms have undergone Initialize() calls. This is called to allow any extension to perform processing that may be predicated on platforms being added to the simulation, with all platforms and components having undergone calls to Initialize(), but prior to calls to Initialize2() having been performed.

Reimplemented in wsf::comm::NetworkManager.

Referenced by WsfSimulation::AddInputPlatforms().

◆ PrepareExtension()

bool WsfSimulationExtension::PrepareExtension ( )
virtual

Called in response to a call to WsfSimulation::Initialize and WsfSimulation::PrepareSimulation.

A simulation extension will typically implement either WsfSimulationExtension::Initialize or WsfSimulationExtension::PrepareExtension, or a combination of both. The main difference is that:

  • WsfSimulationExtension::Initialize is called only when a simulation is initialized after being loaded from input files (the normal mode of operation).
  • WsfSimulation::PrepareExecution is called in the former case AND when a simulation is reloaded from a snapshot.

The primary criteria for deciding which method to use is to look at the extension and see if it uses any external resources such as files or sockets. If the extension uses external resources and wants to support snapshotting then it MUST use this this method so it can (re)establish connections to external resources (A snapshot cannot save the state of an open file or socket and so it must be reopened.)

Reimplemented in wsf::event::output::SimulationExtension, wsf::six_dof::ObjectManager, WsfDisInterface, WsfExtInterface, and WsfP6DOF_ObjectManager.

Referenced by WsfSimulation::Initialize(), and WsfSimulation::PrepareSimulation().

◆ Start()

void WsfSimulationExtension::Start ( )
virtual

Called in response to a call to WsfSimulation::Start. WsfSimulation::Start is typically called immediately before entry in the main event loop. The simulation is in its initial state, although the extension may also add additional platforms. using WsfSimulation::AddPlatform.

Reimplemented in wsf::annotation::EventPipeInterface, wsf::six_dof::ObjectManager, WsfP6DOF_ObjectManager, and WsfScriptObserver.

Referenced by WsfSimulation::Start().

◆ WsfSimulation

friend class WsfSimulation
friend

References WsfSimulation, and WsfSimulationExtension().

Referenced by __private_SetSim(), engage::SimulationExtension::AddedToSimulation(), wsf::cyber::SimulationExtension::AddedToSimulation(), IADSC2SimulationExtension::Find(), wsf::comm::NetworkManager::Find(), wsf::EarthGravityModel::Find(), wsf::simdis::Interface::Find(), WsfCSV_EventOutput::Find(), WsfDisInterface::Find(), WsfDrawManager::Find(), WsfEventOutput::Find(), WsfEventPipeInterface::Find(), WsfExtInterface::Find(), WsfLOS_Manager::Find(), WsfMilInterface::Find(), WsfMilInterface::Find(), WsfMTT_Interface::Find(), WsfScriptObserver::Find(), WsfWeaponServer::Find(), XWsfOSM_Traffic::Find(), wsf::AirCombat::EventPipeInterface::Get(), wsf::altloc::SimulationExtension::Get(), wsf::annotation::EventPipeInterface::Get(), wsf::coverage::SimulationExtension::Get(), wsf::cyber::SimulationExtension::Get(), wsf::p6dof::EventPipeInterface::Get(), wsf::six_dof::EventPipeInterface::Get(), wsf::space::AtmosphereSimulationExtension::Get(), wsf::space::EventPipeInterface::Get(), wsf::UCI_InterfaceExtension::Get(), WsfConstellationManager::Get(), WsfDE_FileManager::Get(), WsfPromptObserver::Get(), WsfL16::Interface::GetControllerFromTrackNumber(), wsf::comm::NetworkManager::GetSimulation(), GetSimulation(), WsfWeaponServer::GetSimulation(), WsfWeaponServer::GetWeaponTrackNumbers(), WsfMilInterface::KillPlatform(), WsfLaserDesignations::Spot::LocalUpdate(), wsf::comm::NetworkManager::NetworkManager(), WsfLaserDesignations::Spot::operator=(), XWsfOSM_Traffic::operator=(), WsfDisInterface::PrepareExtension(), WsfAccessReport::SensorDetectionChangedHandler(), WsfLaserDesignations::Spot::SetDesignatedIndex(), WsfWeaponServer::SetSimulation(), WsfDisInterface::SimulationDestroyed(), WsfDisInterface::WsfDisInterface(), WsfScriptObserver::WsfScriptObserver(), WsfSimulation, WsfWeaponServer::WsfWeaponServer(), XWsfAirTraffic::XWsfAirTraffic(), XWsfSeaTraffic::XWsfSeaTraffic(), wsf::AirCombat::EventPipeInterface::~EventPipeInterface(), wsf::simdis::Interface::~Interface(), WsfConstellationManager::~WsfConstellationManager(), WsfDE_FileManager::~WsfDE_FileManager(), and WsfPromptObserver::~WsfPromptObserver().


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