List.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 <string>
28 #include <vector>
29 
30 // Base Class
31 #include "../detail/ContainerVariant.h"
32 
33 namespace armarx::aron::type
34 {
35  /**
36  * @brief The List class. It represents the list type
37  * It only has an accepted type (a variant)
38  */
39  class List : public detail::ContainerVariant<type::dto::List, List>
40  {
41  public:
42  // constructors
43  List(const Path& path = Path());
44  List(const type::dto::List&, const Path& path = Path());
45 
46  // public member functions
48  void setAcceptedType(const VariantPtr&);
49 
51 
52  // virtual implementations
53  VariantPtr navigateAbsolute(const Path& path) const override;
54 
55  std::string getShortName() const override;
56  std::string getFullName() const override;
57  std::vector<VariantPtr> getChildren() const override;
58  size_t childrenSize() const override;
59 
60  static std::string GetFullNamePrefix();
61  static std::string GetNamePrefix();
62 
63  private:
64  // members
65  VariantPtr acceptedType;
66  };
67 } // namespace armarx::aron::type
armarx::aron::type::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::VariantType::List
const VariantContainerType List
Definition: SingleTypeVariantList.h:191
armarx::aron::type::List::getFullName
std::string getFullName() const override
get the full name of this specific type
Definition: List.cpp:83
armarx::aron::type::detail::ContainerVariant
Definition: ContainerVariant.h:39
armarx::aron::type::List
The List class.
Definition: List.h:39
armarx::aron::type::List::List
List(const Path &path=Path())
Definition: List.cpp:30
armarx::aron::type::List::childrenSize
size_t childrenSize() const override
Definition: List.cpp:71
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::type::List::getChildren
std::vector< VariantPtr > getChildren() const override
get all child elements
Definition: List.cpp:65
armarx::aron::type::List::GetFullNamePrefix
static std::string GetFullNamePrefix()
Definition: List.cpp:89
armarx::aron::type::List::getShortName
std::string getShortName() const override
get a short name of this specific type
Definition: List.cpp:77
armarx::aron::type::List::toListDTO
type::dto::ListPtr toListDTO() const
Definition: List.cpp:58
armarx::aron::type
A convenience header to include all aron files (full include, not forward declared)
Definition: aron_conversions.cpp:9
armarx::aron::type::List::getAcceptedType
VariantPtr getAcceptedType() const
Definition: List.cpp:43
armarx::aron::type::List::navigateAbsolute
VariantPtr navigateAbsolute(const Path &path) const override
naviate absolute
Definition: List.cpp:101
armarx::aron::type::List::GetNamePrefix
static std::string GetNamePrefix()
Definition: List.cpp:95
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::data::ListPtr
std::shared_ptr< List > ListPtr
Definition: List.h:40
armarx::aron::type::List::setAcceptedType
void setAcceptedType(const VariantPtr &)
Definition: List.cpp:49