33 #include <coil/Properties.h> 34 #include <coil/stringutil.h> 35 #include <coil/Signal.h> 36 #include <coil/TimeValue.h> 37 #include <coil/Timer.h> 59 : m_name(comp->getInstanceName())
245 RTC_TRACE((
"Manager::activateManager()"));
251 RTC_ERROR((
"Could not get POA manager."));
259 RTC_ERROR((
"POA Manager activatatin failed."));
263 std::vector<std::string> mods;
266 for (
int i(0), len(mods.size()); i < len; ++i)
268 size_t begin_pos(mods[i].find_first_of(
'('));
269 size_t end_pos(mods[i].find_first_of(
')'));
270 std::string filename, initfunc;
271 if (begin_pos != std::string::npos && end_pos != std::string::npos &&
274 initfunc = mods[i].substr(begin_pos + 1, end_pos - (begin_pos + 1));
275 filename = mods[i].substr(0, begin_pos);
281 initfunc =
coil::split(mods[i],
".").operator[](0) +
"Init";
284 if (filename.find_first_of(
'.') == std::string::npos)
286 std::cout <<
m_config[
"manager.modules.C++.suffixes"] << std::endl;
289 filename +=
"." +
m_config[
"manager.modules.C++.suffixes"];
314 m_config[
"sdo.service.consumer.available_services"]
322 RTC_TRACE((
"Components pre-creation: %s",
323 m_config[
"manager.components.precreate"].c_str()));
324 std::vector<std::string> comp;
326 for (
int i(0), len(comp.size()); i < len; ++i)
332 RTC_TRACE((
"Connection pre-creation: %s",
333 m_config[
"manager.components.preconnect"].c_str()));
334 std::vector<std::string> connectors;
336 for (
int i(0), len(connectors.size()); i < len; ++i)
343 if (comp_ports.size() != 2)
345 RTC_ERROR((
"Invalid format for pre-connection."));
346 RTC_ERROR((
"Format must be Comp0.port0:Comp1.port1"));
349 std::string comp0_name =
coil::split(comp_ports[0],
".")[0];
350 std::string comp1_name =
coil::split(comp_ports[1],
".")[0];
354 {
RTC_ERROR((
"%s not found.", comp0_name.c_str()));
continue; }
356 {
RTC_ERROR((
"%s not found.", comp1_name.c_str()));
continue; }
357 std::string port0 = comp_ports[0];
358 std::string port1 = comp_ports[1];
360 PortServiceList_var ports0 = comp0->
get_ports();
361 PortServiceList_var ports1 = comp1->get_ports();
362 RTC_DEBUG((
"%s has %d ports.", comp0_name.c_str(), ports0->length()));
363 RTC_DEBUG((
"%s has %d ports.", comp1_name.c_str(), ports1->length()));
365 PortService_var port0_var;
366 for (
size_t p(0); p < ports0->length(); ++p)
368 PortProfile_var pp = ports0[p]->get_port_profile();
369 std::string s(CORBA::string_dup(pp->name));
370 if (comp_ports[0] == s)
372 RTC_DEBUG((
"port %s found: ", comp_ports[0].c_str()));
373 port0_var = ports0[p];
376 PortService_var port1_var;
377 for (
size_t p(0); p < ports1->length(); ++p)
379 PortProfile_var pp = ports1[p]->get_port_profile();
380 std::string s(CORBA::string_dup(pp->name));
383 RTC_DEBUG((
"port %s found: ", comp_ports[1].c_str()));
384 port1_var = ports1[p];
387 if (CORBA::is_nil(port0_var))
389 RTC_ERROR((
"port0 %s is nil obj", comp_ports[0].c_str()));
392 if (CORBA::is_nil(port1_var))
394 RTC_ERROR((
"port1 %s is nil obj", comp_ports[1].c_str()));
397 ConnectorProfile conn_prof;
398 std::string prof_name;
399 conn_prof.name = CORBA::string_dup(connectors[i].c_str());
400 conn_prof.connector_id = CORBA::string_dup(
"");
401 conn_prof.ports.length(2);
402 conn_prof.ports[0] = port0_var;
403 conn_prof.ports[1] = port1_var;
405 prop[
"dataport.dataflow_type"] =
"push";
406 prop[
"dataport.interface_type"] =
"corba_cdr";
408 for (
size_t o(0); o < opt_props.size(); ++o)
411 prop[
"dataport." + temp[0]] = temp[1];
417 connectors[i].c_str()));
423 RTC_TRACE((
"Components pre-activation: %s",
424 m_config[
"manager.components.preactivation"].c_str()));
425 std::vector<std::string> comps;
428 for (
int i(0), len(comps.size()); i < len; ++i)
432 {
RTC_ERROR((
"%s not found.", comps[i].c_str()));
continue; }
435 ecs[0]->activate_component(comp->
getObjRef());
452 RTC_TRACE((
"Manager::runManager(): non-blocking mode"));
458 RTC_TRACE((
"Manager::runManager(): blocking mode"));
460 RTC_TRACE((
"Manager::runManager(): ORB was terminated"));
478 RTC_TRACE((
"Manager::load(fname = %s, initfunc = %s)",
480 std::string file_name(fname);
481 std::string init_func(initfunc);
484 if (init_func.empty())
487 init_func = mod[0] +
"Init";
535 RTC_TRACE((
"Manager::getLoadedModules()"));
547 RTC_TRACE((
"Manager::getLoadableModules()"));
564 RTC_TRACE((
"Manager::registerFactory(%s)", profile[
"type_name"].c_str()));
566 factory =
new FactoryCXX(profile, new_func, delete_func);
586 std::vector<coil::Properties> props;
587 for (
int i(0), len(factories.size()); i < len; ++i)
589 props.push_back(factories[i]->profile());
604 RTC_TRACE((
"Manager::registerECFactory(%s)", name));
608 factory =
new ECFactoryCXX(name, new_func, delete_func);
629 RTC_TRACE((
"Manager::getModulesFactories()"));
646 RTC_TRACE((
"Manager::createComponent(%s)", comp_args));
657 if (comp_prop.
findNode(
"exported_ports") != 0)
660 exported_ports =
coil::split(comp_prop[
"exported_ports"],
",");
662 std::string exported_ports_str(
"");
663 for (
size_t i(0), len(exported_ports.size()); i < len; ++i)
666 if (keyval.size() > 2)
668 exported_ports_str += (keyval[0] +
"." + keyval.back());
672 exported_ports_str += exported_ports[i];
675 if (i != exported_ports.size() - 1)
677 exported_ports_str +=
",";
681 comp_prop[
"exported_ports"] = exported_ports_str;
682 comp_prop[
"conf.default.exported_ports"] = exported_ports_str;
693 comp_id[
"implementation_id"].c_str()));
697 RTC_INFO((
"%d loadable modules found", mp.size()));
699 std::vector<coil::Properties>::iterator it;
703 RTC_ERROR((
"No module for %s in loadable modules list",
704 comp_id[
"implementation_id"].c_str()));
707 if (it->findNode(
"module_file_name") == 0)
709 RTC_ERROR((
"Hmm...module_file_name key not found."));
713 RTC_INFO((
"Loading module: %s", (*it)[
"module_file_name"].c_str()))
714 load((*it)[
"module_file_name"].c_str(),
"");
718 RTC_ERROR((
"Factory not found for loaded module: %s",
719 comp_id[
"implementation_id"].c_str()));
725 prop = factory->profile();
727 const char* inherit_prop[] = {
738 "exec_cxt.periodic.type",
739 "exec_cxt.periodic.rate",
740 "exec_cxt.evdriven.type",
749 for (
int i(0); inherit_prop[i][0] !=
'\0'; ++i)
751 const char* key(inherit_prop[i]);
759 comp = factory->create(
this);
763 comp_id[
"implementation_id"].c_str()));
766 RTC_TRACE((
"RTC created: %s", comp_id[
"implementation_id"].c_str()));
784 RTC_TRACE((
"RTC initialization failed: %s",
785 comp_id[
"implementation_id"].c_str()));
786 RTC_TRACE((
"%s was finalized", comp_id[
"implementation_id"].c_str()));
789 RTC_DEBUG((
"%s finalization was failed.",
790 comp_id[
"implementation_id"].c_str()));
794 RTC_TRACE((
"RTC initialization succeeded: %s",
795 comp_id[
"implementation_id"].c_str()));
816 for (
int i(0), len(names.size()); i < len; ++i)
818 RTC_TRACE((
"Bind name: %s", names[i].c_str()));
838 for (
int i(0), len(names.size()); i < len; ++i)
840 RTC_TRACE((
"Unbind name: %s", names[i].c_str()));
861 RTC_ERROR((
"Factory not found: %s", ec_id.c_str()));
878 RTC_TRACE((
"deleteComponent(RTObject*)"));
888 comp_id[
"implementation_id"].c_str()));
894 comp_id[
"implementation_id"].c_str()));
895 factory->destroy(comp);
899 "YES",
"NO",
true) &&
902 std::vector<RTObject_impl*> comps;
904 if (comps.size() == 0)
913 RTC_TRACE((
"deleteComponent(%s)", instance_name));
918 RTC_WARN((
"RTC %s was not found in manager.", instance_name));
932 RTC_TRACE((
"Manager::getComponent(%s)", instance_name));
1023 std::string tick(
m_config[
"timer.tick"]);
1026 tm = atof(tick.c_str());
1039 const char* s =
m_config[
"manager.auto_shutdown_duration"].c_str();
1072 RTC_TRACE((
"Manager::shutdownManager()"));
1078 RTC_TRACE((
"Manager::shutdownOnNoRtcs()"));
1082 if (comps.size() == 0)
1110 std::vector<std::string> logouts;
1113 for (
int i(0), len(logouts.size()); i < len; ++i)
1115 std::string logfile(logouts[i]);
1116 if (logfile ==
"")
continue;
1119 if (logfile ==
"STDOUT" || logfile ==
"stdout")
1125 std::filebuf* of =
new std::filebuf();
1130 std::cerr <<
"Error: cannot open logfile: " 1131 << logfile << std::endl;
1148 "enable",
"disable",
false) ?
1153 RTC_INFO((
"Copyright (C) 2003-2014"));
1155 RTC_INFO((
" Intelligent Systems Research Institute, AIST"));
1157 RTC_INFO((
"Starting local logging."));
1171 RTC_TRACE((
"Manager::shutdownLogger()"));
1174 for (
int i(0), len(
m_logfiles.size()); i < len; ++i)
1204 args.insert(args.begin(),
"manager");
1206 int argc(args.size());
1209 m_pORB = CORBA::ORB_init(argc, argv);
1211 CORBA::Object_var obj =
1212 m_pORB->resolve_initial_references((
char*)
"RootPOA");
1213 m_pPOA = PortableServer::POA::_narrow(obj);
1214 if (CORBA::is_nil(
m_pPOA))
1216 RTC_ERROR((
"Could not resolve RootPOA."));
1222 #ifdef ORB_IS_OMNIORB 1223 const char* conf =
"corba.alternate_iiop_addresses";
1229 for (
size_t i(0); i < addr_list.size(); ++i)
1232 if (addr_port.size() == 2)
1234 IIOP::Address iiop_addr;
1235 iiop_addr.host = addr_port[0].c_str();
1238 iiop_addr.port = port;
1239 #if defined(RTM_OMNIORB_40) || defined(RTM_OMNIORB_41) 1240 omniIOR::add_IIOP_ADDRESS(iiop_addr);
1242 omniIOR::add_IIOP_ADDRESS(iiop_addr, 0);
1243 #endif // defined(RTC_OMNIORB_40) and defined(RTC_OMNIORB_41) 1247 #endif // ORB_IS_OMNIORB 1251 RTC_ERROR((
"Exception: Caught unknown exception in initORB()." ));
1266 std::string opt(
m_config[
"corba.args"]);
1267 RTC_DEBUG((
"corba.args: %s", opt.c_str()));
1292 endpoints.insert(endpoints.end(), tmp.begin(), tmp.end());
1298 m_config[
"manager.is_master"].c_str()));
1303 if (mmm.size() == 2)
1305 endpoints.insert(endpoints.begin(), std::string(
":") + mmm[1]);
1309 endpoints.insert(endpoints.begin(),
":2810");
1319 std::string corba(
m_config[
"corba.id"]);
1320 RTC_DEBUG((
"corba.id: %s", corba.c_str()));
1322 for (
size_t i(0); i < endpoints.size(); ++i)
1324 std::string& endpoint(endpoints[i]);
1325 RTC_DEBUG((
"Endpoint is : %s", endpoint.c_str()));
1326 if (endpoint.find(
":") == std::string::npos) { endpoint +=
":"; }
1328 if (corba ==
"omniORB")
1333 #ifdef ORB_IS_OMNIORB 1334 #ifdef RTC_CORBA_CXXMAPPING11 1336 opt +=
" -ORBendPointPublish all(addr)";
1339 opt +=
" -ORBendPointPublishAllIFs 1";
1340 #endif // RTC_CORBA_CXXMAPPING1 1341 #endif // ORB_IS_OMNIORB 1345 opt +=
" -ORBendPoint giop:tcp:" + endpoint;
1348 else if (corba ==
"TAO")
1350 opt +=
"-ORBEndPoint iiop://" + endpoint;
1352 else if (corba ==
"MICO")
1354 opt +=
"-ORBIIOPAddr inet:" + endpoint;
1370 if(CORBA::is_nil(
m_pORB))
1376 while (
m_pORB->work_pending())
1379 if (
m_pORB->work_pending())
1382 RTC_DEBUG((
"No pending works of ORB. Shutting down POA and ORB."));
1386 RTC_ERROR((
"Caught SystemException during perform_work."));
1389 if (!CORBA::is_nil(
m_pPOA))
1395 RTC_DEBUG((
"POA Manager was deactivated."));
1396 m_pPOA->destroy(
false,
true);
1397 m_pPOA = PortableServer::POA::_nil();
1400 catch (CORBA::SystemException& ex)
1402 RTC_ERROR((
"Exception cought during root POA destruction"));
1403 #ifndef ORB_IS_RTORB 1404 RTC_ERROR((
"CORBA::SystemException(minor=%d)", ex.minor()));
1405 #endif // ORB_IS_RTORB 1409 RTC_ERROR((
"Caught unknown exception during POA destruction."));
1413 if (!CORBA::is_nil(
m_pORB))
1421 m_pORB = CORBA::ORB::_nil();
1423 catch (CORBA::SystemException& ex)
1425 RTC_ERROR((
"Exception caught during ORB shutdown"));
1426 #ifndef ORB_IS_RTORB 1427 RTC_ERROR((
"CORBA::SystemException(minodor=%d)", ex.minor()));
1428 #endif // ORB_IS_RTORB 1432 RTC_ERROR((
"Caught unknown exception during ORB shutdown."));
1462 for (
int i(0), len_i(meth.size()); i < len_i; ++i)
1464 std::vector<std::string> names;
1468 for (
int j(0), len_j(names.size()); j < len_j; ++j)
1470 RTC_TRACE((
"Register Naming Server: %s/%s", \
1471 meth[i].c_str(), names[j].c_str()));
1481 std::string intr(
m_config[
"naming.update.interval"]);
1484 tm = atof(intr.c_str());
1504 RTC_TRACE((
"Manager::shutdownNaming()"));
1521 RTC_TRACE((
"Manager::initExecContext()"));
1530 RTC_TRACE((
"Manager::initComposite()"));
1538 RTC_TRACE((
"Manager::initFactories()"));
1558 RTC_TRACE((
"Manager::initManagerServant()"));
1565 std::vector<std::string> names(
coil::split(
prop[
"naming_formats"],
","));
1569 for (
int i(0), len(names.size()); i < len; ++i)
1576 std::ifstream otherref(
m_config[
"manager.refstring_path"].c_str());
1577 if (otherref.fail() != 0)
1580 std::ofstream reffile(
m_config[
"manager.refstring_path"].c_str());
1581 RTM::Manager_var mgr_v(RTM::Manager::
1583 CORBA::String_var str_var =
m_pORB->object_to_string(mgr_v);
1589 std::string refstring;
1590 otherref >> refstring;
1593 CORBA::Object_var obj =
m_pORB->string_to_object(refstring.c_str());
1594 RTM::Manager_var mgr = RTM::Manager::_narrow(obj);
1612 RTC_TRACE((
"Manager::shutdownComponents()"));
1613 std::vector<RTObject_impl*> comps;
1615 for (
int i(0), len(comps.size()); i < len; ++i)
1621 p << comps[i]->getProperties();
1631 for (CORBA::ULong i(0), len(
m_ecs.size()); i < len; ++i)
1634 PortableServer::ObjectId_var oid =
m_pPOA->servant_to_id(
m_ecs[i]);
1635 m_pPOA->deactivate_object(oid);
1652 RTC_TRACE((
"Manager::cleanupComponent()"));
1660 RTC_VERBOSE((
"%d components are marked as finalized.",
1671 RTC_TRACE((
"Manager::notifyFinalized()"));
1686 std::vector<std::string> id_and_conf(
coil::split(comp_arg,
"?"));
1689 if (id_and_conf.size() != 1 && id_and_conf.size() != 2)
1691 RTC_ERROR((
"Invalid arguments. Two or more '?' in arg : %s", comp_arg));
1694 if (id_and_conf[0].
find(
":") == std::string::npos)
1696 id_and_conf[0].insert(0,
"RTC:::");
1697 id_and_conf[0] +=
":";
1699 std::vector<std::string>
id(
coil::split(id_and_conf[0],
":"));
1705 RTC_ERROR((
"Invalid RTC id format.: %s", id_and_conf[0].c_str()));
1709 const char* prof[] =
1711 "RTC",
"vendor",
"category",
"implementation_id",
"version" 1714 if (
id[0] != prof[0])
1716 RTC_ERROR((
"Invalid id type: %s",
id[0].c_str()));
1719 for (
int i(1); i < 5; ++i)
1721 comp_id[prof[i]] =
id[i];
1722 RTC_TRACE((
"RTC basic propfile %s: %s", prof[i],
id[i].c_str()));
1725 if (id_and_conf.size() == 2)
1727 std::vector<std::string> conf(
coil::split(id_and_conf[1],
"&"));
1728 for (
int i(0), len(conf.size()); i < len; ++i)
1730 if (conf[i].empty()) {
continue; }
1731 std::vector<std::string> keyval(
coil::split(conf[i],
"="));
1732 if (keyval.size() != 2) {
continue; }
1733 comp_conf[keyval[0]] = keyval[1];
1735 keyval[0].c_str(), keyval[1].c_str()));
1745 std::vector<std::string> id_and_conf(
coil::split(ec_args,
"?"));
1746 if (id_and_conf.size() != 1 && id_and_conf.size() != 2)
1748 RTC_ERROR((
"Invalid arguments. Two or more '?' in arg : %s", ec_args));
1751 if (id_and_conf[0].empty())
1753 RTC_ERROR((
"Empty ExecutionContext's name"));
1756 ec_id =id_and_conf[0];
1758 if (id_and_conf.size() == 2)
1760 std::vector<std::string> conf(
coil::split(id_and_conf[1],
"&"));
1761 for (
int i(0), len(conf.size()); i < len; ++i)
1763 std::vector<std::string> k(
coil::split(conf[i],
"="));
1764 ec_conf[k[0]] = k[1];
1765 RTC_TRACE((
"EC property %s: %s", k[0].c_str(), k[1].c_str()));
1785 std::string type_conf(category +
"." + type_name +
".config_file");
1786 std::string name_conf(category +
"." + inst_name +
".config_file");
1794 std::ifstream conff(
m_config[name_conf].c_str());
1797 name_prop.
load(conff);
1798 RTC_INFO((
"Component instance conf file: %s loaded.",
1801 config_fname.push_back(
m_config[name_conf].c_str());
1808 if (!(
keys.size() == 1 &&
keys.back() ==
"config_file"))
1811 RTC_INFO((
"Component type conf exists in rtc.conf. Merged."));
1815 config_fname.push_back(
m_config[
"config_file"]);
1822 std::ifstream conff(
m_config[type_conf].c_str());
1825 type_prop.
load(conff);
1826 RTC_INFO((
"Component type conf file: %s loaded.",
1829 config_fname.push_back(
m_config[type_conf].c_str());
1836 if (!(
keys.size() == 1 &&
keys.back() ==
"config_file"))
1839 RTC_INFO((
"Component type conf exists in rtc.conf. Merged."));
1843 config_fname.push_back(
m_config[
"config_file"]);
1850 type_prop << name_prop;
1856 std::string naming_formats;
1859 naming_formats +=
m_config[
"naming.formats"];
1860 if (comp_prop.findNode(
"naming.formats") != 0)
1862 naming_formats = comp_prop[
"naming.formats"];
1867 std::string naming_names;
1882 if (file_name == NULL)
1884 RTC_ERROR((
"Invalid configuration file name."));
1887 if (file_name[0] !=
'\0')
1889 std::ifstream conff(file_name);
1909 std::string name(naming_format), str(
"");
1910 std::string::iterator it, it_end;
1914 it_end = name.end();
1915 for ( ; it != it_end; ++it)
1921 if (!(count % 2)) str.push_back((*it));
1927 if (*it ==
'{' || *it ==
'(')
1931 for ( ; it != it_end && (*it) !=
'}' && (*it) !=
')'; ++it)
1936 if (envval != NULL) str += envval;
1945 if (count > 0 && (count % 2))
1948 if (c ==
'n') str += prop[
"instance_name"];
1949 else if (c ==
't') str += prop[
"type_name"];
1950 else if (c ==
'm') str += prop[
"type_name"];
1951 else if (c ==
'v') str += prop[
"version"];
1952 else if (c ==
'V') str += prop[
"vendor"];
1953 else if (c ==
'c') str += prop[
"category"];
1954 else if (c ==
'i') str += prop[
"implementation_id"];
1957 size_t n = prop[
"implementation_id"].
size();
1958 str += prop[
"instance_name"].substr(n);
1960 else if (c ==
'h') str +=
m_config[
"os.hostname"];
1961 else if (c ==
'M') str +=
m_config[
"manager.name"];
1962 else if (c ==
'p') str +=
m_config[
"manager.pid"];
1963 else str.push_back(c);
void setDateFormat(const char *format)
Set date/time format for adding the header.
RTObject_impl *(* RtcNewFunc)(Manager *manager)
#define RTC_ERROR(fmt)
Error log output macro.
static Mutex mutex
The mutex of the pointer to the Manager.
PortableServer::POAManager_ptr getPOAManager()
Get POAManager that Manager has.
std::string normalize(std::string &str)
Erase the head/tail blank and replace upper case to lower case.
void(* ModuleInitProc)(Manager *manager)
RTObject_impl * createComponent(const char *comp_args)
Create RT-Components.
std::string createORBOptions()
Create ORB command options.
Logger rtclog
Logger stream.
bool procContextArgs(const char *ec_args, std::string &ec_id, coil::Properties &ec_conf)
Extracting ExecutionContext's name/properties from the given string.
const char * getCategory()
[local interface] Get category information
void deleteComponent(RTObject_impl *comp)
Unregister RT-Components that have been registered to Manager.
std::vector< coil::Properties > getLoadedModules()
Get a list of loaded modules.
std::vector< Object * > getObjects() const
Get a list of obejects that are registerd.
virtual int open(void *args)
ORB activation processing.
Structure for exception handling when file open is failed.
virtual ReturnCode_t initialize()
[CORBA interface] Initialize the RTC that realizes this interface.
Term m_terminate
Synchronous flag for manager termination.
bool stringTo(To &val, const char *str)
Convert the given std::string to object.
PortableServer::POA_ptr getPOA()
Get a pointer to RootPOA held by Manager.
std::vector< coil::Properties > getLoadableModules()
Get the loadable module list.
FactoryManager m_factory
ComponentManager.
factory initialization function
void runManager(bool no_block=false)
Run the Manager.
void terminate()
Termination processing.
RTObject_impl * getComponent(const char *instance_name)
Get RT-Component's pointer.
bool initFactories()
Factories initialization.
void cleanupComponents()
This method deletes RT-Components.
RTM::ManagerServant * m_mgrservant
The pointer to the ManagerServant.
bool registerComponent(RTObject_impl *comp)
Register RT-Component directly without Factory.
std::vector< RTObject_impl * > getObjects()
Get all bound objects.
std::vector< coil::Properties > getLoadableModules()
Get a list of loadable modules.
void shutdown()
Shutdown Manager.
A base class for ExecutionContext.
RTC::ReturnCode_t ret(RTC::Local::ReturnCode_t r)
std::vector< std::string > getNamingNames()
[local interface] Get Naming Server information
virtual ExecutionContextBase * create()=0
Pure virtual function to create ExecutionContext.
void terminate()
Terminate manager.
void load(const char *fname, const char *initfunc)
[CORBA interface] Load module
vstring split(const std::string &input, const std::string &delimiter, bool ignore_empty)
Split string by delimiter.
RTC manager configuration.
void bindObject(const char *name, const RTObject_impl *rtobj)
Bind the specified objects to NamingService.
Structure for exception handling when specified symbol cannot be found.
virtual PortServiceList * get_ports()
[RTObject CORBA interface] Get Ports
bool initExecContext()
ExecutionContextManager initialization.
void setName(const char *name)
Set suffix of date/time string of header.
vstring unique_sv(vstring sv)
Eliminate duplication from the given string list.
void registerNameServer(const char *method, const char *name_server)
Regster the NameServer.
CORBA::ORB_ptr getORB()
Get the pointer to ORB.
std::string load(const std::string &file_name)
Load the module.
void PeriodicExecutionContextInit(RTC::Manager *manager)
Initialization function to register to ECFactory.
bool initComposite()
PeriodicECSharedComposite initialization.
coil::Timer * m_timer
Timer Object.
coil::Properties & getProperties()
[local interface] Get RTC property
void configure(coil::Properties &prop)
Specify the configuration information to the Property.
ListenerId registerListenerObj(ListenerClass *obj, void(ListenerClass::*cbf)(), TimeValue tm)
Register listener.
std::vector< coil::Properties > getLoadedModules()
Get the module list that has been loaded.
static GlobalFactory< AbstractClass, Identifier, Compare, Creator, Destructor > & instance()
Create instance.
void OpenHRPExecutionContextInit(RTC::Manager *manager)
Initialization function to register to ECFactory.
static Manager & instance()
Get instance of the manager.
NamingManager * m_namingManager
The pointer to the NamingManager.
void(* SignalHandler)(int)
void eraseBothEndsBlank(std::string &str)
Erase the head blank and the tail blank characters of string.
#define RTC_WARN(fmt)
Warning log output macro.
string mgr_name
Get Manager object reference.
RTComponent manager class.
#define RTC_DEBUG_STR(str)
#define RTC_PARANOID(fmt)
Paranoid level log output macro.
virtual int wait(void)
Waiting for the thread terminate.
std::vector< std::string > vstring
const char * getTypeName()
[local interface] Get type name
std::vector< coil::Properties > getFactoryProfiles()
Get profiles of factories.
env
�͡��ॵ���С���� env = RtmEnv(sys.argv, ["localhost:2809"]) list0 = env.name_space["localhost:2809"].list_obj() env.name_space['localhost:2809'].rtc_handles.keys() ns = env.name_space['localhost:2809']
void stop()
Stop Timer task.
void addStream(streambuf_type *stream, bool cleanup=false)
Destructor.
static Manager * manager
The pointer to the Manager.
void configureComponent(RTObject_impl *comp, const coil::Properties &prop)
Configure RT-Component.
ECFactoryBase abstract class.
std::vector< std::filebuf * > m_logfiles
Files for log output.
Periodic Execution Context Shared Composite Component class.
void notifyFinalized(RTObject_impl *comp)
This method deletes RT-Components.
#define RTC_DEBUG(fmt)
Debug level log output macro.
const std::string & getProperty(const std::string &key) const
Search for the property with the specified key in this property.
std::vector< ExecutionContextBase * > m_ecs
ExecutionContext list.
CORBA naming service helper class.
std::string flatten(vstring sv)
Create CSV file from the given string list.
void shutdownNaming()
NamingManager finalization.
LogStreamBuf m_logStreamBuf
Logger buffer.
bool registerObject(Object *obj)
Register the specified object.
void shutdownLogger()
System Logger finalization.
std::vector< std::string > getModulesFactories()
Get the list of all Factories.
CORBA::Long find(const CorbaSequence &seq, Functor f)
Return the index of CORBA sequence element that functor matches.
void ExtTrigExecutionContextInit(RTC::Manager *manager)
Register Factory class for this ExecutionContext.
Properties *const findNode(const std::string &key) const
Get node of properties.
Object * unregisterObject(const Identifier &id)
Unregister the specified object.
static Manager * init(int argc, char **argv)
Initialize manager.
Structure for exception handling when specified module cannot be found.
RTComponent manager servant implementation class.
void initManager(int argc, char **argv)
Manager internal initialization.
char ** toArgv(const vstring &args)
Convert the given string list into the argument list.
coil::Properties m_config
Managaer's configuration Properties.
ExtTrigExecutionContext class.
CORBA::ORB_var m_pORB
The pointer to the ORB.
Loadable modules manager class.
bool procComponentArgs(const char *comp_arg, coil::Properties &comp_id, coil::Properties &comp_conf)
Extracting component type/properties from the given string.
ExecutionContextBase * createContext(const char *ec_args)
Create Context.
void load(std::istream &inStream)
Loads property list that consists of key:value from input stream.
Object * find(const Identifier &id) const
Find the object.
void enableLock()
Enable the lock mode.
InstanceName(RTObject_impl *comp)
void createORBEndpoints(coil::vstring &endpoints)
Create Endpoints.
bool unregisterComponent(RTObject_impl *comp)
Unregister RT-Components.
Manager()
Protected Constructor.
void join()
Wait for Manager's termination.
virtual ReturnCode_t exit()
[CORBA interface]top the RTC's execution context(s) and finalize it along with its contents...
unsigned int replaceString(std::string &str, const std::string from, const std::string to)
Replace string.
void shutdownManager()
Shutdown Manager.
RTObject_ptr getObjRef() const
[local interface] Get the object reference
RTM::Manager_ptr getObjRef() const
Get the reference of Manager.
ACE_Sig_Action SignalAction
const char * getInstanceName()
[local interface] Get instance name
Execution context for OpenHRP3.
Pred for_each(Pred p)
Functor for searching object.
bool activateManager()
Activate the Manager.
bool setLevel(const char *level)
Set log level by string.
bool registerECFactory(const char *name, ECNewFunc new_func, ECDeleteFunc delete_func)
Register ExecutionContext Factory.
prop
Organization::get_organization_property ();.
ModuleManager * m_module
The pointer to the ModuleManager.
naming Service helper class
virtual ExecutionContextList * get_owned_contexts()
[CORBA interface] Get ExecutionContextList.
CORBA IOR manipulation utility functions.
ostream_type & level(int level)
Acquire log stream.
Terminator * m_terminator
The pointer to ORB termination helper class.
void unloadAll()
Unload all modules.
bool mergeProperty(coil::Properties &prop, const char *file_name)
Merge property information.
Class represents a set of properties.
void unloadAll()
Unload all modules.
void unload(const char *fname)
Unload module.
char * getenv(const char *name)
Get environment variable.
bool toBool(std::string str, std::string yes, std::string no, bool default_value)
Convert given string into bool value.
void createORBEndpointOption(std::string &opt, coil::vstring &endpoint)
Create a command optional line of Endpoint of ORB.
int size(void) const
Get the number of Properties.
ExecutionContextBase *(* ECNewFunc)()
void update()
Update information of NamingServer.
std::vector< RTObject_impl * > comps
void setModuleInitProc(ModuleInitProc proc)
Set initial procedure.
PeriodicExecutionContext class.
bool initManagerServant()
ManagerServant initialization.
void shutdownOnNoRtcs()
Shutdown Manager.
bool initLogger()
System logger initialization.
bool initNaming()
NamingManager initialization.
#define RTC_INFO(fmt)
Information level log output macro.
void unload(const std::string &file_name)
Unload the module.
void lock()
Acquire log lock Acquire log lock when the lock mode is set.
void(* RtcDeleteFunc)(RTObject_impl *rtc)
ComponentManager m_compManager
ComponentManager.
void copyFromProperties(SDOPackage::NVList &nv, const coil::Properties &prop)
Copy the properties to NVList.
bool operator()(RTObject_impl *comp)
void cleanupComponent(RTObject_impl *comp)
Unregister RT-Components.
Properties & getNode(const std::string &key)
Get node of properties.
PortableServer::POA_var m_pPOA
The pointer to the POA.
void disableLock()
Disable the lock mode.
void unlock()
Release the log lock Release the log lock when the lock mode is set.
void shutdownORB()
ORB finalization.
ECFactoryManager m_ecfactory
ExecutionContext Manager.
void PeriodicECSharedCompositeInit(RTC::Manager *manager)
bool initTimer()
Timer initialization.
std::string formatString(const char *naming_format, coil::Properties &prop)
Construct registration information when registering to Naming server.
void unbindObject(const char *name)
Unbind the specified objects from NamingService.
void(* ECDeleteFunc)(ExecutionContextBase *ec)
OrbRunner * m_runner
The pointer to ORB helper class.
SDO service consumer base class and its factory.
bool registerFactory(coil::Properties &profile, RtcNewFunc new_func, RtcDeleteFunc delete_func)
Register RT-Component Factory.
void shutdownComponents()
NamingManager finalization.
#define RTC_VERBOSE(fmt)
Verbose level log output macro.
void setProperties(const coil::Properties &prop)
[local interface] Set RTC property
PortableServer::POAManager_var m_pPOAManager
The pointer to the POAManager.
ModuleInitProc m_initProc
User's initialization function's pointer.
std::vector< RTObject_impl * > getComponents()
Get all RT-Components registered in the Manager.
int usleep(useconds_t usec)
Stop a processing at specified micro second time.
bool initORB()
CORBA ORB initialization.
void unbindAll()
Unbind all objects from NamingService.