StatechartListener.h
Go to the documentation of this file.
1 #pragma once
2 
3 
5 
6 #include <ArmarXCore/interface/core/Profiler.h>
8 
9 
10 namespace armarx
11 {
13  virtual public armarx::Component
14  , virtual public armarx::ProfilerListener
15  {
16  public:
17  using Transition = armarx::ProfilerStatechartTransitionWithParameters;
18  using Callback = std::function<void(const std::vector<StatechartListener::Transition>& transitions, StatechartListener& source)>;
19 
20  public:
21  ~StatechartListener() override;
22 
23  void setTopicName(const std::string& topicName);
24  std::string getTopicName() const;
25 
26  void setName(const std::string& name);
27  void registerCallback(const Callback& callback);
28 
29  /// @see armarx::ManagedIceObject::getDefaultName()
30  std::string getDefaultName() const override;
31 
32  protected:
33  void onInitComponent() override;
34  void onConnectComponent() override;
35 
36  // ProfilerListener interface
37  public:
38  void reportStatechartTransitionWithParameters(const ProfilerStatechartTransitionWithParameters&, const Ice::Current&) override;
39  void reportStatechartTransitionWithParametersList(const ProfilerStatechartTransitionWithParametersList&, const Ice::Current&) override;
40 
41  void reportNetworkTraffic(const std::string&, const std::string&, Ice::Int, Ice::Int, const Ice::Current&) override {}
42  void reportEvent(const ProfilerEvent&, const Ice::Current&) override {}
43  void reportStatechartTransition(const ProfilerStatechartTransition& event, const Ice::Current&) override {}
44  void reportStatechartInputParameters(const ProfilerStatechartParameters& event, const Ice::Current&) override {}
45  void reportStatechartLocalParameters(const ProfilerStatechartParameters& event, const Ice::Current&) override {}
46  void reportStatechartOutputParameters(const ProfilerStatechartParameters&, const Ice::Current&) override {}
47  void reportProcessCpuUsage(const ProfilerProcessCpuUsage&, const Ice::Current&) override {}
48  void reportProcessMemoryUsage(const ProfilerProcessMemoryUsage&, const Ice::Current&) override {}
49 
50  void reportEventList(const ProfilerEventList& events, const Ice::Current&) override {}
51  void reportStatechartTransitionList(const ProfilerStatechartTransitionList&, const Ice::Current&) override {}
52  void reportStatechartInputParametersList(const ProfilerStatechartParametersList& data, const Ice::Current&) override {}
53  void reportStatechartLocalParametersList(const ProfilerStatechartParametersList&, const Ice::Current&) override {}
54  void reportStatechartOutputParametersList(const ProfilerStatechartParametersList&, const Ice::Current&) override {}
55  void reportProcessCpuUsageList(const ProfilerProcessCpuUsageList&, const Ice::Current&) override {}
56  void reportProcessMemoryUsageList(const ProfilerProcessMemoryUsageList&, const Ice::Current&) override {}
57 
58 
59  private:
60  std::string topicName;
61 
62  std::vector<Callback> callbacks;
63  void publish(const std::vector<Transition>& message);
64  };
65 }
armarx::StatechartListener
Definition: StatechartListener.h:12
armarx::StatechartListener::reportProcessCpuUsageList
void reportProcessCpuUsageList(const ProfilerProcessCpuUsageList &, const Ice::Current &) override
Definition: StatechartListener.h:55
armarx::StatechartListener::reportStatechartTransitionWithParametersList
void reportStatechartTransitionWithParametersList(const ProfilerStatechartTransitionWithParametersList &, const Ice::Current &) override
Definition: StatechartListener.cpp:58
armarx::StatechartListener::reportStatechartTransitionList
void reportStatechartTransitionList(const ProfilerStatechartTransitionList &, const Ice::Current &) override
Definition: StatechartListener.h:51
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::reportEventList
void reportEventList(const ProfilerEventList &events, const Ice::Current &) override
Definition: StatechartListener.h:50
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
ObserverObjectFactories.h
armarx::StatechartListener::Callback
std::function< void(const std::vector< StatechartListener::Transition > &transitions, StatechartListener &source)> Callback
Definition: StatechartListener.h:18
armarx::StatechartListener::reportStatechartOutputParametersList
void reportStatechartOutputParametersList(const ProfilerStatechartParametersList &, const Ice::Current &) override
Definition: StatechartListener.h:54
data
uint8_t data[1]
Definition: EtherCATFrame.h:68
armarx::StatechartListener::reportProcessCpuUsage
void reportProcessCpuUsage(const ProfilerProcessCpuUsage &, const Ice::Current &) override
Definition: StatechartListener.h:47
armarx::StatechartListener::reportStatechartInputParametersList
void reportStatechartInputParametersList(const ProfilerStatechartParametersList &data, const Ice::Current &) override
Definition: StatechartListener.h:52
armarx::StatechartListener::reportStatechartInputParameters
void reportStatechartInputParameters(const ProfilerStatechartParameters &event, const Ice::Current &) override
Definition: StatechartListener.h:44
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::reportProcessMemoryUsage
void reportProcessMemoryUsage(const ProfilerProcessMemoryUsage &, const Ice::Current &) override
Definition: StatechartListener.h:48
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::StatechartListener::reportStatechartLocalParameters
void reportStatechartLocalParameters(const ProfilerStatechartParameters &event, const Ice::Current &) override
Definition: StatechartListener.h:45
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::StatechartListener::reportStatechartLocalParametersList
void reportStatechartLocalParametersList(const ProfilerStatechartParametersList &, const Ice::Current &) override
Definition: StatechartListener.h:53
armarx::StatechartListener::reportStatechartOutputParameters
void reportStatechartOutputParameters(const ProfilerStatechartParameters &, const Ice::Current &) override
Definition: StatechartListener.h:46
armarx::StatechartListener::reportNetworkTraffic
void reportNetworkTraffic(const std::string &, const std::string &, Ice::Int, Ice::Int, const Ice::Current &) override
Definition: StatechartListener.h:41
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:916
armarx::StatechartListener::reportStatechartTransition
void reportStatechartTransition(const ProfilerStatechartTransition &event, const Ice::Current &) override
Definition: StatechartListener.h:43
armarx::StatechartListener::reportProcessMemoryUsageList
void reportProcessMemoryUsageList(const ProfilerProcessMemoryUsageList &, const Ice::Current &) override
Definition: StatechartListener.h:56
armarx::StatechartListener::reportEvent
void reportEvent(const ProfilerEvent &, const Ice::Current &) override
Definition: StatechartListener.h:42
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::StatechartListener::Transition
armarx::ProfilerStatechartTransitionWithParameters Transition
Definition: StatechartListener.h:17