hpp-corbaserver 4.14.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 /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.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 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
45 ::CORBA::Boolean __return__ (getT()->apply (_config));
46 hpp::corbaServer::vectorToFloatSeq (_config, config);
47 return __return__;
48 } catch (const std::exception& e) {
49 throw ::hpp::Error (e.what());
50 }
51}
52
53template <typename _Base, typename _Storage>
55{
56 try {
57 // automatically generated code.
58
59 char* __return__ = ::hpp::corbaServer::c_str (getT()->name ());
60
61 return __return__;
62 } catch (const std::exception& e) {
63 throw ::hpp::Error (e.what());
64 }
65}
66
67template <typename _Base, typename _Storage>
69{
70 try {
71 // automatically generated code.
72 std::ostringstream oss; oss << *get();
73 std::string res = oss.str();
74 return CORBA::string_dup(res.c_str());
75 } catch (const std::exception& e) {
76 throw ::hpp::Error (e.what());
77 }
78}
79
80template <typename _Base, typename _Storage>
82{
83 try {
84 // automatically generated code.
85 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
86 ::CORBA::Boolean __return__ (getT()->isSatisfied (_config));
87
88 return __return__;
89 } catch (const std::exception& e) {
90 throw ::hpp::Error (e.what());
91 }
92}
93
94template <typename _Base, typename _Storage>
95hpp::core_idl::Constraint_ptr ConstraintServant<_Base, _Storage>::copy ()
96{
97 try {
98 // automatically generated code.
99
100 hpp::core::ConstraintPtr_t __return__ (getT()->copy ());
101
102 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Constraint,hpp::core_impl::Constraint>(server_, __return__)._retn();
103 } catch (const std::exception& e) {
104 throw ::hpp::Error (e.what());
105 }
106}
107
108// End of implementational code
109} // namespace core_impl
110
111} // namespace hpp
112
113//
114// Implementational code for IDL interface hpp::core_idl::ConfigProjector
115//
116namespace hpp {
117
118namespace core_impl {
119template <typename _Base, typename _Storage>
121 const _Storage& s)
122 : hpp::core_impl::ConstraintServant<_Base, _Storage> (server, s)
123{
124 // add extra constructor code here
125}
126template <typename _Base, typename _Storage>
128{
129 // add extra destructor code here
130}
131
132// Methods corresponding to IDL attributes and operations
133
134template <typename _Base, typename _Storage>
136{
137 try {
138 // automatically generated code.
139 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
140 (getT()->rightHandSideFromConfig (_config));
141
142
143 } catch (const std::exception& e) {
144 throw ::hpp::Error (e.what());
145 }
146}
147
148template <typename _Base, typename _Storage>
150{
151 try {
152 // automatically generated code.
153 hpp::constraints::ImplicitPtr_t _nm = ::hpp::corbaServer::reference_to_object<hpp::constraints::Implicit>(server_, nm);
154 hpp::core::vector_t _config = hpp::corbaServer::floatSeqToVector (config);
155 (getT()->rightHandSideFromConfig (_nm, _config));
156
157
158 } catch (const std::exception& e) {
159 throw ::hpp::Error (e.what());
160 }
161}
162
163template <typename _Base, typename _Storage>
165{
166 try {
167 // automatically generated code.
168 hpp::core::vector_t _param = hpp::corbaServer::floatSeqToVector (param);
169 (getT()->rightHandSide (_param));
170
171
172 } catch (const std::exception& e) {
173 throw ::hpp::Error (e.what());
174 }
175}
176
177template <typename _Base, typename _Storage>
178void ConfigProjectorServant<_Base, _Storage>::setRightHandSideOfConstraint (hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq& rhs)
179{
180 try {
181 // automatically generated code.
182 hpp::constraints::ImplicitPtr_t _nm = ::hpp::corbaServer::reference_to_object<hpp::constraints::Implicit>(server_, nm);
183 hpp::core::vector_t _rhs = hpp::corbaServer::floatSeqToVector (rhs);
184 (getT()->rightHandSide (_nm, _rhs));
185
186
187 } catch (const std::exception& e) {
188 throw ::hpp::Error (e.what());
189 }
190}
191
192template <typename _Base, typename _Storage>
194{
195 try {
196 // automatically generated code.
197
198 hpp::floatSeq* __return__ = hpp::corbaServer::vectorToFloatSeq (getT()->rightHandSide ());
199
200 return __return__;
201 } catch (const std::exception& e) {
202 throw ::hpp::Error (e.what());
203 }
204}
205
206template <typename _Base, typename _Storage>
208{
209 try {
210 // automatically generated code.
211
212 (getT()->rightHandSideAt (s));
213
214
215 } catch (const std::exception& e) {
216 throw ::hpp::Error (e.what());
217 }
218}
219
220template <typename _Base, typename _Storage>
221::CORBA::Boolean ConfigProjectorServant<_Base, _Storage>::isConstraintSatisfied (hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq& arg, hpp::floatSeq_out err, ::CORBA::Boolean& constraintFound)
222{
223 try {
224 // generated from /local/robotpkg/var/tmp/robotpkg/path/py-hpp-corbaserver/work/hpp-corbaserver-4.14.0/idl/hpp/core_idl/_constraints.idl:38
225 hpp::core::vector_t _arg = hpp::corbaServer::floatSeqToVector (arg);
226 hpp::constraints::ImplicitPtr_t _nm = hpp::corbaServer::reference_to_servant_base<hpp::constraints::Implicit>(server_, nm)->get();
227 hpp::core::vector_t errorOut (_nm->function ().outputSpace ()->nv ());
228 bool res = getT ()->solver ().isConstraintSatisfied
229 (_nm, _arg,errorOut, constraintFound);
230 err = hpp::corbaServer::vectorToFloatSeq (errorOut);
231 return res;
232
233 } catch (const std::exception& e) {
234 throw ::hpp::Error (e.what());
235 }
236}
237
238template <typename _Base, typename _Storage>
240{
241 try {
242 // automatically generated code.
243
245
246 return __return__;
247 } catch (const std::exception& e) {
248 throw ::hpp::Error (e.what());
249 }
250}
251
252template <typename _Base, typename _Storage>
253::CORBA::Boolean ConfigProjectorServant<_Base, _Storage>::add (hpp::constraints_idl::Implicit_ptr numconstraint, ::CORBA::ULong priority)
254{
255 try {
256 // automatically generated code.
257 hpp::constraints::ImplicitPtr_t _numconstraint = ::hpp::corbaServer::reference_to_object<hpp::constraints::Implicit>(server_, numconstraint);
258 ::CORBA::Boolean __return__ (getT()->add (_numconstraint, priority));
259
260 return __return__;
261 } catch (const std::exception& e) {
262 throw ::hpp::Error (e.what());
263 }
264}
265
266template <typename _Base, typename _Storage>
268{
269 try {
270 // automatically generated code.
271
272 (getT()->lastIsOptional (optional));
273
274
275 } catch (const std::exception& e) {
276 throw ::hpp::Error (e.what());
277 }
278}
279
280template <typename _Base, typename _Storage>
282{
283 try {
284 // automatically generated code.
285
286 ::CORBA::Boolean __return__ (getT()->lastIsOptional ());
287
288 return __return__;
289 } catch (const std::exception& e) {
290 throw ::hpp::Error (e.what());
291 }
292}
293
294template <typename _Base, typename _Storage>
296{
297 try {
298 // automatically generated code.
299
300 (getT()->errorThreshold (threshold));
301
302
303 } catch (const std::exception& e) {
304 throw ::hpp::Error (e.what());
305 }
306}
307
308template <typename _Base, typename _Storage>
310{
311 try {
312 // automatically generated code.
313
314 hpp::value_type __return__ (getT()->errorThreshold ());
315
316 return __return__;
317 } catch (const std::exception& e) {
318 throw ::hpp::Error (e.what());
319 }
320}
321
322// End of implementational code
323} // namespace core_impl
324
325} // namespace hpp
326
327//
328// Implementational code for IDL interface hpp::core_idl::ConstraintSet
329//
330namespace hpp {
331
332namespace core_impl {
333template <typename _Base, typename _Storage>
335 const _Storage& s)
336 : hpp::core_impl::ConstraintServant<_Base, _Storage> (server, s)
337{
338 // add extra constructor code here
339}
340template <typename _Base, typename _Storage>
342{
343 // add extra destructor code here
344}
345
346// Methods corresponding to IDL attributes and operations
347
348template <typename _Base, typename _Storage>
350{
351 try {
352 // automatically generated code.
353
354 hpp::core::ConstraintPtr_t __return__ (getT()->configProjector ());
355
356 return ::hpp::corbaServer::makeServantDownCast<hpp::core_impl::Constraint,hpp::core_impl::Constraint>(server_, __return__)._retn();
357 } catch (const std::exception& e) {
358 throw ::hpp::Error (e.what());
359 }
360}
361
362// End of implementational code
363} // namespace core_impl
364
365} // namespace hpp
366
367
368
369
370
371#endif // hpp_core_idl____constraints_hxx__
372
Implementation of Hpp module Corba server.
Definition: server.hh:77
virtual ~ConfigProjectorServant()
Definition: _constraints.hh:127
void setRightHandSideOfConstraintFromConfig(hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq &config)
Definition: _constraints.hh:149
hpp::value_type getErrorThreshold()
Definition: _constraints.hh:309
hpp::constraints_idl::Implicits * numericalConstraints()
Definition: _constraints.hh:239
::CORBA::Boolean add(hpp::constraints_idl::Implicit_ptr numconstraint, ::CORBA::ULong priority)
Definition: _constraints.hh:253
::CORBA::Boolean isConstraintSatisfied(hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq &arg, hpp::floatSeq_out err, ::CORBA::Boolean &constraintFound)
Definition: _constraints.hh:221
void setRightHandSideFromConfig(const hpp::floatSeq &config)
Definition: _constraints.hh:135
void setRightHandSideAt(hpp::value_type s)
Definition: _constraints.hh:207
ConfigProjectorServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: _constraints.hh:120
hpp::floatSeq * getRightHandSide()
Definition: _constraints.hh:193
void setRightHandSide(const hpp::floatSeq &param)
Definition: _constraints.hh:164
void setLastIsOptional(::CORBA::Boolean optional)
Definition: _constraints.hh:267
void setRightHandSideOfConstraint(hpp::constraints_idl::Implicit_ptr nm, const hpp::floatSeq &rhs)
Definition: _constraints.hh:178
void setErrorThreshold(hpp::value_type threshold)
Definition: _constraints.hh:295
::CORBA::Boolean getLastIsOptional()
Definition: _constraints.hh:281
Definition: _constraints-fwd.hh:30
char * name()
Definition: _constraints.hh:54
virtual ~ConstraintServant()
Definition: _constraints.hh:32
::CORBA::Boolean apply(hpp::floatSeq &config)
Definition: _constraints.hh:40
hpp::core_idl::Constraint_ptr copy()
Definition: _constraints.hh:95
char * str()
Definition: _constraints.hh:68
::CORBA::Boolean isSatisfied(const hpp::floatSeq &config)
Definition: _constraints.hh:81
ConstraintServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: _constraints.hh:25
virtual ~ConstraintSetServant()
Definition: _constraints.hh:341
ConstraintSetServant(::hpp::corbaServer::Server *server, const _Storage &s)
Definition: _constraints.hh:334
hpp::core_idl::Constraint_ptr getConfigProjector()
Definition: _constraints.hh:349
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:92
Implement CORBA interface `‘Obstacle’'.
Definition: basic-server.hh:35
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:34
double value_type
Definition: common.idl:18
Definition: servant-base.hh:436