SMACC
Loading...
Searching...
No Matches
reflection.cpp
Go to the documentation of this file.
2#include <ros/ros.h>
3
4namespace smacc
5{
6
7namespace introspection
8{
9void transitionInfoToMsg(const SmaccTransitionInfo &transition, smacc_msgs::SmaccTransition &transitionMsg)
10{
11 transitionMsg.index = transition.index;
12 transitionMsg.event.event_type = transition.eventInfo->getEventTypeName();
13
14 transitionMsg.source_state_name = transition.sourceState->demangledStateName;
15
16 transitionMsg.transition_name = transition.transitionTag;
17 transitionMsg.transition_type = transition.transitionType;
18 transitionMsg.event.event_source = transition.eventInfo->getEventSourceName();
19 transitionMsg.event.event_object_tag = transition.eventInfo->getOrthogonalName();
20 transitionMsg.event.label = transition.eventInfo->label;
21 transitionMsg.history_node = transition.historyNode;
22
23 if (transition.historyNode)
24 {
25 if (transition.destinyState->parentState_ != nullptr)
26 transitionMsg.destiny_state_name = transition.destinyState->parentState_->demangledStateName;
27 else
28 transitionMsg.destiny_state_name = "";
29 }
30 else
31 {
32 transitionMsg.destiny_state_name = transition.destinyState->demangledStateName;
33 }
34}
35} // namespace introspection
36} // namespace smacc
void transitionInfoToMsg(const SmaccTransitionInfo &transition, smacc_msgs::SmaccTransition &transitionMsg)
Definition: reflection.cpp:9
std::shared_ptr< SmaccStateInfo > destinyState
std::shared_ptr< SmaccEventInfo > eventInfo
std::shared_ptr< SmaccStateInfo > sourceState