26 #include <tao/Strategies/advanced_resource.h> 27 #include <tao/IORTable/IORTable.h> 36 #ifdef ORB_IS_ORBEXPRESS 37 #include <RTPortableServer.h> 40 #include <coil/Timer.h> 41 #include <coil/Signal.h> 164 static Manager* init(
int argc,
char** argv);
207 static void terminate();
339 bool activateManager();
372 void runManager(
bool no_block =
false);
374 using TaskId = coil::Timer<coil::PeriodicFunction>::TaskId;
404 TaskId addTask(std::function<
void(
void)> fn,
405 std::chrono::nanoseconds period);
451 void invoke(std::function<
void(
void)> fn,
452 std::chrono::nanoseconds delay
453 = std::chrono::seconds::zero());
490 ReturnCode_t load(
const std::string& fname,
const std::string& initfunc);
511 void unload(
const char* fname);
547 std::vector<coil::Properties> getLoadedModules();
568 std::vector<coil::Properties> getLoadableModules();
620 std::vector<coil::Properties> getFactoryProfiles();
648 bool registerECFactory(
const char* name,
669 std::vector<std::string> getModulesFactories();
781 void cleanupComponents();
897 void deleteComponent(
const char* instance_name);
942 std::vector<RTObject_impl*> getComponents();
947 bool autoclean =
true);
953 bool autoclean =
true);
959 bool autoclean =
true);
965 bool autoclean =
true);
971 bool autoclean =
true);
1005 CORBA::ORB_ptr theORB();
1043 CORBA::ORB_ptr getORB();
1072 PortableServer::POA_ptr thePOA();
1073 #ifdef ORB_IS_OMNIORB 1074 PortableServer::POA_ptr theShortCutPOA();
1112 PortableServer::POA_ptr getPOA();
1113 #ifdef ORB_IS_OMNIORB 1114 PortableServer::POA_ptr getShortCutPOA();
1144 PortableServer::POAManager_ptr thePOAManager();
1184 PortableServer::POAManager_ptr getPOAManager();
1211 bool initLocalService();
1262 void initManager(
int argc,
char** argv);
1294 void initLogstreamFile();
1295 void initLogstreamPlugins();
1296 void initLogstreamOthers();
1337 void shutdownLogger();
1352 void shutdownManagerServant();
1395 std::string createORBOptions();
1414 void createORBEndpoints(coil::vstring& endpoints);
1429 void createORBEndpointOption(std::string& opt, coil::vstring endpoints);
1502 void shutdownNaming();
1534 void shutdownComponents();
1584 bool procComponentArgs(
const char* comp_arg,
1627 bool procContextArgs(
const char* ec_args,
1676 bool initExecContext();
1693 bool initComposite();
1716 bool initFactories();
1718 void initCpuAffinity();
1733 void initPreConnection();
1748 void initPreActivation();
1763 void initPreCreation();
1776 void invokeInitProc();
1821 PortServiceList* getPortsOnNameServers(
const std::string& nsname,
const std::string& kind);
1837 void connectDataPorts(PortService_ptr port, PortServiceList_var& target_ports);
1853 void connectServicePorts(PortService_ptr port, PortServiceList_var& target_ports);
1868 bool initManagerServant();
1956 std::string formatString(
const char* naming_format,
1966 void setEndpointProperty(CORBA::Object_ptr objref);
1975 void endpointPropertySwitch(
const std::string& ipver,
1976 bool& ip, std::vector<int>& ip_list);
2032 #ifdef ORB_IS_OMNIORB 2033 PortableServer::POA_var m_pShortCutPOA;
2160 bool m_needsTimer{
false};
2225 : m_vendor(
""), m_category(
""), m_impleid(imple_id), m_version(
"")
2229 : m_vendor(prop[
"vendor"]),
2230 m_category(prop[
"category"]),
2231 m_impleid(prop[
"implementation_id"]),
2232 m_version(prop[
"version"])
2236 : m_vendor(factory->profile()[
"vendor"]),
2237 m_category(factory->profile()[
"category"]),
2238 m_impleid(factory->profile()[
"implementation_id"]),
2239 m_version(factory->profile()[
"version"])
2246 if (m_impleid.empty())
return false;
2250 if (m_impleid != prop[
"implementation_id"])
2252 if (!m_vendor.empty() && m_vendor != prop[
"vendor"])
2254 if (!m_category.empty() && m_category != prop[
"category"])
2256 if (!m_version.empty() && m_version != prop[
"version"])
2262 std::string m_vendor;
2263 std::string m_category;
2264 std::string m_impleid;
2265 std::string m_version;
2278 if (m_prop[
"implementation_id"] != prop[
"implementation_id"])
2282 if (!m_prop[
"vendor"].empty() &&
2283 m_prop[
"vendor"] != prop[
"vendor"]) {
return false; }
2284 if (!m_prop[
"category"].empty() &&
2285 m_prop[
"category"] != prop[
"category"]) {
return false; }
2286 if (!m_prop[
"version"].empty() &&
2287 m_prop[
"version"] != prop[
"version"]) {
return false; }
2319 : m_name(factory->name()) {}
2322 return m_name == factory->
name();
2345 std::vector<ExecutionContextBase*>
m_ecs;
2352 modlist.emplace_back(f->
profile().getProperty(
"implementation_id"));
2369 #endif // RTC_MANAGER_H LogStreamBuf & getLogStreamBuf()
Get the log buffer.
Definition: Manager.h:241
std::vector< std::string > modlist
Definition: Manager.h:2354
ExecutionContextBase *(*)() ECNewFunc
Definition: ECFactory.h:29
virtual coil::Properties & profile()
Get the component profile.
void(*)(ExecutionContextBase *) ECDeleteFunc
Definition: ECFactory.h:30
RTObject_impl *(*)(Manager *) RtcNewFunc
Definition: Factory.h:33
Definition: Manager.h:2315
std::thread m_threadMain
Manager main thread.
Definition: Manager.h:2142
FactoryManager m_factory
ComponentManager.
Definition: Manager.h:2309
RT component logger class.
Definition: Manager.h:2348
Manager CORBA class.
Definition: ManagerServant.h:63
FactoryPredicate(const char *imple_id)
Definition: Manager.h:2224
A base class for ExecutionContext.
Definition: ExecutionContextBase.h:365
std::string & getLogLevel()
Get the log level of the configuration.
Definition: Manager.h:260
ModuleActionListener class.
Definition: ManagerActionListener.h:192
RT-Component class.
Definition: RTObject.h:90
std::thread m_threadOrb
ORB thread.
Definition: Manager.h:2133
Definition: Manager.h:2196
coil::Timer< coil::PeriodicFunction >::TaskId TaskId
Definition: Manager.h:374
Manager class.
Definition: Manager.h:90
ECFactoryPredicate(const char *name)
Definition: Manager.h:2317
std::string m_name
Definition: Manager.h:2202
RtcLifecycleActionListener class.
Definition: ManagerActionListener.h:354
LocalServiceActionListener class.
Definition: ManagerActionListener.h:715
ManagerActionListeners class.
Definition: ManagerActionListener.h:966
::coil::LogStreamBuffer LogStreamBuf
Definition: SystemLogger.h:34
int m_argvSize
The argument of ORB_init.
Definition: Manager.h:2067
RT-Component factory class.
coil::Properties & getConfig()
Get the manager configuration.
Definition: Manager.h:279
static Manager * manager
The pointer to the Manager.
Definition: Manager.h:1992
ECFactoryBase abstract class.
Definition: ECFactory.h:115
std::vector< std::filebuf * > m_logfiles
Files for log output.
Definition: Manager.h:2190
std::vector< ExecutionContextBase * > m_ecs
ExecutionContext list.
Definition: Manager.h:2345
std::string m_name
Definition: Manager.h:2324
Definition: Manager.h:2357
LogStreamBuf m_logStreamBuf
Logger buffer.
Definition: Manager.h:2172
Finalized m_finalized
Definition: Manager.h:2363
coil::Properties m_config
Managaer's configuration Properties.
Definition: Manager.h:2088
CORBA::ORB_var m_pORB
The pointer to the ORB.
Definition: Manager.h:2022
coil::Timer< coil::DelayedFunction > m_invoker
Timer Object for delay call on the Manager thread.
Definition: Manager.h:2115
void(*)(RTObject_impl *) RtcDeleteFunc
Definition: Factory.h:34
Logger class.
Definition: SystemLogger.h:99
FactoryPredicate(const coil::Properties &prop)
Definition: Manager.h:2228
void(*)(Manager *) ModuleInitProc
Definition: Manager.h:68
ModuleManager class.
Definition: ModuleManager.h:71
ECFactoryPredicate(ECFactoryBase *factory)
Definition: Manager.h:2318
Definition: Manager.h:2268
static std::atomic_flag m_isRunning
A flag to stop the main thread.
Definition: Manager.h:2010
ExecutionContext Factory class.
std::vector< RTObject_impl * > comps
Definition: Manager.h:2361
FactoryBase base class.
Definition: Factory.h:137
component action listener class
coil::Argv m_argv
The argument of ORB_init.
Definition: Manager.h:2055
FactoryPredicate(FactoryBase *factory)
Definition: Manager.h:2235
ComponentManager m_compManager
ComponentManager.
Definition: Manager.h:2215
NamingActionListener class.
Definition: ManagerActionListener.h:557
bool operator()(FactoryBase *factory)
Definition: Manager.h:2243
bool operator()(coil::Properties &prop)
Definition: Manager.h:2276
PortableServer::POA_var m_pPOA
The pointer to the POA.
Definition: Manager.h:2031
static void removeTask(TaskId id)
Remove the task from the Manager timer.
Definition: Manager.h:426
static std::mutex mutex
The mutex of the pointer to the Manager.
Definition: Manager.h:2001
Definition: Manager.h:2221
virtual const char * name()=0
Pure virtual function to get names of creation target ExecutionContext.
::RTM::ManagerActionListeners m_listeners
Definition: Manager.h:2365
Definition: ManagerActionListener.h:61
ECFactoryManager m_ecfactory
ExecutionContext Manager.
Definition: Manager.h:2336
std::list< coil::SignalAction > m_signals
An array for signals management.
Definition: Manager.h:2151
NamingServer management class.
Definition: NamingManager.h:625
coil::Properties Properties
Definition: RTC.h:72
coil::Timer< coil::PeriodicFunction > m_scheduler
Timer Object for delay call on the Manager thread.
Definition: Manager.h:2124
bool operator()(ECFactoryBase *factory)
Definition: Manager.h:2320
RT-Middleware.
Definition: FactoryInit.h:21
ModulePredicate(coil::Properties &prop)
Definition: Manager.h:2272
PortableServer::POAManager_var m_pPOAManager
The pointer to the POAManager.
Definition: Manager.h:2043
std::mutex mutex
Definition: Manager.h:2360
void operator()(FactoryBase *f)
Definition: Manager.h:2350
Definition: DefaultPeriodicTask.h:23