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 
27 namespace 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 
39  Parameter&
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
armarx::Parameter::setVariant
void setVariant(const VariantBasePtr &variant, const Ice::Current &c=Ice::emptyCurrent) override
Definition: Parameter.cpp:59
armarx::Parameter::Parameter
Parameter()
Creates an empty Parameter.
Definition: Parameter.h:51
armarx::Parameter::getDataFieldIdentifier
DataFieldIdentifierBasePtr getDataFieldIdentifier(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: Parameter.cpp:107
armarx::Parameter::setDataFieldIdentifier
void setDataFieldIdentifier(const DataFieldIdentifierBasePtr &dataFieldIdentifier, const Ice::Current &c=Ice::emptyCurrent) override
Definition: Parameter.cpp:72
armarx::Parameter
Definition: Parameter.h:45
armarx::Parameter::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: Parameter.cpp:113
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
IceUtil
Definition: Instance.h:21
IceInternal::Handle<::armarx::VariantBase >
armarx::Parameter::getVariant
VariantBasePtr getVariant(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: Parameter.cpp:93
armarx::Parameter::getParameterType
ParameterType getParameterType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: Parameter.cpp:80
armarx::VariantTypeId
Ice::Int VariantTypeId
Definition: Variant.h:43
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
armarx::Parameter::clone
ParameterBasePtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: Parameter.cpp:52
Parameter.h
armarx::Parameter::setVariantList
void setVariantList(const SingleTypeVariantListBasePtr &variantList, const Ice::Current &c=Ice::emptyCurrent) override
Definition: Parameter.cpp:65
armarx::Parameter::getVariantList
SingleTypeVariantListBasePtr getVariantList(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: Parameter.cpp:100
armarx::Parameter::getVariantType
VariantTypeId getVariantType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: Parameter.cpp:86
armarx::Parameter::operator=
virtual Parameter & operator=(const Parameter &source)
Definition: Parameter.cpp:40
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27