35 EntityAttribute::EntityAttribute(
const std::string& name)
51 this->name = other.name;
55 this->
values.reserve(size);
57 for (
size_t i = 0; i <
size; ++i)
59 AttributeElement elem;
60 const AttributeElement& origElem = other.values.at(i);
62 ProbabilityMeasureBasePtr uncertainty = origElem.uncertainty;
66 elem.uncertainty = ProbabilityMeasureBasePtr::dynamicCast(uncertainty->clone());
69 elem.value = var->clone();
104 const ProbabilityMeasureBasePtr& uncertainty,
105 const ::Ice::Current&)
117 AttributeElement elem;
118 elem.value = armarx::VariantPtr::dynamicCast(val)->clone();
122 elem.uncertainty = ProbabilityMeasureBasePtr::dynamicCast(uncertainty->ice_clone());
138 const ProbabilityMeasureBasePtr& uncertainty,
139 const ::Ice::Current&)
141 AttributeElement elem;
142 elem.value = armarx::VariantPtr::dynamicCast(val)->clone();
146 elem.uncertainty = ProbabilityMeasureBasePtr::dynamicCast(uncertainty->ice_clone());
160 throw armarx::NotImplementedYetException();
163 const std::string valStr = val->getString();
167 for (AttributeElementList::const_iterator it =
values.begin(); it !=
values.end(); ++it)
213 const ::Ice::Current&)
221 const ::Ice::Current&)
251 return this->
clone();
263 void EntityAttribute::output(std::ostream& stream)
const
267 for (AttributeElementList::const_iterator it =
values.begin(); it !=
values.end(); ++it)
269 stream <<
"value: " << armarx::VariantPtr::dynamicCast(it->value);
273 stream <<
", uncertainty: " << ProbabilityMeasureBasePtr::dynamicCast(it->uncertainty)->output();
287 for (AttributeElementList::const_iterator it =
values.begin(); it !=
values.end(); ++it)
290 objValue->setVariant(
"value", armarx::VariantPtr::dynamicCast(it->value));
295 objValue->setVariant(
"uncertainty", uncertaintyVar);
298 obj->append(objValue);
310 for (
unsigned int i = 0; i < obj->size(); ++i)
313 AttributeElement elem;
317 elem.value = objValue->getVariant(
"value");
319 catch (std::exception& e)
328 if (objValue->hasElement(
"uncertainty"))
331 elem.uncertainty = uncertaintyVar->getClass<ProbabilityMeasureBase>();