StatechartListener.cpp
Go to the documentation of this file.
1 #include "StatechartListener.h"
2 
3 
4 namespace armarx
5 {
6  void StatechartListener::setName(const std::string& name)
7  {
9  }
10 
11  void StatechartListener::setTopicName(const std::string& name)
12  {
13  this->topicName = name;
14  }
15 
17  {
18  return topicName;
19  }
20 
22 
24  {
25  return "StatechartListener";
26  }
27 
29  {
30  ARMARX_INFO << getName() << "::" << __FUNCTION__ << "()";
31  usingTopic(topicName);
32  }
34  {
35  ARMARX_INFO << getName() << "::" << __FUNCTION__ << "()";
36  }
37 
39  {
40  callbacks.push_back(callback);
41  }
42 
43  void StatechartListener::publish(const std::vector<Transition>& message)
44  {
45  for (Callback& callback : callbacks)
46  {
47  callback(message, *this);
48  }
49  }
50 
51  void
52  StatechartListener::reportStatechartTransitionWithParameters(const ProfilerStatechartTransitionWithParameters& transition,
53  const Ice::Current&)
54  {
55  publish({transition});
56  }
57 
59  const ProfilerStatechartTransitionWithParametersList& transitions, const Ice::Current&)
60  {
61  publish(transitions);
62  }
63 }
armarx::ManagedIceObject::setName
void setName(std::string name)
Override name of well-known object.
Definition: ManagedIceObject.cpp:426
armarx::StatechartListener::reportStatechartTransitionWithParametersList
void reportStatechartTransitionWithParametersList(const ProfilerStatechartTransitionWithParametersList &, const Ice::Current &) override
Definition: StatechartListener.cpp:58
armarx::StatechartListener::registerCallback
void registerCallback(const Callback &callback)
Definition: StatechartListener.cpp:38
message
message(STATUS "Boost-Library-Dir: " "${Boost_LIBRARY_DIRS}") message(STATUS "Boost-LIBRARIES
Definition: CMakeLists.txt:8
armarx::StatechartListener::~StatechartListener
~StatechartListener() override
armarx::StatechartListener::setName
void setName(const std::string &name)
Definition: StatechartListener.cpp:6
armarx::StatechartListener::setTopicName
void setTopicName(const std::string &topicName)
Definition: StatechartListener.cpp:11
armarx::StatechartListener::reportStatechartTransitionWithParameters
void reportStatechartTransitionWithParameters(const ProfilerStatechartTransitionWithParameters &, const Ice::Current &) override
Definition: StatechartListener.cpp:52
armarx::StatechartListener::Callback
std::function< void(const std::vector< StatechartListener::Transition > &transitions, StatechartListener &source)> Callback
Definition: StatechartListener.h:18
armarx::StatechartListener::getDefaultName
std::string getDefaultName() const override
Definition: StatechartListener.cpp:23
armarx::StatechartListener::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: StatechartListener.cpp:33
armarx::StatechartListener::getTopicName
std::string getTopicName() const
Definition: StatechartListener.cpp:16
armarx::StatechartListener::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: StatechartListener.cpp:28
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
StatechartListener.h
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28