DebugObserverComponentPlugin.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @package ArmarXGui::ArmarXObjects::ArmarXGuiComponentPlugins
17  * @author Raphael Grimm ( raphael dot grimm at kit dot edu )
18  * @date 2019
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <utility> // for std::forward
26 
29 
31 
32 
33 namespace armarx::plugins
34 {
35  /**
36  * @defgroup Library-ArmarXCoreComponentPlugins ArmarXCoreComponentPlugins
37  * @ingroup ArmarXGui
38  * A description of the library ArmarXCoreComponentPlugins.
39  */
40 
41  /**
42  * @class DebugObserverComponentPlugin
43  * @ingroup Library-ArmarXCoreComponentPlugins
44  * @brief Brief description of class DebugObserverComponentPlugin.
45  *
46  * Detailed description of class DebugObserverComponentPlugin.
47  */
49  public ComponentPlugin,
50  public DebugObserverHelper
51  {
52  public:
53 
54  using ComponentPlugin::ComponentPlugin;
55 
56  void setDebugObserverTopic(const std::string& name);
57  std::string getDebugObserverTopic();
58 
59 
60  protected:
61 
62  void preOnInitComponent() override;
63  void postOnInitComponent() override;
64  void preOnConnectComponent() override;
65 
66  void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
67 
68 
69  private:
70 
71  static constexpr auto _propertyName = "DebugObserverTopicName";
72  std::string _topicName;
73 
74  };
75 }
76 
77 
79 
80 namespace armarx
81 {
83  {
84  public:
85 
87 
88 
89  public:
90 
92 
94 
95 
96  template<class...Ts>
97  void setDebugObserverDatafield(Ts&& ...ts) const
98  {
99  _debugObserverComponentPlugin->setDebugObserverDatafield(std::forward<Ts>(ts)...);
100  }
101 
102  void setDebugObserverChannel(const std::string& channelName, StringVariantBaseMap valueMap) const;
103  void removeDebugObserverChannel(const std::string& channelname) const;
104  void removeDebugObserverDatafield(const std::string& channelName, const std::string& datafieldName) const;
105  void removeAllDebugObserverChannels() const;
106 
108 
109  void setDebugObserverBatchModeEnabled(bool enable);
110  void sendDebugObserverBatch();
111 
112 
113  private:
114 
115  DebugObserverComponentPlugin* _debugObserverComponentPlugin{nullptr};
116 
117  };
118 }
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:111
armarx::DebugObserverComponentPluginUser::getDebugObserverComponentPlugin
plugins::DebugObserverComponentPlugin & getDebugObserverComponentPlugin()
Definition: DebugObserverComponentPlugin.cpp:85
armarx::DebugObserverComponentPluginUser::setDebugObserverBatchModeEnabled
void setDebugObserverBatchModeEnabled(bool enable)
Definition: DebugObserverComponentPlugin.cpp:118
armarx::plugins::DebugObserverComponentPlugin::postOnInitComponent
void postOnInitComponent() override
Definition: DebugObserverComponentPlugin.cpp:51
armarx::plugins::DebugObserverComponentPlugin::setDebugObserverTopic
void setDebugObserverTopic(const std::string &name)
Definition: DebugObserverComponentPlugin.cpp:30
armarx::DebugObserverComponentPluginUser::setDebugObserverChannel
void setDebugObserverChannel(const std::string &channelName, StringVariantBaseMap valueMap) const
Definition: DebugObserverComponentPlugin.cpp:90
TemplateMetaProgramming.h
armarx::plugins::DebugObserverComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: DebugObserverComponentPlugin.cpp:42
armarx::DebugObserverComponentPluginUser::getDebugObserver
const DebugObserverInterfacePrx & getDebugObserver() const
Definition: DebugObserverComponentPlugin.cpp:113
armarx::DebugObserverComponentPluginUser::DebugObserverComponentPluginUser
DebugObserverComponentPluginUser()
Definition: DebugObserverComponentPlugin.cpp:80
armarx::DebugObserverComponentPluginUser::removeDebugObserverDatafield
void removeDebugObserverDatafield(const std::string &channelName, const std::string &datafieldName) const
Definition: DebugObserverComponentPlugin.cpp:101
armarx::plugins::DebugObserverComponentPlugin::getDebugObserverTopic
std::string getDebugObserverTopic()
Definition: DebugObserverComponentPlugin.cpp:37
armarx::DebugObserverComponentPluginUser::removeAllDebugObserverChannels
void removeAllDebugObserverChannels() const
Definition: DebugObserverComponentPlugin.cpp:108
ManagedIceObject.h
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:28
armarx::ComponentPlugin
Definition: ComponentPlugin.h:38
armarx::DebugObserverComponentPluginUser::DebugObserverComponentPlugin
armarx::plugins::DebugObserverComponentPlugin DebugObserverComponentPlugin
Definition: DebugObserverComponentPlugin.h:86
armarx::plugins::DebugObserverComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: DebugObserverComponentPlugin.cpp:56
DebugObserverHelper.h
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:163
armarx::DebugObserverHelper::setDebugObserverDatafield
void setDebugObserverDatafield(const std::string &channelName, const std::string &datafieldName, const TimedVariantPtr &value) const
Definition: DebugObserverHelper.cpp:74
armarx::DebugObserverComponentPluginUser::sendDebugObserverBatch
void sendDebugObserverBatch()
Definition: DebugObserverComponentPlugin.cpp:122
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::DebugObserverComponentPluginUser
Definition: DebugObserverComponentPlugin.h:82
ComponentPlugin.h
armarx::plugins::DebugObserverComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: DebugObserverComponentPlugin.cpp:66
armarx::DebugObserverComponentPluginUser::removeDebugObserverChannel
void removeDebugObserverChannel(const std::string &channelname) const
Definition: DebugObserverComponentPlugin.cpp:96
armarx::plugins::DebugObserverComponentPlugin
Brief description of class DebugObserverComponentPlugin.
Definition: DebugObserverComponentPlugin.h:48
armarx::DebugObserverHelper
Brief description of class DebugObserverHelper.
Definition: DebugObserverHelper.h:50
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::DebugObserverComponentPluginUser::setDebugObserverDatafield
void setDebugObserverDatafield(Ts &&...ts) const
Definition: DebugObserverComponentPlugin.h:97