本文整理汇总了C++中Registry::setManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Registry::setManager方法的具体用法?C++ Registry::setManager怎么用?C++ Registry::setManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::setManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onInit
bool ComponentEngine::onInit()
{
trace_enter();
Registry *reg = Registry::getRegistry();
log_info("ComponentEngine::onInit() starting...");
try {
//-----------------------------------------
// create & register CommunicationManager
//
IoManager *ioMgr = new IoManager();
ioMgr->setName(IO_MGNAGER);
m_managers.insert(make_pair(IO_MGNAGER, ioMgr));
reg->setManager(IO_MGNAGER, ioMgr);
log_info("CommunicationManager created...");
//-----------------------------------------
// create & register ComponentManager
//
ComponentManager *componentMgr = new ComponentManager();
componentMgr->setName(COMPONENT_MANAGER);
m_managers.insert(make_pair(COMPONENT_MANAGER, componentMgr));
reg->setManager(COMPONENT_MANAGER, componentMgr);
//-----------------------------------------
// create & register PackageDeployer
//
PackageDeployer *pkgDeployer = new PackageDeployer();
pkgDeployer->setName(PACKAGE_DEPLOYER);
m_managers.insert(make_pair(PACKAGE_DEPLOYER, pkgDeployer));
reg->setManager(PACKAGE_DEPLOYER, pkgDeployer);
//---------------------------------------------
// create ArchiveManager for streaming protocol
//
ArchiveManager *arcMgr = new ArchiveManager(DEFAULT_ARCHIVE_TYPE);
arcMgr->setName(ARCHIVE_MANAGER);
m_managers.insert(make_pair(ARCHIVE_MANAGER, arcMgr));
reg->setManager(ARCHIVE_MANAGER, arcMgr);
//---------------------------------------------
// ControllerManager
//
ControllerManager *cntrMgr = new ControllerManager();
cntrMgr->setName(CONTROLLER_MANAGER);
m_managers.insert(make_pair(CONTROLLER_MANAGER, cntrMgr));
reg->setManager(CONTROLLER_MANAGER, cntrMgr);
//---------------------------------------------
// MonitorManager
//
MonitorManager *mntMgr = new MonitorManager();
mntMgr->setName(MONITOR_MANAGER);
m_managers.insert(make_pair(MONITOR_MANAGER, mntMgr));
reg->setManager(MONITOR_MANAGER, mntMgr);
//-----------------------------------------
// create & register ServiceManager
//
ServiceManager *serviceMgr = new ServiceManager();
serviceMgr->setName(SERVICE_MGNAGER);
m_managers.insert(make_pair(SERVICE_MGNAGER, serviceMgr));
reg->setManager(SERVICE_MGNAGER, serviceMgr);
//---------------------------------------------
// MWAdaptorManager
//
#ifdef MW_ADAPTOR
MWAdaptorManager *mwAdaptorMgr = new MWAdaptorManager();
mwAdaptorMgr->setName(MWADAPTOR_MANAGER);
m_managers.insert(make_pair(MWADAPTOR_MANAGER, mwAdaptorMgr));
reg->setManager(MWADAPTOR_MANAGER, mwAdaptorMgr);
#endif
//-----------------------------------------
// initializing the managers
//
ManagerMap::const_iterator iter = m_managers.begin();
for (; iter != m_managers.end(); ++iter) {
log_info("Manager init entering : mgr.name=" << iter->second->getName());
iter->second->setConfig(getSystemConfig()->getChild(iter->second->getName()));
bool ret = iter->second->init();
if (ret) {
log_info("Manager init OK : mgr.name=" << iter->second->getName());
}
else {
log_error("Manager init FAIL : mgr.name=" << iter->second->getName());
}
}
}
catch (Exception &e) {
log_error(e);
}
//.........这里部分代码省略.........