Go to the documentation of this file.
51 for (
const auto& dataPtr : l->elements)
59 for (
const auto& dataPtr : n)
70 for (
const auto& nav : childrenNavigators)
99 return *
this == *other;
108 ret->addElement(val->cloneAsVariant());
121 return std::make_shared<List>(
aron);
127 return navigator ? navigator->toAronListDTO() :
nullptr;
134 auto dict = std::make_shared<Dict>();
136 dict->addElement(
"data", copy_this);
149 if (i >
aron->elements.size())
154 " because this list has size " +
158 if (i ==
aron->elements.size())
160 childrenNavigators.push_back(n);
163 aron->elements.push_back(n->toAronDTO());
167 aron->elements.push_back(
nullptr);
172 childrenNavigators[i] = n;
175 aron->elements[i] = (n->toAronDTO());
179 aron->elements[i] =
nullptr;
187 return i < childrenNavigators.size();
193 if (i >= childrenNavigators.size())
197 "The index is out of bounds (size = " +
202 return childrenNavigators[i];
205 std::vector<VariantPtr>
208 return childrenNavigators;
215 i =
std::min((
unsigned int)childrenNavigators.size() - 1, i);
216 childrenNavigators.erase(childrenNavigators.begin() + i);
217 aron->elements.erase(
aron->elements.begin() + i);
223 childrenNavigators.clear();
224 aron->elements.clear();
243 return "armarx::aron::data::List";
267 for (
const auto& nav : childrenNavigators)
269 auto childTypeNav = listTypeNav->getAcceptedType();
278 if (!nav->fullfillsType(childTypeNav))
290 for (
const auto& childTypeNav : tupleTypeNav->getAcceptedTypes())
306 if (!childNav->fullfillsType(tupleTypeNav->getAcceptedType(i)))
321 auto firstChildTypeNav = pairTypeNav->getFirstAcceptedType();
322 if (!childrenNavigators[0])
329 auto secondChildTypeNav = pairTypeNav->getSecondAcceptedType();
330 if (!childrenNavigators[1])
337 return childrenNavigators[0]->fullfillsType(firstChildTypeNav) &&
338 childrenNavigators[1]->fullfillsType(secondChildTypeNav);
346 std::vector<VariantPtr>
349 return childrenNavigators;
355 return childrenNavigators.size();
365 "Could not navigate without a valid path. The path was empty.");
372 "Could not find an element of a path.",
379 return childrenNavigators.at(i);
384 if (!childrenNavigators.at(i))
388 "Could not navigate into a NULL member. Seems like the "
389 "member is optional and not set.",
392 return childrenNavigators.at(i)->navigateAbsolute(next);
bool fullfillsType(const type::VariantPtr &) const override
checks, if the current data variant fullfills the given type
List(const Path &path=Path())
std::string getFirstElement() const
VariantPtr getElement(unsigned int) const
A base class for aron exceptions.
std::string getShortName() const override
get a short str representation of this variant
std::shared_ptr< Variant > VariantPtr
ReaderT::InputType T & ret
static VariantPtr FromAronDTO(const data::dto::GenericDataPtr &, const Path &=Path())
create a variant from a dto object
std::vector< VariantPtr > getElements() const
data::dto::ListPtr toAronListDTO() const
size_t childrenSize() const override
get the children size of a data variant
Path getPath() const
get the path
std::string getFullName() const override
get the full str representation of this variant
type::VariantPtr recalculateType() const override
recalculate the type of a data variant. Please not tha the mapping ist NOT bijective,...
The NotImplementedYetException class.
virtual PointerType clone() const
Path withIndex(int, bool escape=false) const
void removeElement(unsigned int)
std::shared_ptr< Variant > VariantPtr
static data::dto::ListPtr ToAronListDTO(const PointerType &navigator)
VariantPtr navigateAbsolute(const Path &path) const override
naviate absolute
The ValueNotValidException class.
const std::string & to_string(const std::string &s)
A convenience header to include all aron files (full include, not forward declared)
data::dto::GenericDataPtr toAronDTO() const override
std::shared_ptr< Dict > DictPtr
static PointerType FromAronListDTO(const data::dto::ListPtr &aron)
bool operator==(const List &) const override
Path withDetachedFirstElement() const
std::vector< VariantPtr > getChildren() const override
get the children of a data variant
static std::shared_ptr< List > DynamicCastAndCheck(const VariantPtr &n)
DictPtr getAsDict() const
bool hasElement(unsigned int) const
void setElement(unsigned int, const VariantPtr &)
std::shared_ptr< List > ListPtr
void addElement(const VariantPtr &)
AronDataType::PointerType aron