29 #ifndef HPP_CORBASERVER_BASIC_SERVER_HH
30 #define HPP_CORBASERVER_BASIC_SERVER_HH
32 #include <hpp/corba/template/server.hh>
34 #include <hpp/util/exception.hh>
42 namespace corbaServer {
51 BasicServer(Server* parent);
56 void startCorbaServer(
const std::string& contextId,
57 const std::string& contextKind);
59 ::CORBA::Object_ptr servant(
const std::string& name)
const;
61 std::string name()
const;
64 corba::Server<impl::Obstacle>* obstacleImpl_;
65 corba::Server<impl::Problem>* problemImpl_;
66 corba::Server<impl::Robot>* robotImpl_;
76 if (obstacleImpl_)
delete obstacleImpl_;
77 if (problemImpl_)
delete problemImpl_;
78 if (robotImpl_)
delete robotImpl_;
85 const std::string& contextKind) {
91 obstacleImpl_->implementation().setServer(
this);
92 problemImpl_->implementation().setServer(
this);
93 robotImpl_->implementation().setServer(
this);
97 if (
name ==
"obstacle")
return obstacleImpl_->implementation()._this();
98 if (
name ==
"problem")
return problemImpl_->implementation()._this();
99 if (
name ==
"robot")
return robotImpl_->implementation()._this();
100 throw std::invalid_argument(
"No servant " +
name);
105 #endif // HPP_CORBASERVER_SERVER_PLUGIN_HH