27 #include <IceUtil/Handle.h>
30 #include <ArmarXCore/interface/observers/VariantContainers.h>
48 virtual public SingleTypeVariantListBase
56 VariantContainerBasePtr
57 cloneContainer(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
61 void addElement(
const VariantContainerBasePtr& variantContainer,
62 const Ice::Current&
c = Ice::emptyCurrent)
override;
63 void addVariant(
const Variant& variant);
64 void clear(
const Ice::Current&
c = Ice::emptyCurrent)
override;
67 Ice::Int getType(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
68 static VariantTypeId getStaticType(
const Ice::Current&
c = Ice::emptyCurrent);
69 int getSize(
const Ice::Current&
c = Ice::emptyCurrent)
const override;
70 bool validateElements(
const Ice::Current&
c = Ice::emptyCurrent)
override;
84 VariantContainerBasePtr
85 getElementBase(
int index,
const Ice::Current&
c = Ice::emptyCurrent)
const override;
87 template <
typename ContainerType>
96 throw InvalidTypeException();
109 template <
typename T1,
typename T2>
110 static std::map<T1, T2>
113 if (l1->getSize() != l2->getSize())
115 throw LocalException(
"List lengths do not match:")
116 << l1->getSize() <<
" != " << l2->getSize();
119 std::map<T1, T2> result;
120 size_t size = l1->getSize();
122 for (
size_t i = 0; i < size; i++)
124 result[l1->getVariant(i)->get<T1>()] = l2->getVariant(i)->get<T2>();
130 template <
typename T1>
136 for (
size_t i = 0; i < vec.size(); i++)
138 result->addVariant(vec.at(i));
144 template <
typename T1>
150 for (
size_t i = 0; i < vec.size(); i++)
152 result->addElement(vec.at(i));
159 void serialize(
const ObjectSerializerBasePtr& serializer,
160 const ::Ice::Current& = Ice::emptyCurrent)
const override;
161 void deserialize(
const ObjectSerializerBasePtr& serializer,
162 const ::Ice::Current& = Ice::emptyCurrent)
override;
165 static std::string getTypePrefix();
167 template <
typename Type>
171 std::vector<Type> result(getSize());
173 for (
int i = 0; i < getSize(); i++)
175 result.at(i) = getVariant(i)->get<
Type>();
181 template <
typename Type>
185 std::vector<Type> result(getSize());
187 for (
int i = 0; i < getSize(); i++)
189 Type p = getElement<typename Type::element_type>(i);
198 std::string
toString(
const Ice::Current& = Ice::emptyCurrent)
const override;