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
24
26
27namespace memoryx
28{
30 {
31 count = 0;
32 countFailed = 0;
33 }
34
35 int
37 {
38 return count;
39 }
40
41 void
42 OacStatisticalMeasure::setExperimentCount(int count, const Ice::Current& c)
43 {
44 this->count = count;
45 }
46
47 int
49 {
50 return countFailed;
51 }
52
53 void
54 OacStatisticalMeasure::setFailedExperimentCount(int countFailed, const Ice::Current& c)
55 {
56 this->countFailed = countFailed;
57 }
58
59 void
61 {
62 count += amount;
63 }
64
65 void
67 {
68 countFailed += amount;
69 }
70
71 void
72 OacStatisticalMeasure::serialize(const armarx::ObjectSerializerBasePtr& serializer,
73 const Ice::Current& c) const
74 {
76 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
77
78 obj->setInt("count", count);
79 obj->setInt("countFailed", countFailed);
80 }
81
82 void
83 OacStatisticalMeasure::deserialize(const armarx::ObjectSerializerBasePtr& serializer,
84 const Ice::Current& c)
85 {
87 armarx::AbstractObjectSerializerPtr::dynamicCast(serializer);
88
89 count = obj->getInt("count");
90 countFailed = obj->getInt("countFailed");
91 }
92
93 armarx::VariantDataClassPtr
94 OacStatisticalMeasure::clone(const Ice::Current& c) const
95 {
97
98 clone->setExperimentCount(this->getExperimentCount());
99 clone->setFailedExperimentCount(this->getFailedExperimentCount());
100
101 return clone;
102 }
103
104 std::string
105 OacStatisticalMeasure::output(const Ice::Current& c) const
106 {
107 return "OacStatisticalMeasure";
108 }
109
110 int
111 OacStatisticalMeasure::getType(const Ice::Current& c) const
112 {
114 }
115
116 bool
118 {
119 return true;
120 }
121
122 Ice::ObjectPtr
124 {
125 return this->clone();
126 }
127} // namespace memoryx
constexpr T c
int getType(const Ice::Current &c=Ice::emptyCurrent) const override
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
void setExperimentCount(int count, const Ice::Current &c=Ice::emptyCurrent) override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const Ice::Current &c=Ice::emptyCurrent) override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const Ice::Current &c=Ice::emptyCurrent) const override
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
armarx::VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
int getExperimentCount(const Ice::Current &c=Ice::emptyCurrent) const override
void setFailedExperimentCount(int countFailed, const Ice::Current &c=Ice::emptyCurrent) override
int getFailedExperimentCount(const Ice::Current &c=Ice::emptyCurrent) const override
IceInternal::Handle< AbstractObjectSerializer > AbstractObjectSerializerPtr
const armarx::VariantTypeId OacStatisticalMeasure
VirtualRobot headers.
IceInternal::Handle< OacStatisticalMeasure > OacStatisticalMeasurePtr