ManagedIceObjectPlugin.cpp
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* Copyright (C) 2011-2021, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5*
6* ArmarX is free software; you can redistribute it and/or modify
7* it under the terms of the GNU General Public License version 2 as
8* published by the Free Software Foundation.
9*
10* ArmarX is distributed in the hope that it will be useful, but
11* WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17*
18* @package ArmarXCore::core
19* @author Raphael Grimm (raphael dot grimm at kit dot edu)
20* @author Rainer Kartmann (rainer dot kartmann at kit dot edu)
21* @date 2021
22* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
23* GNU General Public License
24*/
25
27
28#include <experimental/memory>
29
32
33namespace armarx
34{
35
37 _parent{&parent}, _prefix{pre}
38 {
39 }
40
41 void
43 {
44 ARMARX_CHECK_NOT_NULL(dependedOn);
45 _dependsOn.emplace_back(dependedOn);
46 }
47
48 void
54
55 std::string
57 {
58 if (_prefix.empty())
59 {
60 return name;
61 }
62 return _prefix + '_' + name;
63 }
64
65 const std::string&
67 {
68 return _prefix;
69 }
70
73 {
74 return *_parent;
75 }
76
77 const ManagedIceObject&
79 {
80 return *_parent;
81 }
82
83 std::unique_ptr<ManagedIceObjectPlugin>&
84 ManagedIceObjectPlugin::getPlugin(const std::type_info& typeInfo, const std::string prefix)
85 {
86 return parent().getPluginPointer(typeInfo, prefix);
87 }
88
89 void
90 ManagedIceObjectPlugin::checkOutParameter(void* targ)
91 {
92 ARMARX_CHECK_NULL(targ) << "This is an out parameter";
93 }
94
95} // namespace armarx
#define ARMARX_CHECK_NULL(ptr)
void addPluginDependency(ManagedIceObjectPlugin *dependedOn)
std::string makePropertyName(const std::string &name)
const std::string & prefix() const
ManagedIceObjectPlugin(ManagedIceObject &parent, std::string pre)
The ManagedIceObject is the base class for all ArmarX objects.
std::unique_ptr< ManagedIceObjectPlugin > & getPluginPointer(std::type_info const &type, std::string const &prefix)
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
This file offers overloads of toIce() and fromIce() functions for STL container types.