Pair.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 Pair class. It represents the pair type
37  * A pair has two accepted types
38  */
39  class Pair : public detail::ContainerVariant<type::dto::Pair, Pair>
40  {
41  public:
42  // constructors
43  Pair(const Path& path = Path());
44  Pair(const type::dto::Pair&, const Path& path = Path());
45 
46  // public member functions
47  std::pair<VariantPtr, VariantPtr> getAcceptedTypes() const;
50  void addAcceptedType(const VariantPtr&);
51  void setFirstAcceptedType(const VariantPtr&);
52  void setSecondAcceptedType(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  // members
69  VariantPtr acceptedType1;
70  VariantPtr acceptedType2;
71  };
72 } // namespace armarx::aron::type
armarx::aron::type::Pair::GetNamePrefix
static std::string GetNamePrefix()
Definition: Pair.cpp:132
armarx::aron::type::Pair::getAcceptedTypes
std::pair< VariantPtr, VariantPtr > getAcceptedTypes() const
Definition: Pair.cpp:44
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::Pair::addAcceptedType
void addAcceptedType(const VariantPtr &)
Definition: Pair.cpp:62
armarx::aron::type::Pair::getFullName
std::string getFullName() const override
get the full name of this specific type
Definition: Pair.cpp:119
armarx::aron::type::Pair::getFirstAcceptedType
VariantPtr getFirstAcceptedType() const
Definition: Pair.cpp:50
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::type::Pair::getSecondAcceptedType
VariantPtr getSecondAcceptedType() const
Definition: Pair.cpp:56
armarx::aron::type::Pair::getShortName
std::string getShortName() const override
get a short name of this specific type
Definition: Pair.cpp:113
armarx::aron::type::Pair::childrenSize
size_t childrenSize() const override
Definition: Pair.cpp:107
armarx::aron::type::PairPtr
std::shared_ptr< class Pair > PairPtr
Definition: forward_declarations.h:16
armarx::aron::type::Pair::Pair
Pair(const Path &path=Path())
Definition: Pair.cpp:30
armarx::aron::type
A convenience header to include all aron files (full include, not forward declared)
Definition: aron_conversions.cpp:9
armarx::aron::type::Pair
The Pair class.
Definition: Pair.h:39
armarx::aron::type::Pair::navigateAbsolute
VariantPtr navigateAbsolute(const Path &path) const override
naviate absolute
Definition: Pair.cpp:138
armarx::aron::type::Pair::setSecondAcceptedType
void setSecondAcceptedType(const VariantPtr &)
Definition: Pair.cpp:87
armarx::armem::server::ltm::detail::mixin::Path
std::filesystem::path Path
Definition: DiskStorageMixin.h:17
armarx::aron::type::Variant::path
const Path path
Definition: Variant.h:139
armarx::aron::type::Pair::toPairDTO
type::dto::PairPtr toPairDTO() const
Definition: Pair.cpp:94
armarx::aron::type::Pair::getChildren
std::vector< VariantPtr > getChildren() const override
get all child elements
Definition: Pair.cpp:101
armarx::aron::type::Pair::setFirstAcceptedType
void setFirstAcceptedType(const VariantPtr &)
Definition: Pair.cpp:80
armarx::aron::type::Pair::GetFullNamePrefix
static std::string GetFullNamePrefix()
Definition: Pair.cpp:126