hpp-corbaserver 6.0.0
Corba server for Humanoid Path Planner applications
Loading...
Searching...
No Matches
_constraints.hh
Go to the documentation of this file.
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
9
10#include <sstream>
11
15
16
17
18//
19// Implementational code for IDL interface hpp::core_idl::Constraint
20//
21namespace hpp {
22
23namespace core_impl {
24template <typename _Base, typename _Storage>
26 const _Storage& s)
27 : hpp::corbaServer::ServantBase<hpp::core::Constraint, _Storage> (server, s)
28{
29 // add extra constructor code here
30}
31template <typename _Base, typename _Storage>
33{
34 // add extra destructor code here
35}
36
37// Methods corresponding to IDL attributes and operations
38
39template <typename _Base, typename _Storage>
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
50template <typename _Base, typename _Storage>
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
61template <typename _Base, typename _Storage>
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
72template <typename _Base, typename _Storage>
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
86template <typename _Base, typename _Storage>
88{
89 try {
90 // automatically generated code.
91
92 char* __return__ = ::hpp::corbaServer::c_str (getT()->name ());
93
94 return __return__;
95 } catch (const std::exception& e) {
96 throw ::hpp::Error (e.what());
97 }
98}
99
100template <typename _Base, typename _Storage>
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
113template <typename _Base, typename _Storage>
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
127template <typename _Base, typename _Storage>
128hpp::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//
149namespace hpp {
150
151namespace core_impl {
152template <typename _Base, typename _Storage>
154 const _Storage& s)
155 : hpp::core_impl::ConstraintServant<_Base, _Storage> (server, s)
156{
157 // add extra constructor code here
158}
159template <typename _Base, typename _Storage>
161{
162 // add extra destructor code here
163}
164
165// Methods corresponding to IDL attributes and operations
166
167template <typename _Base, typename _Storage>
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
181template <typename _Base, typename _Storage>
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
196template <typename _Base, typename _Storage>
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
210template <typename _Base, typename _Storage>
211void 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
225template <typename _Base, typename _Storage>
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
239template <typename _Base, typename _Storage>
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
253template <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
271template <typename _Base, typename _Storage>
273{
274 try {
275 // automatically generated code.
276
278
279 return __return__;
280 } catch (const std::exception& e) {
281 throw ::hpp::Error (e.what());
282 }
283}
284
285template <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
299template <typename _Base, typename _Storage>
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
313template <typename _Base, typename _Storage>
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
327template <typename _Base, typename _Storage>
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
341template <typename _Base, typename _Storage>
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//
363namespace hpp {
364
365namespace core_impl {
366template <typename _Base, typename _Storage>
368 const _Storage& s)
369 : hpp::core_impl::ConstraintServant<_Base, _Storage> (server, s)
370{
371 // add extra constructor code here
372}
373template <typename _Base, typename _Storage>
375{
376 // add extra destructor code here
377}
378
379// Methods corresponding to IDL attributes and operations
380
381template <typename _Base, typename _Storage>
383{
384 try {
385 // automatically generated code.
386
387 hpp::core::ConstraintPtr_t __return__ (getT()->configProjector ());
388
389 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Constraint,hpp::core_impl::Constraint>(server_, __return__)._retn();
390 } catch (const std::exception& e) {
391 throw ::hpp::Error (e.what());
392 }
393}
394
395template <typename _Base, typename _Storage>
396void ConstraintSetServant<_Base, _Storage>::addConstraint (hpp::core_idl::Constraint_ptr a_constraint)
397{
398 try {
399 // automatically generated code.
400 hpp::core::ConstraintPtr_t _a_constraint = ::hpp::corbaServer::reference_to_object<hpp::core::Constraint>(server_, a_constraint);
401 (getT()->addConstraint (_a_constraint));
402
403
404 } catch (const std::exception& e) {
405 throw ::hpp::Error (e.what());
406 }
407}
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
bool persistantStorage() const
See persistantStorage(bool)
Definition servant-base.hh:166
Implementation of Hpp module Corba server.
Definition server.hh:78
virtual ~ConfigProjectorServant()
Definition _constraints.hh:160
void setRightHandSideOfConstraintFromConfig(hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq &config)
Definition _constraints.hh:182
hpp::value_type getErrorThreshold()
Definition _constraints.hh:342
hpp::constraints_idl::Implicits * numericalConstraints()
Definition _constraints.hh:272
::CORBA::Boolean add(hpp::constraints_idl::Implicit_ptr numconstraint, ::CORBA::ULong priority)
Definition _constraints.hh:286
::CORBA::Boolean isConstraintSatisfied(hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq &arg, hpp::floatSeq_out err, ::CORBA::Boolean &constraintFound)
Definition _constraints.hh:254
void setRightHandSideFromConfig(const hpp::floatSeq &config)
Definition _constraints.hh:168
void setRightHandSideAt(hpp::value_type s)
Definition _constraints.hh:240
ConfigProjectorServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition _constraints.hh:153
hpp::floatSeq * getRightHandSide()
Definition _constraints.hh:226
void setRightHandSide(const hpp::floatSeq &param)
Definition _constraints.hh:197
void setLastIsOptional(::CORBA::Boolean optional)
Definition _constraints.hh:300
void setRightHandSideOfConstraint(hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq &rhs)
Definition _constraints.hh:211
void setErrorThreshold(hpp::value_type threshold)
Definition _constraints.hh:328
::CORBA::Boolean getLastIsOptional()
Definition _constraints.hh:314
Definition _constraints-fwd.hh:30
char * name()
Definition _constraints.hh:87
::CORBA::Boolean deleteIfExpired()
Definition _constraints.hh:51
void deleteThis()
Definition _constraints.hh:40
virtual ~ConstraintServant()
Definition _constraints.hh:32
::CORBA::Boolean apply(hpp::floatSeq &config)
Definition _constraints.hh:73
hpp::core_idl::Constraint_ptr copy()
Definition _constraints.hh:128
char * str()
Definition _constraints.hh:101
::CORBA::Boolean isSatisfied(const hpp::floatSeq &config)
Definition _constraints.hh:114
ConstraintServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition _constraints.hh:25
void addConstraint(hpp::core_idl::Constraint_ptr a_constraint)
Definition _constraints.hh:396
virtual ~ConstraintSetServant()
Definition _constraints.hh:374
ConstraintSetServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition _constraints.hh:367
hpp::core_idl::Constraint_ptr getConfigProjector()
Definition _constraints.hh:382
ReturnType::Object_var makeServantDownCast(Server *server, const typename ServantBaseType::Storage &t)
Definition servant-base.hh:407
sequence< Implicit > Implicits
Definition _constraints.idl:21
floatSeq * vectorToFloatSeq(core::vectorIn_t input)
vector_t floatSeqToVector(const floatSeq &dofArray, const size_type expectedSize=-1)
char * c_str(const std::string &in)
Definition conversions.hh:87
Implement CORBA interface `‘Obstacle’'.
Definition client.hh:46
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition common.idl:34
double value_type
Definition common.idl:18