hpp-corbaserver  6.0.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 
4 // Redistribution and use in source and binary forms, with or without
5 // modification, are permitted provided that the following conditions are
6 // met:
7 //
8 // 1. Redistributions of source code must retain the above copyright
9 // notice, this list of conditions and the following disclaimer.
10 //
11 // 2. Redistributions in binary form must reproduce the above copyright
12 // notice, this list of conditions and the following disclaimer in the
13 // documentation and/or other materials provided with the distribution.
14 //
15 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
18 // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
19 // HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
20 // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
21 // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
25 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
26 // DAMAGE.
27 //
28 // This software is provided "as is" without warranty of any kind,
29 // either expressed or implied, including but not limited to the
30 // implied warranties of fitness for a particular purpose.
31 //
32 // See the COPYING file for more information.
33 
34 #ifndef HPP_CORBASERVER_CLIENT_HH
35 #define HPP_CORBASERVER_CLIENT_HH
36 
37 #include <omniORB4/CORBA.h>
38 
44 #include <string>
45 
46 namespace hpp {
47 namespace corbaServer {
49  public:
50  ClientBase(int argc, char* argv[]);
51 
52  virtual ~ClientBase();
53 
57  void connect(const std::string& iiop = "corbaloc:iiop:");
58 
59  hpp::Tools_var& tools() { return tools_; }
60 
61  private:
62  bool createFromDirectLink(const std::string& iiop);
63  bool createFromNameService(const std::string& iiop);
64 
65  hpp::Tools_var tools_;
66  CORBA::ORB_var orb_;
67 };
68 
70  public:
71  Client(int argc, char* argv[]);
72 
74 
77  void connect(const char* iiop = "corbaloc:iiop:",
78  const char* context = "corbaserver");
79 
80  hpp::corbaserver::Robot_var& robot() { return robot_; }
81 
82  hpp::corbaserver::Problem_var& problem() { return problem_; }
83 
84  hpp::corbaserver::Obstacle_var& obstacle() { return obstacle_; }
85 
86  private:
87  void createClientsFromTools();
88 
92 
93  CORBA::ORB_var orb_;
94 };
95 
96 } // end of namespace corbaServer.
97 } // end of namespace hpp.
98 #endif
Definition: client.hh:48
ClientBase(int argc, char *argv[])
void connect(const std::string &iiop="corbaloc:iiop:")
hpp::Tools_var & tools()
Definition: client.hh:59
Definition: client.hh:69
hpp::corbaserver::Problem_var & problem()
Definition: client.hh:82
hpp::corbaserver::Obstacle_var & obstacle()
Definition: client.hh:84
Client(int argc, char *argv[])
void connect(const char *iiop="corbaloc:iiop:", const char *context="corbaserver")
hpp::corbaserver::Robot_var & robot()
Definition: client.hh:80
#define HPP_CORBASERVER_DLLAPI
Definition: config.hh:88
Implement CORBA interface `‘Obstacle’'.
Definition: client.hh:46
_CORBA_ObjRef_Var< _objref_Obstacle, Obstacle_Helper > Obstacle_var
Definition: obstacle-idl.hh:88
_CORBA_ObjRef_Var< _objref_Problem, Problem_Helper > Problem_var
Definition: problem-idl.hh:132
_CORBA_ObjRef_Var< _objref_Robot, Robot_Helper > Robot_var
Definition: robot-idl.hh:92
_CORBA_ObjRef_Var< _objref_Tools, Tools_Helper > Tools_var
Definition: tools-idl.hh:84