ComplexVariant.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Fabian Peller-Konrad (fabian dot peller-konrad at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #pragma once
25 
26 // STD/STL
27 #include <memory>
28 #include <string>
29 #include <unordered_map>
30 
31 // Base class
32 #include "SpecializedVariant.h"
33 
35 {
36  template <typename AronDataT, typename DerivedT>
37  class ComplexVariant : public SpecializedVariantBase<AronDataT, DerivedT>
38  {
39  public:
42 
43  virtual ~ComplexVariant() = default;
44 
45  // virtual implementations
47  navigateAbsolute(const Path& path) const override
48  {
50  __PRETTY_FUNCTION__,
51  "Could not navigate through a non container navigator. The input path was: " +
52  path.toString(),
54  }
55 
56  std::vector<VariantPtr>
57  getChildren() const override
58  {
59  return {};
60  }
61 
62  size_t
63  childrenSize() const override
64  {
65  return 0;
66  }
67  };
68 } // namespace armarx::aron::data::detail
armarx::aron::error::AronException
A base class for aron exceptions.
Definition: Exception.h:42
armarx::aron::data::Variant::getPath
Path getPath() const
get the path
Definition: Variant.h:110
armarx::aron::data::Variant::path
const Path path
Definition: Variant.h:156
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::data::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::aron::data::detail
Definition: ComplexVariant.h:34
armarx::aron::data::detail::SpecializedVariantBase::SpecializedVariantBase
SpecializedVariantBase()=delete
armarx::aron::data::detail::ComplexVariant
Definition: ComplexVariant.h:37
armarx::aron::data::detail::ComplexVariant::childrenSize
size_t childrenSize() const override
get the children size of a data variant
Definition: ComplexVariant.h:63
armarx::aron::data::detail::ComplexVariant::getChildren
std::vector< VariantPtr > getChildren() const override
get the children of a data variant
Definition: ComplexVariant.h:57
armarx::aron::data::detail::ComplexVariant::~ComplexVariant
virtual ~ComplexVariant()=default
armarx::aron::data::detail::SpecializedVariantBase
Definition: SpecializedVariant.h:39
SpecializedVariant.h
armarx::aron::data::detail::ComplexVariant::navigateAbsolute
VariantPtr navigateAbsolute(const Path &path) const override
naviate absolute
Definition: ComplexVariant.h:47
armarx::aron::Path::toString
std::string toString() const
Definition: Path.cpp:125