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

#include <sr_all_events_go.h>

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

Public Member Functions

 SrAllEventsGo ()
 
virtual void onInitialized () override
 
virtual void onEventNotified (const std::type_info *eventType) override
 
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
 

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_all_events_go.h.

Constructor & Destructor Documentation

◆ SrAllEventsGo()

smacc::state_reactors::SrAllEventsGo::SrAllEventsGo ( )
inline

Definition at line 23 of file sr_all_events_go.h.

24 {
25 }

Member Function Documentation

◆ onEventNotified()

void smacc::state_reactors::SrAllEventsGo::onEventNotified ( const std::type_info *  eventType)
overridevirtual

Reimplemented from smacc::StateReactor.

Definition at line 19 of file sr_all_events_go.cpp.

20{
21 ROS_INFO_STREAM("SB ALL RECEIVED EVENT OF TYPE:" << demangleSymbol(eventType->name()));
22 triggeredEvents[eventType] = true;
23
24 for (auto &entry : triggeredEvents)
25 {
26 ROS_INFO_STREAM(demangleSymbol(entry.first->name()) << " = " << entry.second);
27 }
28}
std::map< const std::type_info *, bool > triggeredEvents
std::string demangleSymbol()
Definition: introspection.h:75

References smacc::introspection::demangleSymbol(), and triggeredEvents.

Here is the call graph for this function:

◆ onInitialized()

void smacc::state_reactors::SrAllEventsGo::onInitialized ( )
overridevirtual

Reimplemented from smacc::StateReactor.

Definition at line 11 of file sr_all_events_go.cpp.

12{
13 for (auto type : eventTypes)
14 {
15 triggeredEvents[type] = false;
16 }
17}
std::vector< const std::type_info * > eventTypes

References smacc::StateReactor::eventTypes, and triggeredEvents.

◆ triggers()

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

Implements smacc::StateReactor.

Definition at line 30 of file sr_all_events_go.cpp.

31{
32 ROS_INFO("SB All TRIGGERS?");
33 for (auto &entry : triggeredEvents)
34 {
35 if (!entry.second)
36 return false;
37 }
38 ROS_INFO("SB ALL TRIGGERED");
39 return true;
40}

References triggeredEvents.

Member Data Documentation

◆ triggeredEvents

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

Definition at line 20 of file sr_all_events_go.h.

Referenced by onEventNotified(), onInitialized(), and triggers().


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