hpp-corbaserver  4.9.0
Corba server for Humanoid Path Planner applications
client.hh
Go to the documentation of this file.
1 // Copyright (C) 2015 by Joseph Mirabel
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_CORBASERVER_CLIENT_HH
12 # define HPP_CORBASERVER_CLIENT_HH
13 
14 # include <omniORB4/CORBA.h>
15 # include <string>
16 
17 # include <hpp/corbaserver/tools-idl.hh>
18 # include <hpp/corbaserver/robot-idl.hh>
19 # include <hpp/corbaserver/problem-idl.hh>
20 # include <hpp/corbaserver/obstacle-idl.hh>
21 
22 # include <hpp/corbaserver/config.hh>
23 
24 namespace hpp
25 {
26  namespace corbaServer
27  {
28  class HPP_CORBASERVER_DLLAPI ClientBase
29  {
30  public:
31  ClientBase (int argc, char* argv[]);
32 
33  virtual ~ClientBase ();
34 
37  void connect (const std::string& iiop = "corbaloc:iiop:");
38 
39  hpp::Tools_var& tools () {
40  return tools_;
41  }
42 
43  private:
44  bool createFromDirectLink(const std::string& iiop);
45  bool createFromNameService(const std::string& iiop);
46 
47  hpp::Tools_var tools_;
48  CORBA::ORB_var orb_;
49  };
50 
51  class HPP_CORBASERVER_DLLAPI Client : public ClientBase
52  {
53  public:
54  Client (int argc, char* argv[]);
55 
56  ~Client ();
57 
60  void connect (const char* iiop = "corbaloc:iiop:",
61  const char* context = "corbaserver");
62 
63  hpp::corbaserver::Robot_var& robot () {
64  return robot_;
65  }
66 
67  hpp::corbaserver::Problem_var& problem () {
68  return problem_;
69  }
70 
71  hpp::corbaserver::Obstacle_var& obstacle () {
72  return obstacle_;
73  }
74 
75  private:
76  void createClientsFromTools ();
77 
78  hpp::corbaserver::Robot_var robot_;
79  hpp::corbaserver::Problem_var problem_;
80  hpp::corbaserver::Obstacle_var obstacle_;
81 
82  CORBA::ORB_var orb_;
83  };
84 
85  } // end of namespace corbaServer.
86 } // end of namespace hpp.
87 #endif
hpp::corbaserver::Robot_var & robot()
Definition: client.hh:63
DevicePtr_t robot_
Definition: client.hh:51
Implement CORBA interface ``Obstacle&#39;&#39;.
Definition: client.hh:28
hpp::corbaserver::Problem_var & problem()
Definition: client.hh:67
hpp::Tools_var & tools()
Definition: client.hh:39
hpp::corbaserver::Obstacle_var & obstacle()
Definition: client.hh:71