Prediction.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 RobotAPI::armem::client
17 * @author phesch ( ulila at student dot kit dot edu )
18 * @date 2022
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22
23#include "Prediction.h"
24
26
28
29namespace armarx::armem
30{
32 PredictionEngine::fromIce(const armem::prediction::data::PredictionEngine& ice)
33 {
35 }
36
37 armem::prediction::data::PredictionEngine
42
44 PredictionSettings::fromIce(const armem::prediction::data::PredictionSettings& ice)
45 {
47 }
48
49 armem::prediction::data::PredictionSettings
54
56 PredictionRequest::fromIce(const armem::prediction::data::PredictionRequest& ice)
57 {
59 }
60
61 armem::prediction::data::PredictionRequest
66
68 PredictionResult::fromIce(const armem::prediction::data::PredictionResult& ice)
69 {
71 }
72
73 armem::prediction::data::PredictionResult
78
79 void
80 toIce(armem::prediction::data::PredictionEngine& ice, const PredictionEngine& engine)
81 {
82 ice.engineID = engine.engineID;
83 }
84
85 void
86 fromIce(const armem::prediction::data::PredictionEngine& ice, PredictionEngine& engine)
87 {
88 engine.engineID = ice.engineID;
89 }
90
91 void
92 toIce(armem::prediction::data::PredictionSettings& ice, const PredictionSettings& settings)
93 {
94 ice.predictionEngineID = settings.predictionEngineID;
95 }
96
97 void
98 fromIce(const armem::prediction::data::PredictionSettings& ice, PredictionSettings& settings)
99 {
100 settings.predictionEngineID = ice.predictionEngineID;
101 }
102
103 void
104 toIce(armem::prediction::data::PredictionRequest& ice, const PredictionRequest& request)
105 {
106 toIce(ice.snapshotID, request.snapshotID);
107 toIce(ice.settings, request.predictionSettings);
108 }
109
110 void
111 fromIce(const armem::prediction::data::PredictionRequest& ice, PredictionRequest& request)
112 {
113 fromIce(ice.snapshotID, request.snapshotID);
114 fromIce(ice.settings, request.predictionSettings);
115 }
116
117 void
118 toIce(armem::prediction::data::PredictionResult& ice, const PredictionResult& result)
119 {
120 ice.success = result.success;
121 ice.errorMessage = result.errorMessage;
122 toIce(ice.snapshotID, result.snapshotID);
123 if (result.prediction)
124 {
125 ice.prediction = result.prediction->toAronDictDTO();
126 }
127 else
128 {
129 ice.prediction = nullptr;
130 }
131 }
132
133 void
134 fromIce(const armem::prediction::data::PredictionResult& ice, PredictionResult& result)
135 {
136 result.success = ice.success;
137 result.errorMessage = ice.errorMessage;
138 fromIce(ice.snapshotID, result.snapshotID);
139 result.prediction = aron::data::Dict::FromAronDictDTO(ice.prediction);
140 }
141
142} // namespace armarx::armem
static PointerType FromAronDictDTO(const data::dto::DictPtr &aron)
Definition Dict.cpp:130
void fromIce(const data::MemoryID &ice, MemoryID &id)
void toIce(data::MemoryID &ice, const MemoryID &id)
void fromIce(const std::map< IceKeyT, IceValueT > &iceMap, boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
void toIce(std::map< IceKeyT, IceValueT > &iceMap, const boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
static PredictionEngine fromIce(const armem::prediction::data::PredictionEngine &ice)
armem::prediction::data::PredictionEngine toIce() const
armem::prediction::data::PredictionRequest toIce() const
PredictionSettings predictionSettings
Definition Prediction.h:51
static PredictionRequest fromIce(const armem::prediction::data::PredictionRequest &ice)
aron::data::DictPtr prediction
Definition Prediction.h:63
static PredictionResult fromIce(const armem::prediction::data::PredictionResult &ice)
armem::prediction::data::PredictionResult toIce() const
static PredictionSettings fromIce(const armem::prediction::data::PredictionSettings &ice)
armem::prediction::data::PredictionSettings toIce() const