AnyVariant.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
27// Base class
28#include "SpecializedVariant.h"
29
30// ArmarX
31
33{
34 template <typename AronTypeT, typename DerivedT>
35 class AnyVariant : public SpecializedVariantBase<AronTypeT, DerivedT>
36 {
37 public:
38 using SpecializedVariantBase<AronTypeT, DerivedT>::SpecializedVariantBase;
39
40 virtual ~AnyVariant() = default;
41
42 /* virtual implementations */
44 navigateAbsolute(const Path& path) const override
45 {
47 __PRETTY_FUNCTION__,
48 "Could not navigate through an any navigator. The input path was: " +
49 path.toString(),
51 }
52
53 std::vector<VariantPtr>
54 getChildren() const override
55 {
56 return {};
57 }
58
59 size_t
60 childrenSize() const override
61 {
62 return 0;
63 }
64 };
65} // namespace armarx::aron::type::detail
The Path class.
Definition Path.h:36
A base class for aron exceptions.
Definition Exception.h:37
size_t childrenSize() const override
Definition AnyVariant.h:60
VariantPtr navigateAbsolute(const Path &path) const override
naviate absolute
Definition AnyVariant.h:44
std::vector< VariantPtr > getChildren() const override
get all child elements
Definition AnyVariant.h:54
SpecializedVariantBase(const type::Descriptor &descriptor, const Path &path)
std::shared_ptr< Variant > VariantPtr