Commit b317b755 authored by Guilhem Saurel's avatar Guilhem Saurel
Browse files

Format

parent 05e12ede
Pipeline #6465 failed with stage
in 1 minute and 3 seconds
...@@ -18,37 +18,35 @@ ...@@ -18,37 +18,35 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
#ifndef HPP_RBPRM_CORBA_SERVER_HH #ifndef HPP_RBPRM_CORBA_SERVER_HH
# define HPP_RBPRM_CORBA_SERVER_HH #define HPP_RBPRM_CORBA_SERVER_HH
# include <hpp/corba/template/server.hh> #include <hpp/corba/template/server.hh>
# include <hpp/corbaserver/problem-solver-map.hh> #include <hpp/corbaserver/problem-solver-map.hh>
# include <hpp/corbaserver/rbprm/config.hh> #include <hpp/corbaserver/rbprm/config.hh>
# include <hpp/corbaserver/server-plugin.hh> #include <hpp/corbaserver/server-plugin.hh>
namespace hpp { namespace hpp {
namespace rbprm { namespace rbprm {
namespace impl { namespace impl {
class RbprmBuilder; class RbprmBuilder;
} }
class HPP_RBPRM_CORBA_DLLAPI Server : public corbaServer::ServerPlugin class HPP_RBPRM_CORBA_DLLAPI Server : public corbaServer::ServerPlugin {
{ public:
public: Server(corbaServer::Server* parent);
Server (corbaServer::Server* parent);
~Server();
~Server ();
/// Start corba server
/// Start corba server /// Call hpp::corba::Server <impl::Problem>::startCorbaServer
/// Call hpp::corba::Server <impl::Problem>::startCorbaServer void startCorbaServer(const std::string& contextId, const std::string& contextKind);
void startCorbaServer(const std::string& contextId,
const std::string& contextKind); std::string name() const;
std::string name () const; public:
corba::Server<impl::RbprmBuilder>* rbprmBuilder_;
public: }; // class Server
corba::Server <impl::RbprmBuilder>* rbprmBuilder_; } // namespace rbprm
}; // class Server } // namespace hpp
} // namespace rbprm
} // namespace hpp #endif // HPP_RBPRM_CORBA_SERVER_HH
#endif // HPP_RBPRM_CORBA_SERVER_HH
...@@ -16,12 +16,11 @@ ...@@ -16,12 +16,11 @@
// <http://www.gnu.org/licenses/>. // <http://www.gnu.org/licenses/>.
#ifndef HPP_MANIPULATION_CORBA_FWD_HH #ifndef HPP_MANIPULATION_CORBA_FWD_HH
# define HPP_MANIPULATION_CORBA_FWD_HH #define HPP_MANIPULATION_CORBA_FWD_HH
namespace hpp { namespace hpp {
namespace manipulation { namespace manipulation {
namespace corba { namespace corba {}
} } // namespace manipulation
} } // namespace hpp
} #endif // HPP_MANIPULATION_CORBA_FWD_HH
#endif // HPP_MANIPULATION_CORBA_FWD_HH
...@@ -19,15 +19,13 @@ ...@@ -19,15 +19,13 @@
#include <hpp/core/problem-solver.hh> #include <hpp/core/problem-solver.hh>
typedef hpp::corbaServer::Server CorbaServer; typedef hpp::corbaServer::Server CorbaServer;
int main (int argc, char* argv []) int main(int argc, char* argv[]) {
{ hpp::core::ProblemSolverPtr_t problemSolver(hpp::core::ProblemSolver::create());
hpp::core::ProblemSolverPtr_t problemSolver (hpp::core::ProblemSolver::create());
CorbaServer corbaServer (problemSolver, argc, CorbaServer corbaServer(problemSolver, argc, const_cast<const char**>(argv), true);
const_cast<const char**> (argv), true);
corbaServer.startCorbaServer (); corbaServer.startCorbaServer();
corbaServer.loadPlugin (corbaServer.mainContextId (), "rbprm-corba.so"); corbaServer.loadPlugin(corbaServer.mainContextId(), "rbprm-corba.so");
corbaServer.loadPlugin (corbaServer.mainContextId (), "affordance-corba.so"); corbaServer.loadPlugin(corbaServer.mainContextId(), "affordance-corba.so");
corbaServer.processRequest(true); corbaServer.processRequest(true);
} }
This diff is collapsed.
This diff is collapsed.
...@@ -24,37 +24,26 @@ ...@@ -24,37 +24,26 @@
#include <hpp/corbaserver/server.hh> #include <hpp/corbaserver/server.hh>
namespace hpp { namespace hpp {
namespace rbprm { namespace rbprm {
Server::Server (corbaServer::Server* server) Server::Server(corbaServer::Server* server) : corbaServer::ServerPlugin(server), rbprmBuilder_(NULL) {}
: corbaServer::ServerPlugin (server),
rbprmBuilder_ (NULL) Server::~Server() {
{} if (rbprmBuilder_) delete rbprmBuilder_;
}
Server::~Server ()
{ std::string Server::name() const { return "rbprm"; }
if (rbprmBuilder_) delete rbprmBuilder_;
} /// Start corba server
void Server::startCorbaServer(const std::string& contextId, const std::string& contextKind) {
std::string Server::name () const bool mThd = parent()->multiThread();
{ rbprmBuilder_ = new corba::Server<impl::RbprmBuilder>(0, NULL, mThd, "child");
return "rbprm"; rbprmBuilder_->implementation().setServer(this);
}
if (rbprmBuilder_->startCorbaServer(contextId, contextKind, "rbprm", "rbprmbuilder") != 0) {
/// Start corba server HPP_THROW_EXCEPTION(hpp::Exception, "Failed to start corba rbprm server.");
void Server::startCorbaServer(const std::string& contextId, }
const std::string& contextKind) }
{ } // namespace rbprm
bool mThd = parent()->multiThread(); } // namespace hpp
rbprmBuilder_ = new corba::Server <impl::RbprmBuilder> (0, NULL, mThd, "child");
rbprmBuilder_->implementation ().setServer (this);
if (rbprmBuilder_->startCorbaServer(contextId, contextKind,
"rbprm", "rbprmbuilder") != 0) {
HPP_THROW_EXCEPTION (hpp::Exception,
"Failed to start corba rbprm server.");
}
}
} // namespace rbprm
} // namespace hpp
HPP_CORBASERVER_DEFINE_PLUGIN(hpp::rbprm::Server) HPP_CORBASERVER_DEFINE_PLUGIN(hpp::rbprm::Server)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment