hpp-corbaserver  4.9.0
Corba server for Humanoid Path Planner applications
path-validations.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_PATH_VALIATIONS_HH
12 # define HPP_CORE_IDL_PATH_VALIATIONS_HH
13 
14 # include <vector>
15 # include <stdlib.h>
16 
19 
20 # include <hpp/corbaserver/fwd.hh>
22 # include "hpp/core_idl/path_validations-idl.hh"
23 
26 
27 namespace hpp
28 {
29  namespace corbaServer
30  {
31  namespace core_idl
32  {
33  template <typename _Base, typename _Storage>
34  class PathValidationServant : public ServantBase<core::PathValidation, _Storage>, public virtual _Base
35  {
37 
38  public:
39  PathValidationServant (Server* server, const Storage& s) :
40  _ServantBase (server, s) {}
41 
42  virtual ~PathValidationServant () {}
43 
44  CORBA::Boolean validate (hpp::core_idl::Path_ptr path,
45  CORBA::Boolean reverse,
46  hpp::core_idl::Path_out validPart,
47  hpp::core_idl::PathValidationReport_out report)
48  {
49  core::PathPtr_t p (reference_to_servant_base<core::Path>(server_, path)->get());
50  core::PathPtr_t vp;
52 
53  bool res = get()->validate (p, reverse, vp, pvr);
54 
55  if (pvr) {
56  std::ostringstream oss; oss << *pvr;
57  std::string res = oss.str();
58  report = CORBA::string_dup(res.c_str());
59  } else {
60  report = CORBA::string_dup("");
61  }
62 
63  validPart = makeServant<hpp::core_idl::Path_ptr> (server_, new Path (server_, vp));
64  return res;
65  }
66  };
67 
69 
70  } // end of namespace core.
71  } // end of namespace corbaServer.
72 } // end of namespace hpp.
73 
74 #endif // HPP_CORE_IDL_PATH_VALIATIONS_HH
Definition: servant-base.hh:100
boost::shared_ptr< Path > PathPtr_t
virtual ~PathValidationServant()
Definition: path-validations.hh:42
Implement CORBA interface ``Obstacle&#39;&#39;.
PathServant< POA_hpp::core_idl::Path, core::PathPtr_t > Path
Definition: paths.hh:86
Definition: path_validations.idl:22
Definition: path-validations.hh:34
PathValidationServant(Server *server, const Storage &s)
Definition: path-validations.hh:39
Implementation of Hpp module Corba server.
Definition: server.hh:54
PathValidationServant< POA_hpp::core_idl::PathValidation, core::PathValidationPtr_t > PathValidation
Definition: path-validations.hh:68
boost::shared_ptr< PathValidationReport > PathValidationReportPtr_t
CORBA::Boolean validate(hpp::core_idl::Path_ptr path, CORBA::Boolean reverse, hpp::core_idl::Path_out validPart, hpp::core_idl::PathValidationReport_out report)
Definition: path-validations.hh:44