SMACC
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | List of all members
smacc::state_reactors::Srsr_conditional Class Reference

#include <sr_conditional.h>

Inheritance diagram for smacc::state_reactors::Srsr_conditional:
Inheritance graph
Collaboration diagram for smacc::state_reactors::Srsr_conditional:
Collaboration graph

Public Member Functions

template<typename TEv >
 Srsr_conditional (std::function< bool(TEv *)> sr_conditionalFunction)
 
 ~Srsr_conditional ()
 
virtual bool triggers () override
 
- Public Member Functions inherited from smacc::StateReactor
 StateReactor ()
 
virtual void onInitialized ()
 
virtual void onEntry ()
 
virtual void onExit ()
 
virtual void onEventNotified (const std::type_info *eventType)
 
template<typename EventType >
void postEvent (const EventType &ev)
 
template<typename EventType >
void postEvent ()
 
template<typename T , typename TClass >
void createEventCallback (void(TClass::*callback)(T *), TClass *object)
 
template<typename T >
void createEventCallback (std::function< void(T *)> callback)
 
void update ()
 
virtual bool triggers ()=0
 
template<typename TEv >
void addInputEvent ()
 
template<typename TEv >
void setOutputEvent ()
 
void initialize (ISmaccState *ownerState)
 

Private Attributes

std::map< const std::type_info *, booltriggeredEvents
 
bool conditionFlag
 

Additional Inherited Members

- Public Attributes inherited from smacc::StateReactor
ISmaccStateownerState
 
std::function< void()> postEventFn
 
std::vector< const std::type_info * > eventTypes
 
std::map< const std::type_info *, std::function< void(void *)> > eventCallbacks_
 

Detailed Description

Definition at line 18 of file sr_conditional.h.

Constructor & Destructor Documentation

◆ Srsr_conditional()

template<typename TEv >
smacc::state_reactors::Srsr_conditional::Srsr_conditional ( std::function< bool(TEv *)>  sr_conditionalFunction)
inline

Definition at line 26 of file sr_conditional.h.

27 {
28 std::function<void(TEv *)> callback =
29 [=](TEv *ev) {
30 bool condition = sr_conditionalFunction(ev);
31 this->conditionFlag = condition;
32 };
33
34 this->createEventCallback(callback);
35 }
void createEventCallback(void(TClass::*callback)(T *), TClass *object)

References smacc::StateReactor::createEventCallback().

Here is the call graph for this function:

◆ ~Srsr_conditional()

smacc::state_reactors::Srsr_conditional::~Srsr_conditional ( )

Definition at line 7 of file sr_conditional.cpp.

8{
9}

Member Function Documentation

◆ triggers()

bool smacc::state_reactors::Srsr_conditional::triggers ( )
overridevirtual

Implements smacc::StateReactor.

Definition at line 11 of file sr_conditional.cpp.

12{
13 return this->conditionFlag;
14}

References conditionFlag.

Member Data Documentation

◆ conditionFlag

bool smacc::state_reactors::Srsr_conditional::conditionFlag
private

Definition at line 22 of file sr_conditional.h.

Referenced by triggers().

◆ triggeredEvents

std::map<const std::type_info *, bool> smacc::state_reactors::Srsr_conditional::triggeredEvents
private

Definition at line 21 of file sr_conditional.h.


The documentation for this class was generated from the following files: