OacStatisticalMeasure.cpp
Go to the documentation of this file.
1 /*
2 * This file is part of ArmarX.
3 *
4 * ArmarX is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 *
8 * ArmarX is distributed in the hope that it will be useful, but
9 * WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 *
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 *
16 * @package MemoryX::Core
17 * @author Nils Adermann <naderman@naderman.de>
18 * @date 2013
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #include "OacStatisticalMeasure.h"
24 
26 
27 namespace memoryx
28 {
30  {
31  count = 0;
32  countFailed = 0;
33  }
34 
35  int OacStatisticalMeasure::getExperimentCount(const Ice::Current& c) const
36  {
37  return count;
38  }
39 
40  void OacStatisticalMeasure::setExperimentCount(int count, const Ice::Current& c)
41  {
42  this->count = count;
43  }
44 
45  int OacStatisticalMeasure::getFailedExperimentCount(const Ice::Current& c) const
46  {
47  return countFailed;
48  }
49 
50  void OacStatisticalMeasure::setFailedExperimentCount(int countFailed, const Ice::Current& c)
51  {
52  this->countFailed = countFailed;
53  }
54 
56  {
57  count += amount;
58  }
59 
61  {
62  countFailed += amount;
63  }
64 
65  void OacStatisticalMeasure::serialize(const armarx::ObjectSerializerBasePtr& serializer, const Ice::Current& c) const
66  {
67  armarx::AbstractObjectSerializerPtr obj = armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
68 
69  obj->setInt("count", count);
70  obj->setInt("countFailed", countFailed);
71  }
72 
73  void OacStatisticalMeasure::deserialize(const armarx::ObjectSerializerBasePtr& serializer, const Ice::Current& c)
74  {
75  armarx::AbstractObjectSerializerPtr obj = armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
76 
77  count = obj->getInt("count");
78  countFailed = obj->getInt("countFailed");
79  }
80 
81  armarx::VariantDataClassPtr OacStatisticalMeasure::clone(const Ice::Current& c) const
82  {
84 
85  clone->setExperimentCount(this->getExperimentCount());
86  clone->setFailedExperimentCount(this->getFailedExperimentCount());
87 
88  return clone;
89  }
90 
91  std::string OacStatisticalMeasure::output(const Ice::Current& c) const
92  {
93  return "OacStatisticalMeasure";
94  }
95 
96  int OacStatisticalMeasure::getType(const Ice::Current& c) const
97  {
99  }
100 
101  bool OacStatisticalMeasure::validate(const Ice::Current& c)
102  {
103  return true;
104  }
105 
107  {
108  return this->clone();
109  }
110 }
memoryx::OacStatisticalMeasure::getType
int getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OacStatisticalMeasure.cpp:96
memoryx::OacStatisticalMeasure::getFailedExperimentCount
int getFailedExperimentCount(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OacStatisticalMeasure.cpp:45
OacStatisticalMeasure.h
AbstractObjectSerializer.h
memoryx::OacStatisticalMeasure::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OacStatisticalMeasure.cpp:65
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
memoryx::OacStatisticalMeasure::setExperimentCount
void setExperimentCount(int count, const Ice::Current &c=Ice::emptyCurrent) override
Definition: OacStatisticalMeasure.cpp:40
memoryx::OacStatisticalMeasure::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: OacStatisticalMeasure.cpp:106
memoryx::OacStatisticalMeasure::clone
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OacStatisticalMeasure.cpp:81
IceInternal::Handle
Definition: forward_declarations.h:8
memoryx::OacStatisticalMeasure::getExperimentCount
int getExperimentCount(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OacStatisticalMeasure.cpp:35
memoryx::OacStatisticalMeasure::increaseExperimentCount
void increaseExperimentCount(int amount=1)
Definition: OacStatisticalMeasure.cpp:55
memoryx::OacStatisticalMeasure::increaseFailedExperimentCount
void increaseFailedExperimentCount(int amount=1)
Definition: OacStatisticalMeasure.cpp:60
memoryx::OacStatisticalMeasure::setFailedExperimentCount
void setFailedExperimentCount(int countFailed, const Ice::Current &c=Ice::emptyCurrent) override
Definition: OacStatisticalMeasure.cpp:50
memoryx::OacStatisticalMeasure::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: OacStatisticalMeasure.cpp:101
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
memoryx::VariantType::OacStatisticalMeasure
const armarx::VariantTypeId OacStatisticalMeasure
Definition: OacStatisticalMeasure.h:31
memoryx::OacStatisticalMeasure::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const Ice::Current &c=Ice::emptyCurrent) override
Definition: OacStatisticalMeasure.cpp:73
memoryx::OacStatisticalMeasure::OacStatisticalMeasure
OacStatisticalMeasure()
Definition: OacStatisticalMeasure.cpp:29
memoryx::OacStatisticalMeasure::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: OacStatisticalMeasure.cpp:91