Double.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/Double.h"
34 
35 namespace armarx::aron::data
36 {
37 
38  class Double;
39  typedef std::shared_ptr<Double> DoublePtr;
40 
41  class Double :
42  public detail::PrimitiveVariant<data::dto::AronDouble, double, Double>
43  {
44  public:
45  /* constructors */
46  Double(const Path& = Path());
47  Double(const data::dto::AronDoublePtr&, const Path& = Path());
48  Double(const double, const Path& = Path());
49 
50  /* operators */
52 
53  bool operator==(const Double&) const override;
54  bool operator==(const DoublePtr&) const override;
55 
56  /* static methods */
57  static DoublePtr FromAronDoubleDTO(const data::dto::AronDoublePtr& aron);
58  static data::dto::AronDoublePtr ToAronDoubleDTO(const DoublePtr& navigator);
59 
60  /* public member functions */
61  data::dto::AronDoublePtr toAronDoubleDTO() const;
62 
63  /* virtual implementations */
64  void fromString(const std::string& setter) override;
65 
66  std::string getShortName() const override;
67  std::string getFullName() const override;
68 
69  type::VariantPtr recalculateType() const override;
70  bool fullfillsType(const type::VariantPtr&) const override;
71  };
72 }
73 
74 namespace armarx::aron
75 {
76  template<typename... _Args>
78  {
79  return std::make_shared<aron::data::Double>(args...);
80  }
81 }
armarx::aron::type::VariantPtr
std::shared_ptr< Variant > VariantPtr
Definition: forward_declarations.h:11
armarx::aron::data::Double::operator==
bool operator==(const Double &) const override
Definition: Double.cpp:58
armarx::aron::data::Double
Definition: Double.h:41
armarx::aron::data::DoublePtr
std::shared_ptr< Double > DoublePtr
Definition: forward_declarations.h:32
armarx::aron::data::Double::recalculateType
type::VariantPtr recalculateType() const override
recalculate the type of a data variant. Please not tha the mapping ist NOT bijective,...
Definition: Double.cpp:130
armarx::aron::data::Double::FromAronDoubleDTO
static DoublePtr FromAronDoubleDTO(const data::dto::AronDoublePtr &aron)
Definition: Double.cpp:80
armarx::aron::data::Double::toAronDoubleDTO
data::dto::AronDoublePtr toAronDoubleDTO() const
Definition: Double.cpp:97
armarx::aron::data::Double::getFullName
std::string getFullName() const override
get the full str representation of this variant
Definition: Double.cpp:116
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::VariantType::Double
const VariantTypeId Double
Definition: Variant.h:919
armarx::aron
Definition: DataDisplayVisitor.cpp:5
armarx::aron::data::Double::fullfillsType
bool fullfillsType(const type::VariantPtr &) const override
checks, if the current data variant fullfills the given type
Definition: Double.cpp:122
armarx::aron::data::Double::ToAronDoubleDTO
static data::dto::AronDoublePtr ToAronDoubleDTO(const DoublePtr &navigator)
Definition: Double.cpp:90
armarx::aron::data::Double::getShortName
std::string getShortName() const override
get a short str representation of this variant
Definition: Double.cpp:110
armarx::aron::make_double
aron::data::DoublePtr make_double(_Args &&... args)
Definition: Double.h:77
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::Double::Double
Double(const Path &=Path())
Definition: Double.cpp:41
armarx::armem::server::ltm::detail::mixin::Path
std::filesystem::path Path
Definition: DiskStorageMixin.h:17
armarx::aron::data::Double::fromString
void fromString(const std::string &setter) override
set a primitive from a std string
Definition: Double.cpp:104
armarx::aron::data::detail::SpecializedVariantBase< data::dto::AronDouble, Double >::aron
AronDataType::PointerType aron
Definition: SpecializedVariant.h:154