WSF
WsfEvent Class Referenceabstract

#include <WsfEvent.hpp>

Inheritance diagram for WsfEvent:

Public Types

enum  EventDisposition { cDELETE , cRESCHEDULE }

Public Member Functions

 WsfEvent ()=default
 WsfEvent (double aSimTime, int aPriority=0)
 WsfEvent (const WsfEvent &aSrc)=delete
 Copy constructor and copy assignment deleted to prevent copying.
WsfEventoperator= (const WsfEvent &aRhs)=delete
virtual ~WsfEvent ()=default
virtual EventDisposition Execute ()=0
double GetTime () const
int GetPriority () const
bool ShouldExecute () const
void SetTime (double aSimTime)
void SetPriority (int aPriority)
void SetShouldExecute (bool aExecute)
WsfSimulationGetSimulation () const
void AddedToEventQueue (WsfSimulation &aSimulation)
 Called when the event is added to the event queue of the specified simulation.

Detailed Description

A abstract base class for all events within an event driven simulation.

WsfEvent represents events that are managed by WsfEventManager.

Note
The derived class must supply an Execute() method which will be called when the event is dispatched.

Member Enumeration Documentation

◆ EventDisposition

EventDisposition is the return value for the Execute method.

The event disposition is used by WsfEventManager to reschedule events that need to execute on a regular basis. This prevents the constant deletion and reallocation of events that need to execute repeatedly.

Enumerator
cDELETE 

Delete the event from the event queue.

cRESCHEDULE 

Reschedule the event. WsfEvent::SetTime should have been called with the new time.

Constructor & Destructor Documentation

◆ WsfEvent() [1/3]

WsfEvent::WsfEvent ( )
default

Create an event with no specified dispatch time.

Note
WsfEvent::SetTime must be called prior to adding the event to queue.

Referenced by WsfSimulation::AddPlatformEvent::AddPlatformEvent(), XWsfAirTraffic::AirTrafficEvent::AirTrafficEvent(), wsf::comm::ComponentHW::AltFrequencyChangeEvent::AltFrequencyChangeEvent(), WsfSensorMode::AltFrequencyChangeEvent::AltFrequencyChangeEvent(), WsfWeapon::CompleteReloadEvent::CompleteReloadEvent(), WsfTimeDelayQueue::CompleteRequestEvent::CompleteRequestEvent(), XWsfSeaTraffic::DepartureEvent::DepartureEvent(), WsfEclipseReport::EclipseEvent::EclipseEvent(), wsf::comm::Event::Event(), wsf::cyber::Event::Event(), WsfTaskManager::EventBase::EventBase(), WsfScriptContext::ExecuteTimedEventScript::ExecuteTimedEventScript(), XWsfAirTraffic::ExitLoiterEvent::ExitLoiterEvent(), XWsfSeaTraffic::ExitLoiterEvent::ExitLoiterEvent(), wsf::comm::GenericEvent< T >::GenericEvent(), wsf::comm::IGMP_SubscriptionEvent::IGMP_SubscriptionEvent(), WsfTSPI_Mover::InitializeMoverEvent::InitializeMoverEvent(), WsfTSPI_Mover::InitializeMoverEvent::InitializeMoverEvent(), wsf::comm::LayerEvent::LayerEvent(), WsfSensor::ModeChangeEvent::ModeChangeEvent(), WsfSensor::ModeChangeEvent::ModeChangeEvent(), operator=(), wsf::eventpipe::PartUpdateEvent::PartUpdateEvent(), WsfBallisticMissileLaunchComputer::PurgeSolutionEvent::PurgeSolutionEvent(), WsfWeapon::SalvoEvent::SalvoEvent(), WsfImplicitWeapon::TerminateEngagementEvent::TerminateEngagementEvent(), ToolUpdateEvent::ToolUpdateEvent(), WsfJTIDS_SlotGroup::TransmitHeartbeatEvent::TransmitHeartbeatEvent(), wsf::UCI_Message_Event::UCI_Message_Event(), wsf::UCI_SetDefaultModeEvent::UCI_SetDefaultModeEvent(), WsfRouteMover::UnpauseEvent::UnpauseEvent(), WsfMobilityAndFirepowerLethality::UpdateEvent::UpdateEvent(), WsfXIO_PlatformPartInfoService::UpdatePartEvent::UpdatePartEvent(), WsfArticulatedPartEvent::WsfArticulatedPartEvent(), WsfBrawlerConsicousnessEvent::WsfBrawlerConsicousnessEvent(), WsfEvent(), WsfEventAdapterT< RT, Args >::WsfEventAdapterT(), WsfMoverUpdateEvent::WsfMoverUpdateEvent(), WsfPerceptionProcessorUpdateEvent::WsfPerceptionProcessorUpdateEvent(), WsfPlatformPartEvent::WsfPlatformPartEvent(), WsfScriptEvent::WsfScriptEvent(), WsfScriptEvent::WsfScriptEvent(), WsfScriptEvent::WsfScriptEvent(), WsfTrackProcessor_PurgeTracksEvent::WsfTrackProcessor_PurgeTracksEvent(), WsfTrackProcessor_ReportTracksEvent::WsfTrackProcessor_ReportTracksEvent(), and WsfTrackStateController_RequestEvaluationEvent::WsfTrackStateController_RequestEvaluationEvent().

◆ WsfEvent() [2/3]

WsfEvent::WsfEvent ( double aSimTime,
int aPriority = 0 )
inline

Create an event with a specified dispatch time and optional priority.

Parameters
aSimTimeThe simulation time when the event should be dispatched.
aPriorityThe priority associated with this event.

◆ WsfEvent() [3/3]

WsfEvent::WsfEvent ( const WsfEvent & aSrc)
delete

Copy constructor and copy assignment deleted to prevent copying.

References WsfEvent().

◆ ~WsfEvent()

virtual WsfEvent::~WsfEvent ( )
virtualdefault

Member Function Documentation

◆ AddedToEventQueue()

void WsfEvent::AddedToEventQueue ( WsfSimulation & aSimulation)
inline

Called when the event is added to the event queue of the specified simulation.

◆ Execute()

virtual EventDisposition WsfEvent::Execute ( )
pure virtual

Execute the specified event.

Returns
The disposition of the event. This indicates to the event manager what should be done with the event. If cRESCHEDULE then Execute should have called SetTime to set the time for which the event manager should reschedule the event.

Implemented in ToolUpdateEvent, wsf::comm::ComponentHW::AltFrequencyChangeEvent, wsf::comm::Event, wsf::comm::GenericEvent< T >, wsf::comm::IGMP_SubscriptionEvent, wsf::comm::LayerEvent, wsf::cyber::Event, wsf::eventpipe::PartUpdateEvent, wsf::UCI_Message_Event, wsf::UCI_SetDefaultModeEvent, WsfArticulatedPartEvent, WsfBallisticMissileLaunchComputer::PurgeSolutionEvent, WsfBrawlerConsicousnessEvent, WsfEclipseReport::EclipseEvent, WsfImplicitWeapon::TerminateEngagementEvent, WsfJTIDS_SlotGroup::TransmitHeartbeatEvent, WsfLaserDesignations::UpdateEvent, WsfMobilityAndFirepowerLethality::UpdateEvent, WsfMoverUpdateEvent, WsfOneShotEvent, WsfPerceptionProcessorUpdateEvent, WsfPlatformPartEvent, WsfRecurringEvent, WsfRouteMover::UnpauseEvent, WsfScriptContext::ExecuteTimedEventScript, WsfScriptEvent, WsfSensor::ModeChangeEvent, WsfSensorMode::AltFrequencyChangeEvent, WsfSimulation::AddPlatformEvent, WsfTaskManager::EventBase, WsfTimeDelayQueue::CompleteRequestEvent, WsfTrackProcessor_PurgeTrackHistoryEvent, WsfTrackProcessor_PurgeTracksEvent, WsfTrackProcessor_ReportTracksEvent, WsfTrackStateController_RequestEvaluationEvent, WsfTSPI_Mover::InitializeMoverEvent, WsfWaypointMover::HitPointEvent, WsfWeapon::CompleteReloadEvent, WsfWeapon::SalvoEvent, WsfXIO_PlatformInfoService::EvaluateDeadReckoningEvent, WsfXIO_PlatformPartInfoService::UpdatePartEvent, WsfXIO_SimTimeService::UpdateEvent, XWsfAirTraffic::AirTrafficEvent, XWsfAirTraffic::ExitLoiterEvent, XWsfSeaTraffic::DepartureEvent, and XWsfSeaTraffic::ExitLoiterEvent.

◆ GetPriority()

int WsfEvent::GetPriority ( ) const
inline

Get the priority of the event, for correct execution of events occurring at the same discrete time.

Returns
The priority of the event.

◆ GetSimulation()

◆ GetTime()

double WsfEvent::GetTime ( ) const
inline

Get the time at which the event is to execute

Returns
The simulation time at which the event should execute.

Referenced by WsfFrameStepSimulation::AdvanceFrame(), WsfSimulation::AdvanceTime(), WsfSimulation::AdvanceTime(), WsfXIO_PlatformInfoService::EvaluateDeadReckoningEvent::CopyState(), ToolUpdateEvent::Execute(), wsf::comm::ComponentHW::AltFrequencyChangeEvent::Execute(), wsf::comm::Event::Execute(), wsf::comm::IGMP_SubscriptionEvent::Execute(), wsf::comm::LayerEvent::Execute(), wsf::eventpipe::PartUpdateEvent::Execute(), wsf::UCI_Message_Event::Execute(), wsf::UCI_SetDefaultModeEvent::Execute(), WsfArticulatedPartEvent::Execute(), WsfBallisticMissileLaunchComputer::PurgeSolutionEvent::Execute(), WsfBrawlerConsicousnessEvent::Execute(), WsfEclipseReport::EclipseEvent::Execute(), WsfImplicitWeapon::TerminateEngagementEvent::Execute(), WsfJTIDS_SlotGroup::TransmitHeartbeatEvent::Execute(), WsfLaserDesignations::UpdateEvent::Execute(), WsfMobilityAndFirepowerLethality::UpdateEvent::Execute(), WsfMoverUpdateEvent::Execute(), WsfPerceptionProcessorUpdateEvent::Execute(), WsfPlatformPartEvent::Execute(), WsfRouteMover::UnpauseEvent::Execute(), WsfScriptContext::ExecuteTimedEventScript::Execute(), WsfScriptEvent::Execute(), WsfSensor::ModeChangeEvent::Execute(), WsfSensorMode::AltFrequencyChangeEvent::Execute(), WsfTimeDelayQueue::CompleteRequestEvent::Execute(), WsfTrackProcessor_PurgeTrackHistoryEvent::Execute(), WsfTrackProcessor_PurgeTracksEvent::Execute(), WsfTrackProcessor_ReportTracksEvent::Execute(), WsfTrackStateController_RequestEvaluationEvent::Execute(), WsfTSPI_Mover::InitializeMoverEvent::Execute(), WsfWaypointMover::HitPointEvent::Execute(), WsfWeapon::CompleteReloadEvent::Execute(), WsfWeapon::SalvoEvent::Execute(), WsfXIO_PlatformInfoService::EvaluateDeadReckoningEvent::Execute(), WsfXIO_PlatformPartInfoService::UpdatePartEvent::Execute(), WsfXIO_SimTimeService::UpdateEvent::Execute(), XWsfAirTraffic::AirTrafficEvent::Execute(), XWsfAirTraffic::ExitLoiterEvent::Execute(), XWsfSeaTraffic::DepartureEvent::Execute(), XWsfSeaTraffic::ExitLoiterEvent::Execute(), WsfTaskManager::TaskCompleteEvent::ExecuteEvent(), WsfTaskManager::TrackUpdateEvent::ExecuteEvent(), WsfSimulation::GetNextEventTime(), WsfXIO_SimTimeService::HandleClockRateChange(), WsfXIO_PlatformInfoService::EvaluateDeadReckoningEvent::SendState(), and WsfEventStepSimulation::WaitForAdvanceTime().

◆ operator=()

WsfEvent & WsfEvent::operator= ( const WsfEvent & aRhs)
delete

References WsfEvent().

◆ SetPriority()

void WsfEvent::SetPriority ( int aPriority)
inline

Set the priority for correct order of execution of events at the same discrete time.

Parameters
aPriorityThe priority of the event.
Note
Priority is used to order events that occur at the same time in the event manager, and ordering is only enforced at the time the event is added. Changing priority after AddEvent() is called will not affect the order of execution of events. Changing priority will be enforced if an event is rescheduled after the resolution of Execute().

◆ SetShouldExecute()

void WsfEvent::SetShouldExecute ( bool aExecute)
inline

Sets whether or not this event should be executed, allowing an event to be effectively canceled.

Parameters
aExecuteIf this event should be executed.

◆ SetTime()

void WsfEvent::SetTime ( double aSimTime)
inline

Set the time at which the event is to execute.

Parameters
aSimTimeThe time at which the event is to execute.
Note
This method should NEVER be called when the event is on the event queue as it will not get re-queued at the correct time.

Referenced by WsfXIO_PlatformInfoService::EvaluateDeadReckoningEvent::EvaluateDeadReckoningEvent(), ToolUpdateEvent::Execute(), wsf::eventpipe::PartUpdateEvent::Execute(), wsf::UCI_Message_Event::Execute(), WsfArticulatedPartEvent::Execute(), WsfBrawlerConsicousnessEvent::Execute(), WsfEclipseReport::EclipseEvent::Execute(), WsfJTIDS_SlotGroup::TransmitHeartbeatEvent::Execute(), WsfLaserDesignations::UpdateEvent::Execute(), WsfMobilityAndFirepowerLethality::UpdateEvent::Execute(), WsfMoverUpdateEvent::Execute(), WsfPerceptionProcessorUpdateEvent::Execute(), WsfPlatformPartEvent::Execute(), WsfScriptContext::ExecuteTimedEventScript::Execute(), WsfTimeDelayQueue::CompleteRequestEvent::Execute(), WsfTrackProcessor_PurgeTrackHistoryEvent::Execute(), WsfTrackProcessor_PurgeTracksEvent::Execute(), WsfTrackProcessor_ReportTracksEvent::Execute(), WsfXIO_PlatformInfoService::EvaluateDeadReckoningEvent::Execute(), WsfXIO_PlatformPartInfoService::UpdatePartEvent::Execute(), WsfXIO_SimTimeService::UpdateEvent::Execute(), XWsfAirTraffic::AirTrafficEvent::Execute(), WsfTaskManager::TrackUpdateEvent::ExecuteEvent(), WsfXIO_PlatformInfoService::HandleRequest(), WsfXIO_SimTimeService::HandleRequest(), WsfScriptEvent::WsfScriptEvent(), WsfScriptEvent::WsfScriptEvent(), WsfScriptEvent::WsfScriptEvent(), and WsfTrackProcessor_PurgeTracksEvent::WsfTrackProcessor_PurgeTracksEvent().

◆ ShouldExecute()

bool WsfEvent::ShouldExecute ( ) const
inline

Provides whether or not this event should be processed during simulation event execution.

Returns
A boolean indicating if this event should be executed.

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