PropertyDefinitionVisitors.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 robdekon
17  * @author Christoph Pohl ( christoph dot pohl at kit dot edu )
18  * @date 06.09.22
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <experimental/memory>
26 
28 
30 
32 {
33 
35  {
36  public:
38  const std::string& global_namespace = "");
39 
40  void visitAronVariant(const data::IntPtr&, const type::IntEnumPtr&) override;
41 
42  void visitAronVariant(const data::IntPtr&, const type::IntPtr&) override;
43 
44  void visitAronVariant(const data::FloatPtr&, const type::FloatPtr&) override;
45 
46  void visitAronVariant(const data::DoublePtr&, const type::DoublePtr&) override;
47 
48  void visitAronVariant(const data::BoolPtr&, const type::BoolPtr&) override;
49 
50  void visitAronVariant(const data::StringPtr&, const type::StringPtr&) override;
51 
52  void visitAronVariant(const data::NDArrayPtr&, const type::QuaternionPtr&) override;
53 
54  void visitAronVariant(const data::NDArrayPtr&, const type::MatrixPtr&) override;
55 
56  void visitAronVariantOnEnter(const data::ListPtr&, const type::ListPtr&) override;
57 
58  void visitAronVariantOnExit(const data::ListPtr&, const type::ListPtr&) override;
59 
60  void visitAronVariantOnEnter(const data::DictPtr&, const type::DictPtr&) override;
61 
62  void visitAronVariantOnExit(const data::DictPtr&, const type::DictPtr&) override;
63 
64  void visitAronVariantOnEnter(const data::DictPtr& ptr,
65  const type::ObjectPtr& objectPtr) override;
66 
67  private:
69  std::string global_namespace_;
70  std::atomic<bool> in_list_{false};
71  };
72 
74  public aron::data::RecursiveTypedVisitor<data::VariantPtr, const type::VariantPtr>
75  {
76  public:
78  const std::string& global_namespace = "");
79 
81 
83 
85 
87 
89 
91 
92  void visitInt(DataInput& elementData, TypeInput& elementType) override;
93 
94  void visitFloat(DataInput& elementData, TypeInput& elementType) override;
95 
96  void visitDouble(DataInput& elementData, TypeInput& elementType) override;
97 
98  void visitBool(DataInput& elementData, TypeInput& elementType) override;
99 
100  void visitString(DataInput& elementData, TypeInput& elementType) override;
101 
102  void visitUnknown(DataInput& elementData, TypeInput& elementType) override;
103 
104  void visitQuaternion(DataInput& elementData, TypeInput& elementType) override;
105 
106  void visitMatrix(DataInput& elementData, TypeInput& elementType) override;
107 
108  void visitListOnEnter(DataInput& elementData, TypeInput& elementType) override;
109 
110  void visitListOnExit(DataInput& elementData, TypeInput& elementType) override;
111 
112  void visitDictOnEnter(DataInput& elementData, TypeInput& elementType) override;
113 
114  void visitDictOnExit(DataInput& elementData, TypeInput& elementType) override;
115 
116  void visitObjectOnEnter(DataInput& elementData, TypeInput& elementType) override;
117 
118  void visitIntEnum(DataInput& elementData, TypeInput& elementType) override;
119 
120  private:
122  std::string global_namespace_;
123  std::atomic<bool> in_list_;
124  };
125 
126 } // namespace armarx::aron::component_config
armarx::aron::type::MatrixPtr
std::shared_ptr< class Matrix > MatrixPtr
Definition: forward_declarations.h:20
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitListOnEnter
void visitListOnEnter(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:107
armarx::aron::component_config
Definition: PropertyDefinitionVisitors.cpp:50
armarx::aron::component_config::PropertyDefinitionGetterVisitor::getDescriptor
type::Descriptor getDescriptor(DataInput &o, TypeInput &t) override
Definition: PropertyDefinitionVisitors.cpp:241
armarx::aron::component_config::PropertyDefinitionSetterVisitor::visitAronVariant
void visitAronVariant(const data::IntPtr &, const type::IntEnumPtr &) override
Definition: PropertyDefinitionVisitors.cpp:338
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitInt
void visitInt(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:54
armarx::aron::component_config::PropertyDefinitionSetterVisitor::PropertyDefinitionSetterVisitor
PropertyDefinitionSetterVisitor(const armarx::PropertyDefinitionsPtr &defs, const std::string &global_namespace="")
Definition: PropertyDefinitionVisitors.cpp:284
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitMatrix
void visitMatrix(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:247
armarx::aron::component_config::PropertyDefinitionGetterVisitor
Definition: PropertyDefinitionVisitors.h:73
armarx::aron::component_config::PropertyDefinitionSetterVisitor
Definition: PropertyDefinitionVisitors.h:34
armarx::aron::component_config::PropertyDefinitionSetterVisitor::visitAronVariantOnEnter
void visitAronVariantOnEnter(const data::ListPtr &, const type::ListPtr &) override
Definition: PropertyDefinitionVisitors.cpp:348
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::MapElements
std::map< std::string, std::pair< DataInputNonConst, TypeInputNonConst > > MapElements
Definition: RecursiveVisitor.h:86
armarx::aron::data::NDArrayPtr
std::shared_ptr< NDArray > NDArrayPtr
Definition: NDArray.h:46
armarx::aron::data::DoublePtr
std::shared_ptr< Double > DoublePtr
Definition: forward_declarations.h:32
armarx::aron::component_config::PropertyDefinitionGetterVisitor::getPairElements
PairElements getPairElements(DataInput &o, TypeInput &t) override
Definition: PropertyDefinitionVisitors.cpp:229
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::PairElements
std::pair< std::pair< DataInputNonConst, TypeInputNonConst >, std::pair< DataInputNonConst, TypeInputNonConst > > PairElements
Definition: RecursiveVisitor.h:88
std::experimental::fundamentals_v2::observer_ptr
Definition: ManagedIceObject.h:53
armarx::aron::type::FloatPtr
std::shared_ptr< class Float > FloatPtr
Definition: forward_declarations.h:29
armarx::aron::component_config::PropertyDefinitionGetterVisitor::PropertyDefinitionGetterVisitor
PropertyDefinitionGetterVisitor(const armarx::PropertyUser &defs, const std::string &global_namespace="")
Definition: PropertyDefinitionVisitors.cpp:160
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitString
void visitString(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:90
armarx::aron::component_config::PropertyDefinitionSetterVisitor::visitAronVariantOnExit
void visitAronVariantOnExit(const data::ListPtr &, const type::ListPtr &) override
Definition: PropertyDefinitionVisitors.cpp:374
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitIntEnum
void visitIntEnum(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:145
armarx::aron::data::RecursiveTypedVisitor
Definition: RecursiveVisitor.h:78
armarx::aron::type::ListPtr
std::shared_ptr< class List > ListPtr
Definition: forward_declarations.h:14
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitUnknown
void visitUnknown(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:154
armarx::aron::type::StringPtr
std::shared_ptr< class String > StringPtr
Definition: forward_declarations.h:31
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::TypeInput
typename TypedVisitorBase< data::VariantPtr, const type::VariantPtr >::TypeInput TypeInput
Definition: RecursiveVisitor.h:81
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitFloat
void visitFloat(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:63
armarx::aron::component_config::PropertyDefinitionGetterVisitor::getObjectElements
MapElements getObjectElements(DataInput &o, TypeInput &t) override
Definition: PropertyDefinitionVisitors.cpp:211
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitObjectOnEnter
void visitObjectOnEnter(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:274
armarx::aron::type::DictPtr
std::shared_ptr< class Dict > DictPtr
Definition: forward_declarations.h:13
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitDouble
void visitDouble(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:72
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitDictOnEnter
void visitDictOnEnter(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:170
armarx::aron::component_config::PropertyDefinitionGetterVisitor::getTupleElements
TupleElements getTupleElements(DataInput &o, TypeInput &t) override
Definition: PropertyDefinitionVisitors.cpp:235
armarx::aron::type::BoolPtr
std::shared_ptr< class Bool > BoolPtr
Definition: forward_declarations.h:32
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::DataInput
typename TypedVisitorBase< data::VariantPtr, const type::VariantPtr >::DataInput DataInput
Definition: RecursiveVisitor.h:80
armarx::aron::data::DictPtr
std::shared_ptr< Dict > DictPtr
Definition: Dict.h:41
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitBool
void visitBool(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:81
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitListOnExit
void visitListOnExit(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:139
armarx::aron::component_config::PropertyDefinitionGetterVisitor::getDictElements
MapElements getDictElements(DataInput &o, TypeInput &t) override
Definition: PropertyDefinitionVisitors.cpp:217
VariantVisitor.h
IceUtil::Handle< class PropertyDefinitionContainer >
forward_declarations.h
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitQuaternion
void visitQuaternion(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:262
armarx::aron::data::FloatPtr
std::shared_ptr< Float > FloatPtr
Definition: forward_declarations.h:29
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::ListElements
std::vector< std::pair< DataInputNonConst, TypeInputNonConst > > ListElements
Definition: RecursiveVisitor.h:87
armarx::aron::data::RecursiveConstTypedVariantVisitor
Definition: VariantVisitor.h:192
armarx::aron::data::StringPtr
std::shared_ptr< String > StringPtr
Definition: forward_declarations.h:35
armarx::aron::type::IntEnumPtr
std::shared_ptr< IntEnum > IntEnumPtr
Definition: IntEnum.h:36
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::aron::data::IntPtr
std::shared_ptr< Int > IntPtr
Definition: forward_declarations.h:23
armarx::PropertyUser
Abstract PropertyUser class.
Definition: PropertyUser.h:62
armarx::aron::type::QuaternionPtr
std::shared_ptr< class Quaternion > QuaternionPtr
Definition: forward_declarations.h:21
armarx::aron::type::IntPtr
std::shared_ptr< class Int > IntPtr
Definition: forward_declarations.h:27
armarx::aron::component_config::PropertyDefinitionGetterVisitor::visitDictOnExit
void visitDictOnExit(DataInput &elementData, TypeInput &elementType) override
Definition: PropertyDefinitionVisitors.cpp:204
armarx::aron::type::Descriptor
Descriptor
Definition: Descriptor.h:76
armarx::aron::type::DoublePtr
std::shared_ptr< class Double > DoublePtr
Definition: forward_declarations.h:30
armarx::aron::component_config::PropertyDefinitionGetterVisitor::getListElements
ListElements getListElements(DataInput &o, TypeInput &t) override
Definition: PropertyDefinitionVisitors.cpp:223
armarx::aron::data::ListPtr
std::shared_ptr< List > ListPtr
Definition: List.h:40
armarx::aron::data::RecursiveTypedVisitor< data::VariantPtr, const type::VariantPtr >::TupleElements
std::vector< std::pair< DataInputNonConst, TypeInputNonConst > > TupleElements
Definition: RecursiveVisitor.h:89
armarx::aron::data::BoolPtr
std::shared_ptr< Bool > BoolPtr
Definition: forward_declarations.h:38