hpp-corbaserver: include/hpp/corbaserver/client.hh Source File

hpp-corbaserver 9.0.2 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
39 #include <hpp/corbaserver/config.hh>
40 #include <hpp/corbaserver/obstacle-idl.hh>
41 #include <hpp/corbaserver/problem-idl.hh>
42 #include <hpp/corbaserver/robot-idl.hh>
43 #include <hpp/corbaserver/tools-idl.hh>
44 #include <string>
45
46 namespace hpp {
47 namespace corbaServer {
48 class HPP_CORBASERVER_DLLAPI ClientBase {
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
69 class HPP_CORBASERVER_DLLAPI Client : public ClientBase {
70 public:
71 Client(int argc, char* argv[]);
72
73 ~Client();
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
89 hpp::corbaserver::Robot_var robot_;
90 hpp::corbaserver::Problem_var problem_;
91 hpp::corbaserver::Obstacle_var obstacle_;
92
93 CORBA::ORB_var orb_;
94 };
95
96 } // end of namespace corbaServer.
97 } // end of namespace hpp.
98 #endif
hpp::corbaServer::ClientBase
Definition: client.hh:48
hpp::corbaServer::ClientBase::~ClientBase
virtual ~ClientBase()
hpp::corbaServer::ClientBase::ClientBase
ClientBase(int argc, char *argv[])
hpp::corbaServer::ClientBase::connect
void connect(const std::string &iiop="corbaloc:iiop:")
hpp::corbaServer::ClientBase::tools
hpp::Tools_var & tools()
Definition: client.hh:59
hpp::corbaServer::Client
Definition: client.hh:69
hpp::corbaServer::Client::problem
hpp::corbaserver::Problem_var & problem()
Definition: client.hh:82
hpp::corbaServer::Client::obstacle
hpp::corbaserver::Obstacle_var & obstacle()
Definition: client.hh:84
hpp::corbaServer::Client::Client
Client(int argc, char *argv[])
hpp::corbaServer::Client::~Client
~Client()
hpp::corbaServer::Client::connect
void connect(const char *iiop="corbaloc:iiop:", const char *context="corbaserver")
hpp::corbaServer::Client::robot
hpp::corbaserver::Robot_var & robot()
Definition: client.hh:80
config.hh
HPP_CORBASERVER_DLLAPI
#define HPP_CORBASERVER_DLLAPI
Definition: config.hh:88
robot_
DevicePtr_t robot_
hpp
Implement CORBA interface `‘Obstacle’'.
obstacle-idl.hh
Obstacle_var
_CORBA_ObjRef_Var< _objref_Obstacle, Obstacle_Helper > Obstacle_var
Definition: obstacle-idl.hh:88
problem-idl.hh
Problem_var
_CORBA_ObjRef_Var< _objref_Problem, Problem_Helper > Problem_var
Definition: problem-idl.hh:132
robot-idl.hh
Robot_var
_CORBA_ObjRef_Var< _objref_Robot, Robot_Helper > Robot_var
Definition: robot-idl.hh:92
tools-idl.hh
Tools_var
_CORBA_ObjRef_Var< _objref_Tools, Tools_Helper > Tools_var
Definition: tools-idl.hh:84