WSF
WsfEventAdapterT< RT, Args > Class Template Reference

#include <WsfEvent.hpp>

Inheritance diagram for WsfEventAdapterT< RT, Args >:
Collaboration diagram for WsfEventAdapterT< RT, Args >:

Protected Types

using ExecuteFn = std::function<RT(Args...)>

Protected Member Functions

 WsfEventAdapterT (double aSimTime, const ExecuteFn &aExecuteFn)
 ~WsfEventAdapterT () override=default

Protected Attributes

ExecuteFn mExecuteFn

Additional Inherited Members

Public Types inherited from WsfEvent
enum  EventDisposition { cDELETE , cRESCHEDULE }
Public Member Functions inherited from WsfEvent
 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

template<typename RT, typename... Args>
class WsfEventAdapterT< RT, Args >

A class template that adapts the interface for WsfEvent to provide clients with a convenient way to create an event by simply passing a std::function to the constructor. Sub-classed below for "one-shot" and recurring events.

Member Typedef Documentation

◆ ExecuteFn

template<typename RT, typename... Args>
using WsfEventAdapterT< RT, Args >::ExecuteFn = std::function<RT(Args...)>
protected

Constructor & Destructor Documentation

◆ WsfEventAdapterT()

template<typename RT, typename... Args>
WsfEventAdapterT< RT, Args >::WsfEventAdapterT ( double aSimTime,
const ExecuteFn & aExecuteFn )
inlineprotected

References mExecuteFn, and WsfEvent::WsfEvent().

◆ ~WsfEventAdapterT()

template<typename RT, typename... Args>
WsfEventAdapterT< RT, Args >::~WsfEventAdapterT ( )
overrideprotecteddefault

Member Data Documentation

◆ mExecuteFn

template<typename RT, typename... Args>
ExecuteFn WsfEventAdapterT< RT, Args >::mExecuteFn
protected

Referenced by WsfEventAdapterT().


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