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 
30 
31 namespace armarx::plugins
32 {
33  /**
34  * @defgroup Library-ArmarXCoreComponentPlugins ArmarXCoreComponentPlugins
35  * @ingroup ArmarXGui
36  * A description of the library ArmarXCoreComponentPlugins.
37  */
38 
39  /**
40  * @class DebugObserverComponentPlugin
41  * @ingroup Library-ArmarXCoreComponentPlugins
42  * @brief Brief description of class DebugObserverComponentPlugin.
43  *
44  * Detailed description of class DebugObserverComponentPlugin.
45  */
47  {
48  public:
50 
51  void setDebugObserverTopic(const std::string& name);
52  std::string getDebugObserverTopic();
53 
54 
55  protected:
56  void preOnInitComponent() override;
57  void postOnInitComponent() override;
58  void preOnConnectComponent() override;
59 
60  void postCreatePropertyDefinitions(PropertyDefinitionsPtr& properties) override;
61 
62 
63  private:
64  static constexpr auto _propertyName = "DebugObserverTopicName";
65  std::string _topicName;
66  };
67 } // namespace armarx::plugins
68 
70 
71 namespace armarx
72 {
74  {
75  public:
77 
78 
79  public:
81 
83 
84  template <class... Ts>
85  void
86  setDebugObserverDatafield(Ts&&... ts) const
87  {
88  _debugObserverComponentPlugin->setDebugObserverDatafield(std::forward<Ts>(ts)...);
89  }
90 
91  void setDebugObserverChannel(const std::string& channelName,
92  StringVariantBaseMap valueMap) const;
93  void removeDebugObserverChannel(const std::string& channelname) const;
94  void removeDebugObserverDatafield(const std::string& channelName,
95  const std::string& datafieldName) const;
96  void removeAllDebugObserverChannels() const;
97 
99 
100  void setDebugObserverBatchModeEnabled(bool enable);
101  void sendDebugObserverBatch();
102 
103 
104  private:
105  DebugObserverComponentPlugin* _debugObserverComponentPlugin{nullptr};
106  };
107 } // namespace armarx
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:110
armarx::DebugObserverComponentPluginUser::getDebugObserverComponentPlugin
plugins::DebugObserverComponentPlugin & getDebugObserverComponentPlugin()
Definition: DebugObserverComponentPlugin.cpp:89
armarx::DebugObserverComponentPluginUser::setDebugObserverBatchModeEnabled
void setDebugObserverBatchModeEnabled(bool enable)
Definition: DebugObserverComponentPlugin.cpp:129
armarx::plugins::DebugObserverComponentPlugin::postOnInitComponent
void postOnInitComponent() override
Definition: DebugObserverComponentPlugin.cpp:54
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:95
armarx::DebugObserverComponentPluginUser::setDebugObserverDatafield
void setDebugObserverDatafield(Ts &&... ts) const
Definition: DebugObserverComponentPlugin.h:86
TemplateMetaProgramming.h
armarx::plugins::DebugObserverComponentPlugin::preOnInitComponent
void preOnInitComponent() override
Definition: DebugObserverComponentPlugin.cpp:44
armarx::DebugObserverComponentPluginUser::getDebugObserver
const DebugObserverInterfacePrx & getDebugObserver() const
Definition: DebugObserverComponentPlugin.cpp:123
armarx::DebugObserverComponentPluginUser::DebugObserverComponentPluginUser
DebugObserverComponentPluginUser()
Definition: DebugObserverComponentPlugin.cpp:83
armarx::DebugObserverComponentPluginUser::removeDebugObserverDatafield
void removeDebugObserverDatafield(const std::string &channelName, const std::string &datafieldName) const
Definition: DebugObserverComponentPlugin.cpp:109
armarx::plugins::DebugObserverComponentPlugin::getDebugObserverTopic
std::string getDebugObserverTopic()
Definition: DebugObserverComponentPlugin.cpp:38
armarx::DebugObserverComponentPluginUser::removeAllDebugObserverChannels
void removeAllDebugObserverChannels() const
Definition: DebugObserverComponentPlugin.cpp:117
ManagedIceObject.h
armarx::plugins
This file is part of ArmarX.
Definition: DebugObserverComponentPlugin.cpp:27
armarx::ComponentPlugin
Definition: ComponentPlugin.h:37
armarx::view_selection::ComponentPlugin
client::plugins::ComponentPlugin ComponentPlugin
Definition: ComponentPlugin.h:66
armarx::DebugObserverComponentPluginUser::DebugObserverComponentPlugin
armarx::plugins::DebugObserverComponentPlugin DebugObserverComponentPlugin
Definition: DebugObserverComponentPlugin.h:76
armarx::plugins::DebugObserverComponentPlugin::preOnConnectComponent
void preOnConnectComponent() override
Definition: DebugObserverComponentPlugin.cpp:60
DebugObserverHelper.h
armarx::ManagedIceObject
The ManagedIceObject is the base class for all ArmarX objects.
Definition: ManagedIceObject.h:162
armarx::DebugObserverHelper::setDebugObserverDatafield
void setDebugObserverDatafield(const std::string &channelName, const std::string &datafieldName, const TimedVariantPtr &value) const
Definition: DebugObserverHelper.cpp:83
armarx::DebugObserverComponentPluginUser::sendDebugObserverBatch
void sendDebugObserverBatch()
Definition: DebugObserverComponentPlugin.cpp:135
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugObserverInterface >
armarx::DebugObserverComponentPluginUser
Definition: DebugObserverComponentPlugin.h:73
ComponentPlugin.h
armarx::plugins::DebugObserverComponentPlugin::postCreatePropertyDefinitions
void postCreatePropertyDefinitions(PropertyDefinitionsPtr &properties) override
Definition: DebugObserverComponentPlugin.cpp:69
armarx::DebugObserverComponentPluginUser::removeDebugObserverChannel
void removeDebugObserverChannel(const std::string &channelname) const
Definition: DebugObserverComponentPlugin.cpp:102
armarx::plugins::DebugObserverComponentPlugin
Brief description of class DebugObserverComponentPlugin.
Definition: DebugObserverComponentPlugin.h:46
armarx::DebugObserverHelper
Brief description of class DebugObserverHelper.
Definition: DebugObserverHelper.h:51
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27