28 :
doil::CORBA::CORBAServantBase(impl)
31 if (m_impl == NULL)
throw std::bad_alloc();
44 throw (::CORBA::SystemException)
46 return ret(m_impl->initialize());
50 throw (::CORBA::SystemException)
52 return ret(m_impl->finalize());
56 throw (::CORBA::SystemException)
58 return ret(m_impl->exit());
63 throw (::CORBA::SystemException)
70 IExecutionContext*
ec;
73 ec =
new ExecutioinContextAdapter(exec_context);
77 ec = dyanmic_cast<IExecutionContext>(obj);
79 if (ec == NULL)
return false;
81 return m_impl->is_alive(ec);
93 throw (::CORBA::SystemException)
95 ExecutionContextInterface& ecif(m_impl->get_context(
ec_id));
97 return Local2Corba(ecif);
108 throw (::CORBA::SystemException)
110 ExecutionContextInterfaceList& eclist(m_impl->get_owned_contexts());
112 ExecutionContextList_var retval;
116 return retval._retn();
127 throw (::CORBA::SystemException)
129 ExecutionContextInterfaceList& eclist(m_impl->get_participating_contexts());
130 ExecutionContextList_var retval;
134 return retval._retn();
147 throw (::CORBA::SystemException)
149 ExecutionContextInterface ecif(Corba2Local(cxt));
150 return m_impl->get_context_handle(ecif);
162 throw (::CORBA::SystemException)
164 return m_impl->attach_context(ExecutionContext_ptr exec_context);
175 throw (::CORBA::SystemException)
192 throw (::CORBA::SystemException)
194 return m_impl->RTObject;
205 throw (::CORBA::SystemException)
207 return m_impl->get_ports();
221 throw (::CORBA::SystemException)
223 return ret(m_impl->on_initialize());
234 throw (::CORBA::SystemException)
236 return ret(m_impl->on_finalize());
247 throw (::CORBA::SystemException)
260 throw (::CORBA::SystemException)
273 throw (::CORBA::SystemException)
286 throw (::CORBA::SystemException)
299 throw (::CORBA::SystemException)
312 throw (::CORBA::SystemException)
325 throw (::CORBA::SystemException)
339 throw (::CORBA::SystemException)
353 throw (::CORBA::SystemException)
366 throw (::CORBA::SystemException)
382 throw (::CORBA::SystemException,
SDOPackage::NotAvailable)
396 throw (::CORBA::SystemException,
410 throw (::CORBA::SystemException,
424 throw (::CORBA::SystemException,
429 SDOPackage::DeviceProfile_var dprofile;
430 dprofile =
new SDOPackage::DeviceProfile();
431 dprofile->device_type = ::CORBA::string_dup(m_profile.category);
432 dprofile->manufacturer = ::CORBA::string_dup(m_profile.vendor);
433 dprofile->model = ::CORBA::string_dup(m_profile.type_name);
434 dprofile->version = ::CORBA::string_dup(m_profile.version);
435 dprofile->properties = m_profile.properties;
436 return dprofile._retn();
440 throw SDOPackage::InternalError(
"get_device_profile()");
442 return new SDOPackage::DeviceProfile();
453 throw (::CORBA::SystemException,
458 SDOPackage::ServiceProfileList_var sprofiles;
459 sprofiles =
new SDOPackage::ServiceProfileList(m_sdoSvcProfiles);
460 return sprofiles._retn();
464 throw SDOPackage::InternalError(
"get_service_profiles()");
466 return new SDOPackage::ServiceProfileList();
476 SDOPackage::ServiceProfile*
478 throw (::CORBA::SystemException,
479 SDOPackage::InvalidParameter, SDOPackage::NotAvailable,
480 SDOPackage::InternalError)
483 throw SDOPackage::InvalidParameter(
"get_service_profile(): Empty name.");
490 SDOPackage::ServiceProfile_var sprofile;
491 sprofile =
new SDOPackage::ServiceProfile(m_sdoSvcProfiles[index]);
492 return sprofile._retn();
496 throw SDOPackage::InternalError(
"get_service_profile()");
498 return new SDOPackage::ServiceProfile();
509 throw (::CORBA::SystemException,
510 SDOPackage::InvalidParameter, SDOPackage::NotAvailable,
511 SDOPackage::InternalError)
514 throw SDOPackage::InvalidParameter(
"get_service(): Empty name.");
521 SDOPackage::SDOService_var
service;
522 service = m_sdoSvcProfiles[
index].service;
523 return service._retn();
527 throw SDOPackage::InternalError(
"get_service()");
529 return SDOPackage::SDOService::_nil();
540 throw (::CORBA::SystemException,
544 if (m_pSdoConfig == NULL)
545 throw SDOPackage::InterfaceNotImplemented();
548 SDOPackage::Configuration_var
config;
549 config = m_pSdoConfig;
550 return config._retn();
554 SDOPackage::InternalError(
"get_configuration()");
556 return SDOPackage::Configuration::_nil();
567 throw (::CORBA::SystemException,
571 throw SDOPackage::InterfaceNotImplemented();
572 return SDOPackage::Monitoring::_nil();
583 throw (::CORBA::SystemException,
588 SDOPackage::OrganizationList_var
org;
589 org =
new SDOPackage::OrganizationList(m_sdoOrganizations);
594 throw SDOPackage::InternalError(
"get_organizations()");
596 return new SDOPackage::OrganizationList(0);
607 throw (::CORBA::SystemException,
613 status =
new NVList(m_sdoStatus);
614 return status._retn();
618 SDOPackage::InternalError(
"get_status_list()");
631 throw (::CORBA::SystemException,
632 SDOPackage::InvalidParameter, SDOPackage::NotAvailable,
633 SDOPackage::InternalError)
638 throw SDOPackage::InvalidParameter(
"get_status(): Not found");
641 ::CORBA::Any_var status;
642 status = new ::CORBA::Any(m_sdoStatus[index].value);
643 return status._retn();
647 throw SDOPackage::InternalError(
"get_status()");
649 return new ::CORBA::Any();
662 void RTObjectServant::setInstanceName(
const char* instance_name)
664 m_properties[
"instance_name"] = instance_name;
665 m_profile.instance_name = m_properties[
"instance_name"].c_str();
675 std::vector<std::string> RTObjectServant::getNamingNames()
677 return split(m_properties[
"naming.names"],
",");
687 void RTObjectServant::setObjRef(
const RTObject_ptr rtobj)
699 RTObject_ptr RTObjectServant::getObjRef()
const 701 return ret(RTC::RTObject::_duplicate(m_objref));
713 m_properties <<
prop;
714 m_profile.instance_name = m_properties[
"instance_name"].c_str();
715 m_profile.type_name = m_properties[
"type_name"].c_str();
716 m_profile.description = m_properties[
"description"].c_str();
717 m_profile.version = m_properties[
"version"].c_str();
718 m_profile.vendor = m_properties[
"vendor"].c_str();
719 m_profile.category = m_properties[
"category"].c_str();
741 void RTObjectServant::updateParameters(
const char* config_set)
743 m_configsets.update(config_set);
754 void RTObjectServant::registerPort(
PortBase& port)
756 m_portAdmin.registerPort(port);
757 port.setOwner(this->getObjRef());
768 void RTObjectServant::deletePort(
PortBase& port)
770 m_portAdmin.deletePort(port);
781 void RTObjectServant::deletePortByName(
const char* port_name)
783 m_portAdmin.deletePortByName(port_name);
794 void RTObjectServant::finalizePorts()
796 m_portAdmin.finalizePorts();
806 void RTObjectServant::shutdown()
811 m_pPOA->deactivate_object(*m_pPOA->servant_to_id(m_pSdoConfigImpl));
812 m_pPOA->deactivate_object(*m_pPOA->servant_to_id(
this));
819 if (m_pManager != NULL)
821 m_pManager->cleanupComponent(
this);
virtual ReturnCode_t on_deactivated(EChandle exec_handle)
RTObjectServant(doil::ImplBase *impl)
virtual char * get_sdo_type()
EXECUTION_HANDLE_TYPE_NATIVE ExecutionContextHandle_t
virtual ::CORBA::Boolean is_alive(ExecutionContext_ptr exec_context)
virtual ReturnCode_t on_initialize()
virtual ReturnCode_t on_aborting(EChandle exec_handle)
virtual ReturnCode_t on_finalize()
std::vector< std::pair< std::string, std::string > > NVList
RTC::Local::ReturnCode_t ReturnCode_t
virtual ReturnCode_t on_error(EChandle exec_handle)
virtual ReturnCode_t finalize()
ReturnCode_t detach_context(EChandle exec_handle)
virtual ~RTObjectServant()
virtual ImplBase * toImpl(doil::ServantBase *servant)
Getting impl object by servant.
static CORBAManager & instance()
getting instance
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
virtual ReturnCode_t exit()
vstring split(const std::string &input, const std::string &delimiter, bool ignore_empty)
Split string by delimiter.
virtual ExecutionContextList * get_owned_contexts()
virtual SDOPackage::SDOService_ptr get_sdo_service(const char *id)
virtual ReturnCode_t on_reset(EChandle exec_handle)
::RTC::Local::IRTObject IRTObject
virtual SDOPackage::ServiceProfile * get_service_profile(const char *id)
virtual SDOPackage::OrganizationList * get_owned_organizations()
virtual SDOPackage::ServiceProfileList * get_service_profiles()
std::vector< ExecutionContext * > ExecutionContextList
ExecutionContextHandle_t UniqueId
virtual ExecutionContext_ptr get_context(EChandle exec_handle)
virtual ExecutionContextHandle_t get_context_handle(ExecutionContext_ptr cxt)
virtual SDOPackage::Monitoring_ptr get_monitoring()
virtual SDOPackage::DeviceProfile * get_device_profile()
RTObject corba servant class.
virtual SDOPackage::OrganizationList * get_organizations()
CORBA::Long find(const CorbaSequence &seq, Functor f)
Return the index of CORBA sequence element that functor matches.
virtual ::CORBA::Any * get_status(const char *name)
virtual ExecutionContextList * get_participating_contexts()
virtual char * get_sdo_id()
virtual ReturnCode_t initialize()
prop
Organization::get_organization_property ();.
virtual ReturnCode_t on_activated(EChandle exec_handle)
EChandle attach_context(ExecutionContext_ptr exec_context)
std::vector< IPortService * > PortServiceList
virtual ComponentProfile * get_component_profile()
IRTObject interface class.
virtual SDOPackage::NVList * get_status_list()
virtual PortServiceList * get_ports()
virtual SDOPackage::Configuration_ptr get_configuration()
Functor for_each(CorbaSequence &seq, Functor f)
Apply the functor to all CORBA sequence elements.
virtual ReturnCode_t on_startup(EChandle exec_handle)
virtual ReturnCode_t on_shutdown(EChandle exec_handle)