Int.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
31
32// ArmarX
35
36namespace armarx::aron::data
37{
38
39 class Int;
40 typedef std::shared_ptr<Int> IntPtr;
41
42 class Int : public detail::PrimitiveVariant<data::dto::AronInt, int, Int>
43 {
44 public:
45 /* constructors */
46 Int(const Path& = Path());
47 Int(const data::dto::AronIntPtr&, const Path& = Path());
48 Int(const int, const Path& = Path());
49
50 /* operators */
51 using detail::PrimitiveVariant<data::dto::AronInt, int, Int>::operator==;
52
53 bool operator==(const Int&) const override;
54 bool operator==(const IntPtr&) const override;
55
56 /* static methods */
57 static IntPtr FromAronIntDTO(const data::dto::AronIntPtr& aron);
58 static data::dto::AronIntPtr ToAronIntDTO(const IntPtr& navigator);
59
60 /* public member functions */
61 data::dto::AronIntPtr toAronIntDTO() 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} // namespace armarx::aron::data
73
74namespace armarx::aron
75{
76 template <typename... _Args>
78 make_int(_Args&&... args)
79 {
80 return std::make_shared<aron::data::Int>(args...);
81 }
82} // namespace armarx::aron
#define make_int(lowbyte, mid1, mid2, highbyte)
The Path class.
Definition Path.h:36
std::string getShortName() const override
get a short str representation of this variant
Definition Int.cpp:111
bool operator==(const Int &) const override
Definition Int.cpp:59
Int(const Path &=Path())
Definition Int.cpp:42
static data::dto::AronIntPtr ToAronIntDTO(const IntPtr &navigator)
Definition Int.cpp:91
type::VariantPtr recalculateType() const override
recalculate the type of a data variant. Please not tha the mapping ist NOT bijective,...
Definition Int.cpp:132
std::string getFullName() const override
get the full str representation of this variant
Definition Int.cpp:117
void fromString(const std::string &setter) override
set a primitive from a std string
Definition Int.cpp:105
data::dto::AronIntPtr toAronIntDTO() const
Definition Int.cpp:98
bool fullfillsType(const type::VariantPtr &) const override
checks, if the current data variant fullfills the given type
Definition Int.cpp:123
static IntPtr FromAronIntDTO(const data::dto::AronIntPtr &aron)
Definition Int.cpp:81
A convenience header to include all aron files (full include, not forward declared)
std::shared_ptr< Int > IntPtr
std::shared_ptr< Variant > VariantPtr