StatechartListener.cpp
Go to the documentation of this file.
2
3namespace armarx
4{
5 void
6 StatechartListener::setName(const std::string& name)
7 {
9 }
10
11 void
12 StatechartListener::setTopicName(const std::string& name)
13 {
14 this->topicName = name;
15 }
16
17 std::string
19 {
20 return topicName;
21 }
22
24
25 std::string
27 {
28 return "StatechartListener";
29 }
30
31 void
33 {
34 ARMARX_INFO << getName() << "::" << __FUNCTION__ << "()";
35 usingTopic(topicName);
36 }
37
38 void
40 {
41 ARMARX_INFO << getName() << "::" << __FUNCTION__ << "()";
42 }
43
44 void
46 {
47 callbacks.push_back(callback);
48 }
49
50 void
51 StatechartListener::publish(const std::vector<Transition>& message)
52 {
53 for (Callback& callback : callbacks)
54 {
55 callback(message, *this);
56 }
57 }
58
59 void
61 const ProfilerStatechartTransitionWithParameters& transition,
62 const Ice::Current&)
63 {
64 publish({transition});
65 }
66
67 void
69 const ProfilerStatechartTransitionWithParametersList& transitions,
70 const Ice::Current&)
71 {
72 publish(transitions);
73 }
74} // namespace armarx
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
std::string getName() const
Retrieve name of object.
void setName(std::string name)
Override name of well-known object.
void onInitComponent() override
Pure virtual hook for the subclass.
void registerCallback(const Callback &callback)
void reportStatechartTransitionWithParameters(const ProfilerStatechartTransitionWithParameters &, const Ice::Current &) override
std::function< void(const std::vector< StatechartListener::Transition > &transitions, StatechartListener &source)> Callback
void setName(const std::string &name)
void onConnectComponent() override
Pure virtual hook for the subclass.
void setTopicName(const std::string &topicName)
void reportStatechartTransitionWithParametersList(const ProfilerStatechartTransitionWithParametersList &, const Ice::Current &) override
std::string getDefaultName() const override
#define ARMARX_INFO
The normal logging level.
Definition Logging.h:181
This file offers overloads of toIce() and fromIce() functions for STL container types.