From b3ce26e09f2133413f888b9abcef26c7b1ff3518 Mon Sep 17 00:00:00 2001 From: Joseph Mirabel <jmirabel@laas.fr> Date: Tue, 17 Dec 2019 19:12:36 +0100 Subject: [PATCH] Update to change in hpp-corbaserver. --- include/hpp/corbaserver/rbprm/server.hh | 2 ++ src/hpp/corbaserver/rbprm/client.py | 6 +++--- src/server.cc | 12 ++++++------ 3 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/hpp/corbaserver/rbprm/server.hh b/include/hpp/corbaserver/rbprm/server.hh index 365074fe..e6aa05b3 100644 --- a/include/hpp/corbaserver/rbprm/server.hh +++ b/include/hpp/corbaserver/rbprm/server.hh @@ -43,6 +43,8 @@ class HPP_RBPRM_CORBA_DLLAPI Server : public corbaServer::ServerPlugin { std::string name() const; + ::CORBA::Object_ptr servant (const std::string& name) const; + public: corba::Server<impl::RbprmBuilder>* rbprmBuilder_; }; // class Server diff --git a/src/hpp/corbaserver/rbprm/client.py b/src/hpp/corbaserver/rbprm/client.py index 7f449c18..68453b65 100755 --- a/src/hpp/corbaserver/rbprm/client.py +++ b/src/hpp/corbaserver/rbprm/client.py @@ -27,7 +27,7 @@ class Client(_Parent): """ defaultClients = { - 'rbprmbuilder': RbprmBuilder, + 'builder': RbprmBuilder, } def __init__(self, url=None, context="corbaserver"): @@ -40,7 +40,7 @@ class Client(_Parent): self._initOrb(url) self._makeClients("rbprm", self.defaultClients, context) - # self.rbprmbuilder is created by self._makeClients + # self.builder is created by self._makeClients # The old code stored the object as self.rbprm # Make it backward compatible. - self.rbprm = self.rbprmbuilder + self.rbprm = self.builder diff --git a/src/server.cc b/src/server.cc index 6327e880..4744ab05 100644 --- a/src/server.cc +++ b/src/server.cc @@ -35,13 +35,13 @@ std::string Server::name() const { return "rbprm"; } /// Start corba server void Server::startCorbaServer(const std::string& contextId, const std::string& contextKind) { - bool mThd = parent()->multiThread(); - rbprmBuilder_ = new corba::Server<impl::RbprmBuilder>(0, NULL, mThd, "child"); - rbprmBuilder_->implementation().setServer(this); + initializeTplServer (rbprmBuilder_, contextId, contextKind, name(), "builder"); +} - if (rbprmBuilder_->startCorbaServer(contextId, contextKind, "rbprm", "rbprmbuilder") != 0) { - HPP_THROW_EXCEPTION(hpp::Exception, "Failed to start corba rbprm server."); - } +::CORBA::Object_ptr Server::servant(const std::string& name) const +{ + if (name == "builder") return rbprmBuilder_->implementation()._this(); + throw std::invalid_argument ("No servant " + name); } } // namespace rbprm } // namespace hpp -- GitLab