Tuple.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 <map>
28 #include <string>
29 
30 // Base Class
31 #include "../detail/ContainerVariant.h"
32 
33 namespace armarx::aron::type
34 {
35  /**
36  * @brief The Tuple class. It represents the tuple type
37  * A tuple has a list of accepted types
38  */
39  class Tuple : public detail::ContainerVariant<type::dto::Tuple, Tuple>
40  {
41  public:
42  // constructors
43  Tuple(const Path& path = Path());
44  Tuple(const type::dto::Tuple&, const Path& path = Path());
45 
46  // public member functions
47  std::vector<VariantPtr> getAcceptedTypes() const;
48  bool hasAcceptedType(unsigned int i) const;
49  VariantPtr getAcceptedType(unsigned int i) const;
50 
51  void setAcceptedTypes(const std::vector<VariantPtr>&);
52  void addAcceptedType(const VariantPtr&);
53 
55 
56  // virtual implementations
57  VariantPtr navigateAbsolute(const Path& path) const override;
58 
59  std::string getShortName() const override;
60  std::string getFullName() const override;
61  std::vector<VariantPtr> getChildren() const override;
62  size_t childrenSize() const override;
63 
64  static std::string GetFullNamePrefix();
65  static std::string GetNamePrefix();
66 
67  private:
68  std::vector<VariantPtr> acceptedTypes;
69  };
70 } // namespace armarx::aron::type
armarx::aron::type::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::aron::type::detail::ContainerVariant
Definition: ContainerVariant.h:39
armarx::aron::type::TuplePtr
std::shared_ptr< class Tuple > TuplePtr
Definition: forward_declarations.h:17
armarx::aron::type::Tuple::hasAcceptedType
bool hasAcceptedType(unsigned int i) const
Definition: Tuple.cpp:65
armarx::aron::type::Tuple
The Tuple class.
Definition: Tuple.h:39
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::type::Tuple::navigateAbsolute
VariantPtr navigateAbsolute(const Path &path) const override
naviate absolute
Definition: Tuple.cpp:142
armarx::aron::type::Tuple::Tuple
Tuple(const Path &path=Path())
Definition: Tuple.cpp:32
armarx::aron::type::Tuple::getAcceptedTypes
std::vector< VariantPtr > getAcceptedTypes() const
Definition: Tuple.cpp:59
armarx::aron::type::Tuple::setAcceptedTypes
void setAcceptedTypes(const std::vector< VariantPtr > &)
Definition: Tuple.cpp:77
armarx::aron::type::Tuple::getChildren
std::vector< VariantPtr > getChildren() const override
get all child elements
Definition: Tuple.cpp:96
armarx::aron::type::Tuple::getShortName
std::string getShortName() const override
get a short name of this specific type
Definition: Tuple.cpp:108
armarx::aron::type
A convenience header to include all aron files (full include, not forward declared)
Definition: aron_conversions.cpp:9
armarx::aron::type::Tuple::getFullName
std::string getFullName() const override
get the full name of this specific type
Definition: Tuple.cpp:119
armarx::aron::type::Tuple::toTupleDTO
type::dto::TuplePtr toTupleDTO() const
Definition: Tuple.cpp:48
armarx::armem::server::ltm::detail::mixin::Path
std::filesystem::path Path
Definition: DiskStorageMixin.h:17
armarx::aron::type::Tuple::childrenSize
size_t childrenSize() const override
Definition: Tuple.cpp:102
armarx::aron::type::Tuple::getAcceptedType
VariantPtr getAcceptedType(unsigned int i) const
Definition: Tuple.cpp:71
armarx::aron::type::Variant::path
const Path path
Definition: Variant.h:139
armarx::aron::type::Tuple::addAcceptedType
void addAcceptedType(const VariantPtr &)
Definition: Tuple.cpp:87
armarx::aron::type::Tuple::GetFullNamePrefix
static std::string GetFullNamePrefix()
Definition: Tuple.cpp:130
armarx::aron::type::Tuple::GetNamePrefix
static std::string GetNamePrefix()
Definition: Tuple.cpp:136