GCC Code Coverage Report


Directory: ./
File: src/hpp/core_idl/_constraints.hh
Date: 2024-12-13 15:50:05
Exec Total Coverage
Lines: 25 135 18.5%
Branches: 13 260 5.0%

Line Branch Exec Source
1 #ifndef hpp_core_idl____constraints_hxx__
2 #define hpp_core_idl____constraints_hxx__
3
4 //
5 // Implemention of IDL interfaces in file /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/_constraints.idl
6 //
7
8 #include <hpp/core_idl/_constraints-fwd.hh>
9
10 #include <sstream>
11
12 #include <hpp/corbaserver/fwd.hh>
13 #include <hpp/corbaserver/conversions.hh>
14 #include "hpp/corbaserver/servant-base.hh"
15
16
17
18 //
19 // Implementational code for IDL interface hpp::core_idl::Constraint
20 //
21 namespace hpp {
22
23 namespace core_impl {
24 template <typename _Base, typename _Storage>
25 8 ConstraintServant<_Base, _Storage>::ConstraintServant(::hpp::corbaServer::Server* server,
26 const _Storage& s)
27
0/4
✗ Branch 3 not taken.
✗ Branch 4 not taken.
✗ Branch 7 not taken.
✗ Branch 8 not taken.
8 : hpp::corbaServer::ServantBase<hpp::core::Constraint, _Storage> (server, s)
28 {
29 // add extra constructor code here
30 }
31 template <typename _Base, typename _Storage>
32 8 ConstraintServant<_Base, _Storage>::~ConstraintServant()
33 {
34 // add extra destructor code here
35 }
36
37 // Methods corresponding to IDL attributes and operations
38
39 template <typename _Base, typename _Storage>
40 void ConstraintServant<_Base, _Storage>::deleteThis ()
41 {
42 try {
43 // automatically generated code.
44 _ServantBase::deleteThis();
45 } catch (const std::exception& e) {
46 throw ::hpp::Error (e.what());
47 }
48 }
49
50 template <typename _Base, typename _Storage>
51 ::CORBA::Boolean ConstraintServant<_Base, _Storage>::deleteIfExpired ()
52 {
53 try {
54 // automatically generated code.
55 return _ServantBase::deleteIfExpired();
56 } catch (const std::exception& e) {
57 throw ::hpp::Error (e.what());
58 }
59 }
60
61 template <typename _Base, typename _Storage>
62 void ConstraintServant<_Base, _Storage>::persistantStorage (::CORBA::Boolean persistant)
63 {
64 try {
65 // automatically generated code.
66 _ServantBase::persistantStorage(persistant);
67 } catch (const std::exception& e) {
68 throw ::hpp::Error (e.what());
69 }
70 }
71
72 template <typename _Base, typename _Storage>
73 ::CORBA::Boolean ConstraintServant<_Base, _Storage>::apply (hpp::floatSeq& config)
74 {
75 try {
76 // automatically generated code.
77 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
78 ::CORBA::Boolean __return__ (getT()->apply (_config));
79 hpp::corbaServer::vectorToFloatSeq (_config, config);
80 return __return__;
81 } catch (const std::exception& e) {
82 throw ::hpp::Error (e.what());
83 }
84 }
85
86 template <typename _Base, typename _Storage>
87 4 char* ConstraintServant<_Base, _Storage>::name ()
88 {
89 try {
90 // automatically generated code.
91
92
2/4
✓ Branch 1 taken 2 times.
✗ Branch 2 not taken.
✓ Branch 6 taken 2 times.
✗ Branch 7 not taken.
4 char* __return__ = ::hpp::corbaServer::c_str (getT()->name ());
93
94 4 return __return__;
95 } catch (const std::exception& e) {
96 throw ::hpp::Error (e.what());
97 }
98 }
99
100 template <typename _Base, typename _Storage>
101 char* ConstraintServant<_Base, _Storage>::str ()
102 {
103 try {
104 // automatically generated code.
105 std::ostringstream oss; oss << *get();
106 std::string res = oss.str();
107 return CORBA::string_dup(res.c_str());
108 } catch (const std::exception& e) {
109 throw ::hpp::Error (e.what());
110 }
111 }
112
113 template <typename _Base, typename _Storage>
114 ::CORBA::Boolean ConstraintServant<_Base, _Storage>::isSatisfied (const hpp::floatSeq& config)
115 {
116 try {
117 // automatically generated code.
118 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
119 ::CORBA::Boolean __return__ (getT()->isSatisfied (_config));
120
121 return __return__;
122 } catch (const std::exception& e) {
123 throw ::hpp::Error (e.what());
124 }
125 }
126
127 template <typename _Base, typename _Storage>
128 hpp::core_idl::Constraint_ptr ConstraintServant<_Base, _Storage>::copy ()
129 {
130 try {
131 // automatically generated code.
132
133 hpp::core::ConstraintPtr_t __return__ (getT()->copy ());
134
135 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Constraint,hpp::core_impl::Constraint>(server_, __return__)._retn();
136 } catch (const std::exception& e) {
137 throw ::hpp::Error (e.what());
138 }
139 }
140
141 // End of implementational code
142 } // namespace core_impl
143
144 } // namespace hpp
145
146 //
147 // Implementational code for IDL interface hpp::core_idl::ConfigProjector
148 //
149 namespace hpp {
150
151 namespace core_impl {
152 template <typename _Base, typename _Storage>
153 3 ConfigProjectorServant<_Base, _Storage>::ConfigProjectorServant(::hpp::corbaServer::Server* server,
154 const _Storage& s)
155
2/4
✓ Branch 4 taken 3 times.
✗ Branch 5 not taken.
✓ Branch 9 taken 3 times.
✗ Branch 10 not taken.
3 : hpp::core_impl::ConstraintServant<_Base, _Storage> (server, s)
156 {
157 // add extra constructor code here
158 3 }
159 template <typename _Base, typename _Storage>
160 12 ConfigProjectorServant<_Base, _Storage>::~ConfigProjectorServant()
161 {
162 // add extra destructor code here
163 12 }
164
165 // Methods corresponding to IDL attributes and operations
166
167 template <typename _Base, typename _Storage>
168 void ConfigProjectorServant<_Base, _Storage>::setRightHandSideFromConfig (const hpp::floatSeq& config)
169 {
170 try {
171 // automatically generated code.
172 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
173 (getT()->rightHandSideFromConfig (_config));
174
175
176 } catch (const std::exception& e) {
177 throw ::hpp::Error (e.what());
178 }
179 }
180
181 template <typename _Base, typename _Storage>
182 void ConfigProjectorServant<_Base, _Storage>::setRightHandSideOfConstraintFromConfig (hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq& config)
183 {
184 try {
185 // automatically generated code.
186 hpp::constraints::ImplicitPtr_t _nm = ::hpp::corbaServer::reference_to_object<hpp::constraints::Implicit>(server_, nm);
187 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
188 (getT()->rightHandSideFromConfig (_nm, _config));
189
190
191 } catch (const std::exception& e) {
192 throw ::hpp::Error (e.what());
193 }
194 }
195
196 template <typename _Base, typename _Storage>
197 void ConfigProjectorServant<_Base, _Storage>::setRightHandSide (const hpp::floatSeq& param)
198 {
199 try {
200 // automatically generated code.
201 hpp::core::vector_t _param = hpp::corbaServer::floatSeqToVector (param);
202 (getT()->rightHandSide (_param));
203
204
205 } catch (const std::exception& e) {
206 throw ::hpp::Error (e.what());
207 }
208 }
209
210 template <typename _Base, typename _Storage>
211 void ConfigProjectorServant<_Base, _Storage>::setRightHandSideOfConstraint (hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq& rhs)
212 {
213 try {
214 // automatically generated code.
215 hpp::constraints::ImplicitPtr_t _nm = ::hpp::corbaServer::reference_to_object<hpp::constraints::Implicit>(server_, nm);
216 hpp::core::vector_t _rhs = hpp::corbaServer::floatSeqToVector (rhs);
217 (getT()->rightHandSide (_nm, _rhs));
218
219
220 } catch (const std::exception& e) {
221 throw ::hpp::Error (e.what());
222 }
223 }
224
225 template <typename _Base, typename _Storage>
226 hpp::floatSeq* ConfigProjectorServant<_Base, _Storage>::getRightHandSide ()
227 {
228 try {
229 // automatically generated code.
230
231 hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->rightHandSide ());
232
233 return __return__;
234 } catch (const std::exception& e) {
235 throw ::hpp::Error (e.what());
236 }
237 }
238
239 template <typename _Base, typename _Storage>
240 void ConfigProjectorServant<_Base, _Storage>::setRightHandSideAt (hpp::value_type s)
241 {
242 try {
243 // automatically generated code.
244
245 (getT()->rightHandSideAt (s));
246
247
248 } catch (const std::exception& e) {
249 throw ::hpp::Error (e.what());
250 }
251 }
252
253 template <typename _Base, typename _Storage>
254 ::CORBA::Boolean ConfigProjectorServant<_Base, _Storage>::isConstraintSatisfied (hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq& arg, hpp::floatSeq_out err, ::CORBA::Boolean& constraintFound)
255 {
256 try {
257 // generated from /root/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-6.0.0/idl/hpp/core_idl/_constraints.idl:40
258 hpp::core::vector_t _arg = hpp::corbaServer::floatSeqToVector (arg);
259 hpp::constraints::ImplicitPtr_t _nm = hpp::corbaServer::reference_to_servant_base<hpp::constraints::Implicit>(server_, nm)->get();
260 hpp::core::vector_t errorOut (_nm->function ().outputSpace ()->nv ());
261 bool res = getT ()->solver ().isConstraintSatisfied
262 (_nm, _arg,errorOut, constraintFound);
263 err = hpp::corbaServer::vectorToFloatSeq (errorOut);
264 return res;
265
266 } catch (const std::exception& e) {
267 throw ::hpp::Error (e.what());
268 }
269 }
270
271 template <typename _Base, typename _Storage>
272 hpp::constraints_idl::Implicits* ConfigProjectorServant<_Base, _Storage>::numericalConstraints ()
273 {
274 try {
275 // automatically generated code.
276
277 hpp::constraints_idl::Implicits* __return__ = hpp::corbaServer::vectorToSeqServant<hpp::constraints_idl::Implicits,hpp::constraints_impl::Implicit,hpp::constraints_impl::Implicit>(server_) (getT()->numericalConstraints ());
278
279 return __return__;
280 } catch (const std::exception& e) {
281 throw ::hpp::Error (e.what());
282 }
283 }
284
285 template <typename _Base, typename _Storage>
286 ::CORBA::Boolean ConfigProjectorServant<_Base, _Storage>::add (hpp::constraints_idl::Implicit_ptr numconstraint, ::CORBA::ULong priority)
287 {
288 try {
289 // automatically generated code.
290 hpp::constraints::ImplicitPtr_t _numconstraint = ::hpp::corbaServer::reference_to_object<hpp::constraints::Implicit>(server_, numconstraint);
291 ::CORBA::Boolean __return__ (getT()->add (_numconstraint, priority));
292
293 return __return__;
294 } catch (const std::exception& e) {
295 throw ::hpp::Error (e.what());
296 }
297 }
298
299 template <typename _Base, typename _Storage>
300 void ConfigProjectorServant<_Base, _Storage>::setLastIsOptional (::CORBA::Boolean optional)
301 {
302 try {
303 // automatically generated code.
304
305 (getT()->lastIsOptional (optional));
306
307
308 } catch (const std::exception& e) {
309 throw ::hpp::Error (e.what());
310 }
311 }
312
313 template <typename _Base, typename _Storage>
314 ::CORBA::Boolean ConfigProjectorServant<_Base, _Storage>::getLastIsOptional ()
315 {
316 try {
317 // automatically generated code.
318
319 ::CORBA::Boolean __return__ (getT()->lastIsOptional ());
320
321 return __return__;
322 } catch (const std::exception& e) {
323 throw ::hpp::Error (e.what());
324 }
325 }
326
327 template <typename _Base, typename _Storage>
328 void ConfigProjectorServant<_Base, _Storage>::setErrorThreshold (hpp::value_type threshold)
329 {
330 try {
331 // automatically generated code.
332
333 (getT()->errorThreshold (threshold));
334
335
336 } catch (const std::exception& e) {
337 throw ::hpp::Error (e.what());
338 }
339 }
340
341 template <typename _Base, typename _Storage>
342 hpp::value_type ConfigProjectorServant<_Base, _Storage>::getErrorThreshold ()
343 {
344 try {
345 // automatically generated code.
346
347 hpp::value_type __return__ (getT()->errorThreshold ());
348
349 return __return__;
350 } catch (const std::exception& e) {
351 throw ::hpp::Error (e.what());
352 }
353 }
354
355 // End of implementational code
356 } // namespace core_impl
357
358 } // namespace hpp
359
360 //
361 // Implementational code for IDL interface hpp::core_idl::ConstraintSet
362 //
363 namespace hpp {
364
365 namespace core_impl {
366 template <typename _Base, typename _Storage>
367 1 ConstraintSetServant<_Base, _Storage>::ConstraintSetServant(::hpp::corbaServer::Server* server,
368 const _Storage& s)
369
2/4
✓ Branch 4 taken 1 times.
✗ Branch 5 not taken.
✓ Branch 9 taken 1 times.
✗ Branch 10 not taken.
1 : hpp::core_impl::ConstraintServant<_Base, _Storage> (server, s)
370 {
371 // add extra constructor code here
372 1 }
373 template <typename _Base, typename _Storage>
374 4 ConstraintSetServant<_Base, _Storage>::~ConstraintSetServant()
375 {
376 // add extra destructor code here
377 4 }
378
379 // Methods corresponding to IDL attributes and operations
380
381 template <typename _Base, typename _Storage>
382 3 hpp::core_idl::Constraint_ptr ConstraintSetServant<_Base, _Storage>::getConfigProjector ()
383 {
384 try {
385 // automatically generated code.
386
387
2/4
✓ Branch 1 taken 3 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
6 hpp::core::ConstraintPtr_t __return__ (getT()->configProjector ());
388
389
2/4
✓ Branch 2 taken 3 times.
✗ Branch 3 not taken.
✓ Branch 5 taken 3 times.
✗ Branch 6 not taken.
6 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Constraint,hpp::core_impl::Constraint>(server_, __return__)._retn();
390
0/2
✗ Branch 2 not taken.
✗ Branch 3 not taken.
3 } catch (const std::exception& e) {
391 throw ::hpp::Error (e.what());
392 }
393 }
394
395 template <typename _Base, typename _Storage>
396 1 void ConstraintSetServant<_Base, _Storage>::addConstraint (hpp::core_idl::Constraint_ptr a_constraint)
397 {
398 try {
399 // automatically generated code.
400
1/2
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
1 hpp::core::ConstraintPtr_t _a_constraint = ::hpp::corbaServer::reference_to_object<hpp::core::Constraint>(server_, a_constraint);
401
2/4
✓ Branch 1 taken 1 times.
✗ Branch 2 not taken.
✓ Branch 5 taken 1 times.
✗ Branch 6 not taken.
1 (getT()->addConstraint (_a_constraint));
402
403
404
0/2
✗ Branch 2 not taken.
✗ Branch 3 not taken.
1 } catch (const std::exception& e) {
405 throw ::hpp::Error (e.what());
406 }
407 1 }
408
409 // End of implementational code
410 } // namespace core_impl
411
412 } // namespace hpp
413
414
415
416
417
418 #endif // hpp_core_idl____constraints_hxx__
419
420