Parameter.cpp
Go to the documentation of this file.
1/*
2* This file is part of ArmarX.
3*
4* Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5*
6* ArmarX is free software; you can redistribute it and/or modify
7* it under the terms of the GNU General Public License version 2 as
8* published by the Free Software Foundation.
9*
10* ArmarX is distributed in the hope that it will be useful, but
11* WITHOUT ANY WARRANTY; without even the implied warranty of
12* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13* GNU General Public License for more details.
14*
15* You should have received a copy of the GNU General Public License
16* along with this program. If not, see <http://www.gnu.org/licenses/>.
17*
18* @package ArmarX::Core
19* @author Kai Welke (welke _at_ kit _dot_ edu)
20* @date 2012 Kai Welke
21* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22* GNU General Public License
23*/
24
26
27namespace armarx
28{
29 Parameter::Parameter(const Parameter& source) : IceUtil::Shared(source), ParameterBase(source)
30 {
31 if (type != source.type)
32 {
33 throw InvalidTypeException();
34 }
35
36 type = source.type;
37 }
38
41 {
42 if (type != source.type)
43 {
44 throw InvalidTypeException();
45 }
46
47 type = source.type;
48 return *this;
49 }
50
51 ParameterBasePtr
52 Parameter::clone(const Ice::Current& c) const
53 {
54 return new Parameter(*this);
55 }
56
57 // setter
58 void
59 Parameter::setVariant(const VariantBasePtr& variant, const Ice::Current& c)
60 {
61 throw InvalidTypeException();
62 }
63
64 void
65 Parameter::setVariantList(const SingleTypeVariantListBasePtr& variantList,
66 const Ice::Current& c)
67 {
68 throw InvalidTypeException();
69 }
70
71 void
73 const Ice::Current& c)
74 {
75 throw InvalidTypeException();
76 }
77
78 // getter
79 ParameterType
80 Parameter::getParameterType(const Ice::Current& c) const
81 {
82 return type;
83 }
84
86 Parameter::getVariantType(const Ice::Current& c) const
87 {
88 throw InvalidTypeException(
89 "Accessing get getVariantTypeId() on the Parameter-Baseclass does not work.");
90 }
91
93 Parameter::getVariant(const Ice::Current& c) const
94 {
95 throw InvalidTypeException(
96 "Accessing get getVariant() on the Parameter-Baseclass does not work.");
97 }
98
99 SingleTypeVariantListBasePtr
100 Parameter::getVariantList(const Ice::Current& c) const
101 {
102 throw InvalidTypeException(
103 "Accessing get getVariantList() on the Parameter-Baseclass does not work.");
104 }
105
107 Parameter::getDataFieldIdentifier(const Ice::Current& c) const
108 {
109 throw InvalidTypeException();
110 }
111
112 bool
113 Parameter::validate(const Ice::Current& c) const
114 {
115 return true;
116 }
117} // namespace armarx
constexpr T c
VariantBasePtr getVariant(const Ice::Current &c=Ice::emptyCurrent) const override
Definition Parameter.cpp:93
Parameter()
Creates an empty Parameter.
Definition Parameter.h:51
VariantTypeId getVariantType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition Parameter.cpp:86
virtual Parameter & operator=(const Parameter &source)
Definition Parameter.cpp:40
ParameterBasePtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition Parameter.cpp:52
void setVariantList(const SingleTypeVariantListBasePtr &variantList, const Ice::Current &c=Ice::emptyCurrent) override
Definition Parameter.cpp:65
void setDataFieldIdentifier(const DataFieldIdentifierBasePtr &dataFieldIdentifier, const Ice::Current &c=Ice::emptyCurrent) override
Definition Parameter.cpp:72
DataFieldIdentifierBasePtr getDataFieldIdentifier(const Ice::Current &c=Ice::emptyCurrent) const override
ParameterType getParameterType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition Parameter.cpp:80
bool validate(const Ice::Current &c=Ice::emptyCurrent) const override
void setVariant(const VariantBasePtr &variant, const Ice::Current &c=Ice::emptyCurrent) override
Definition Parameter.cpp:59
SingleTypeVariantListBasePtr getVariantList(const Ice::Current &c=Ice::emptyCurrent) const override
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< DataFieldIdentifierBase > DataFieldIdentifierBasePtr
Ice::Int VariantTypeId
Definition Variant.h:43
::IceInternal::Handle<::armarx::VariantBase > VariantBasePtr