hpp-corbaserver  4.9.0
Corba server for Humanoid Path Planner applications
steering-methods.hh
Go to the documentation of this file.
1 // Copyright (C) 2019 by Joseph Mirabel, LAAS-CNRS.
2 //
3 // This file is part of the hpp-corbaserver.
4 //
5 // This software is provided "as is" without warranty of any kind,
6 // either expressed or implied, including but not limited to the
7 // implied warranties of fitness for a particular purpose.
8 //
9 // See the COPYING file for more information.
10 
11 #ifndef HPP_CORE_IDL_STEERING_METHODS_HH
12 # define HPP_CORE_IDL_STEERING_METHODS_HH
13 
14 # include <vector>
15 # include <stdlib.h>
16 
18 
19 # include <hpp/corbaserver/fwd.hh>
21 # include "hpp/core_idl/steering_methods-idl.hh"
22 
24 
26 
27 namespace hpp
28 {
29  namespace corbaServer
30  {
31  namespace core_idl
32  {
33  template <typename D>
34  class SteeringMethodStorage : public AbstractStorage<D, core::SteeringMethod>
35  {
36  public:
38  using parent_t::element;
39  using typename parent_t::ptr_t;
40 
43  : parent_t(_d), r(_r) {}
44 
45  template <typename T> SteeringMethodStorage<T> cast () const
46  {
48  }
49  };
50 
51  template <typename _Base, typename _Storage>
52  class SteeringMethodServant : public ServantBase<core::SteeringMethod, _Storage>, public virtual _Base
53  {
55 
56  public:
57  SteeringMethodServant (Server* server, const Storage& s) :
58  _ServantBase (server, s) {}
59 
60  virtual ~SteeringMethodServant () {}
61 
62  hpp::core_idl::Path_ptr call (const floatSeq& q1, const floatSeq& q2)
63  {
64  Configuration_t qq1 (floatSeqToConfig(getS().r, q1, true)),
65  qq2 (floatSeqToConfig(getS().r, q2, true));
66  hpp::core_idl::Path_var p =
67  makeServantDownCast<core_idl::Path> (server_, (*get()) (qq1,qq2));
68  return p._retn();
69  }
70  };
71 
73  } // end of namespace core.
74  } // end of namespace corbaServer.
75 } // end of namespace hpp.
76 
77 #endif // HPP_CORE_IDL_STEERING_METHODS_HH
Definition: servant-base.hh:100
boost::weak_ptr< T > ptr_t
Definition: servant-base.hh:209
pinocchio::DevicePtr_t DevicePtr_t
Implement CORBA interface ``Obstacle&#39;&#39;.
#define SERVANT_BASE_TYPEDEFS(idlObj, hppObj)
Definition: servant-base.hh:54
boost::weak_ptr< D > ptr_t
Definition: servant-base.hh:209
AbstractStorage< D, core::SteeringMethod > parent_t
Definition: steering-methods.hh:37
SteeringMethodStorage(const core::DevicePtr_t &_r, const ptr_t &_d)
Definition: steering-methods.hh:42
SteeringMethodStorage< T > cast() const
Definition: steering-methods.hh:45
#define HPP_DYNAMIC_PTR_CAST(t, x)
SteeringMethodServant(Server *server, const Storage &s)
Definition: steering-methods.hh:57
Definition: servant-base.hh:206
pinocchio::Configuration_t Configuration_t
Definition: fwd.hh:43
virtual ~SteeringMethodServant()
Definition: steering-methods.hh:60
core::DevicePtr_t r
Definition: steering-methods.hh:41
Definition: steering_methods.idl:22
Implementation of Hpp module Corba server.
Definition: server.hh:54
hpp::core_idl::Path_ptr call(const floatSeq &q1, const floatSeq &q2)
Definition: steering-methods.hh:62
Definition: steering-methods.hh:34
SteeringMethodServant< POA_hpp::core_idl::SteeringMethod, SteeringMethodStorage< core::SteeringMethod > > SteeringMethod
Definition: steering-methods.hh:72
Configuration_t floatSeqToConfig(const DevicePtr_t &robot, const floatSeq &dofArray, bool throwIfNotNormalized)
sequence< double > floatSeq
Robot configuration is defined by a sequence of dof value.
Definition: common.idl:32
Definition: steering-methods.hh:52