Float.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 
29 // Base class
30 #include "../detail/PrimitiveVariant.h"
31 
32 // ArmarX
33 #include "../../../type/variant/primitive/Float.h"
34 
35 namespace armarx::aron::data
36 {
37 
38  class Float;
39  typedef std::shared_ptr<Float> FloatPtr;
40 
41  class Float : public detail::PrimitiveVariant<data::dto::AronFloat, float, Float>
42  {
43  public:
44  /* constructors */
45  Float(const Path& = Path());
46  Float(const data::dto::AronFloatPtr&, const Path& = Path());
47  Float(const float, const Path& = Path());
48 
49  /* operators */
51 
52  bool operator==(const Float&) const override;
53  bool operator==(const FloatPtr&) const override;
54 
55  /* static methods */
56  static FloatPtr FromAronFloatDTO(const data::dto::AronFloatPtr& aron);
57  static data::dto::AronFloatPtr ToAronFloatDTO(const FloatPtr& navigator);
58 
59  /* public member functions */
60  data::dto::AronFloatPtr toAronFloatDTO() const;
61 
62  /* virtual implementations */
63  void fromString(const std::string& setter) override;
64 
65  std::string getShortName() const override;
66  std::string getFullName() const override;
67 
68  type::VariantPtr recalculateType() const override;
69  bool fullfillsType(const type::VariantPtr&) const override;
70  };
71 } // namespace armarx::aron::data
72 
73 namespace armarx::aron
74 {
75  template <typename... _Args>
77  make_float(_Args&&... args)
78  {
79  return std::make_shared<aron::data::Float>(args...);
80  }
81 } // namespace armarx::aron
armarx::aron::type::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:919
armarx::aron::data::Float::FromAronFloatDTO
static FloatPtr FromAronFloatDTO(const data::dto::AronFloatPtr &aron)
Definition: Float.cpp:78
armarx::aron::data::Float::getShortName
std::string getShortName() const override
get a short str representation of this variant
Definition: Float.cpp:108
armarx::aron::data::Float::getFullName
std::string getFullName() const override
get the full str representation of this variant
Definition: Float.cpp:114
armarx::aron::make_float
aron::data::FloatPtr make_float(_Args &&... args)
Definition: Float.h:77
armarx::aron::Path
The Path class.
Definition: Path.h:35
armarx::aron::data::Float::ToAronFloatDTO
static data::dto::AronFloatPtr ToAronFloatDTO(const FloatPtr &navigator)
Definition: Float.cpp:88
armarx::aron
Definition: DataDisplayVisitor.cpp:5
armarx::aron::data::Float::recalculateType
type::VariantPtr recalculateType() const override
recalculate the type of a data variant. Please not tha the mapping ist NOT bijective,...
Definition: Float.cpp:128
armarx::aron::data::Float::fullfillsType
bool fullfillsType(const type::VariantPtr &) const override
checks, if the current data variant fullfills the given type
Definition: Float.cpp:120
armarx::aron::data::Float::operator==
bool operator==(const Float &) const override
Definition: Float.cpp:56
armarx::aron::data
A convenience header to include all aron files (full include, not forward declared)
Definition: aron_conversions.cpp:3
armarx::aron::data::detail::PrimitiveVariant
Definition: PrimitiveVariant.h:40
armarx::aron::data::Float::fromString
void fromString(const std::string &setter) override
set a primitive from a std string
Definition: Float.cpp:102
armarx::aron::data::Float::toAronFloatDTO
data::dto::AronFloatPtr toAronFloatDTO() const
Definition: Float.cpp:95
armarx::aron::data::FloatPtr
std::shared_ptr< Float > FloatPtr
Definition: forward_declarations.h:29
armarx::armem::server::ltm::detail::mixin::Path
std::filesystem::path Path
Definition: DiskStorageMixin.h:17
armarx::aron::data::Float::Float
Float(const Path &=Path())
Definition: Float.cpp:39
armarx::aron::data::detail::SpecializedVariantBase< data::dto::AronFloat, Float >::aron
AronDataType::PointerType aron
Definition: SpecializedVariant.h:153
armarx::aron::data::Float
Definition: Float.h:41