20 #ifndef HPP_CORBASERVER_BASIC_SERVER_HH 21 # define HPP_CORBASERVER_BASIC_SERVER_HH 25 # include <hpp/util/exception.hh> 35 namespace corbaServer {
42 class HPP_CORBASERVER_LOCAL BasicServer:
public ServerPlugin
45 BasicServer (Server* parent);
50 void startCorbaServer (
const std::string& contextId,
51 const std::string& contextKind);
53 ::CORBA::Object_ptr servant (
const std::string& name)
const;
55 std::string
name()
const;
58 corba::Server <impl::Obstacle>* obstacleImpl_;
59 corba::Server <impl::Problem >* problemImpl_;
60 corba::Server <impl::Robot >* robotImpl_;
65 , obstacleImpl_ (NULL)
73 if (obstacleImpl_)
delete obstacleImpl_;
74 if (problemImpl_ )
delete problemImpl_;
75 if (robotImpl_ )
delete robotImpl_;
85 const std::string& contextId,
86 const std::string& contextKind)
92 obstacleImpl_->implementation ().setServer (
this);
93 problemImpl_ ->implementation ().setServer (
this);
94 robotImpl_ ->implementation ().setServer (
this);
99 if (name ==
"obstacle")
return obstacleImpl_->implementation()._this();
100 if (name ==
"problem" )
return problemImpl_ ->implementation()._this();
101 if (name ==
"robot" )
return robotImpl_ ->implementation()._this();
102 throw std::invalid_argument (
"No servant " + name);
107 #endif // HPP_CORBASERVER_SERVER_PLUGIN_HH Definition: server-plugin.hh:44
~BasicServer()
Definition: basic-server.hh:71
Implement CORBA interface ``Obstacle''.
::CORBA::Object_ptr servant(const std::string &name) const
Definition: basic-server.hh:97
BasicServer(Server *parent)
Definition: basic-server.hh:63
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
virtual std::string name() const =0
Definition: basic-server.hh:78
ProblemServant< POA_hpp::core_idl::Problem, core::ProblemPtr_t > Problem
Definition: problem.hh:116
Implementation of Hpp module Corba server.
Definition: server.hh:54
virtual void startCorbaServer(const std::string &contextId, const std::string &contextKind)=0
Start corba server.
Definition: basic-server.hh:84
void initializeTplServer(corba::Server< T > *&server, const std::string &contextId, const std::string &contextKind, const std::string &objectId, const std::string &objectKind)
Definition: server-plugin.hh:85