SMACC
Loading...
Searching...
No Matches
sr_all_events_go.cpp
Go to the documentation of this file.
1
3#include <smacc/common.h>
4
5namespace smacc
6{
7namespace state_reactors
8{
9
10using namespace smacc::introspection;
12{
13 for (auto type : eventTypes)
14 {
15 triggeredEvents[type] = false;
16 }
17}
18
19void SrAllEventsGo::onEventNotified(const std::type_info *eventType)
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}
29
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}
41} // namespace state_reactors
42} // namespace smacc
std::vector< const std::type_info * > eventTypes
std::map< const std::type_info *, bool > triggeredEvents
virtual void onEventNotified(const std::type_info *eventType) override
std::string demangleSymbol()
Definition: introspection.h:75