当前位置: 首页>>代码示例>>C++>>正文


C++ IPlugin::getName方法代码示例

本文整理汇总了C++中IPlugin::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ IPlugin::getName方法的具体用法?C++ IPlugin::getName怎么用?C++ IPlugin::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在IPlugin的用法示例。


在下文中一共展示了IPlugin::getName方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: throw

/* Destructor */
sentry::Sentry::~Sentry() throw(){

    /* Execute the pre-shutdown actions */
    IHookPoint* pre_shutdown = findHookPoint("core.pre_shutdown");
    if( ! pre_shutdown ){
        Logger::log("Could not find hookpoint core.pre_shutdown", Logger::LOG_ERROR);
    }else{
        _executeCommandsIn(pre_shutdown);
        delete pre_shutdown;
    }

    /* Unload the plug-ins */
    for(map<string, IPlugin*>::iterator it = _plugins.begin(); it != _plugins.end(); it++){
	IPlugin* plugin = it->second;
        Logger::log("Unloading " + plugin->getName(), Logger::LOG_INFO);
	delete plugin;
    }

    delete _config;

    /* elete the hookpoints */
    for(map<string, IHookPoint*>::iterator it = _hookpoints.begin(); it != _hookpoints.end(); it++){
        IHookPoint* hookpoint = it->second;
        delete hookpoint;
    }

}
开发者ID:coenbijlsma,项目名称:sentry-cpp,代码行数:28,代码来源:Sentry.cpp

示例2: plugindir

void sentry::Sentry::loadPlugins(){
    string plugindir(_config->getValue("application", "plugindir"));
    if(plugindir.empty()){
        Logger::log("Plugin directory not in config.", Logger::LOG_FATAL);
        exit(Sentry::EXIT_NO_PLUGIN_DIR);
    }else{
        plugindir += "/";
    }

    vector<string> files = _getPluginLibNames(plugindir);

    /**
     * Load the plug-ins
     */
    for(unsigned int i = 0; i < files.size(); i++){
	try{
	    string pluginfile = files.at(i);
	    IPlugin* plugin = PluginLoader::loadPlugin(pluginfile, this);

	    if(plugin != 0){
		_plugins[plugin->getName()] = plugin;
		_pluginpathmap[plugin->getName()] = pluginfile;
		vector<IHookPoint*> hookpoints = plugin->getProvidingHookPoints();

		for(int h = 0; h < hookpoints.size(); h++){
		    IHookPoint* hookpoint = hookpoints.at(h);

		    if( findHookPoint(hookpoint->getName()) == 0 ){
			_hookpoints[hookpoint->getName()] = hookpoint;
		    }else{
                        Logger::log("Ignoring already available hookpoint " + hookpoint->getName(), Logger::LOG_WARNING);
		    }
		}
	    }
	}
	catch(NoSuchLibraryException& nsle){
            Logger::log(nsle.what(), Logger::LOG_ERROR);
	}
	catch(NoSuchSymbolException& nsse){
            Logger::log(nsse.what(), Logger::LOG_ERROR);
	}

    }

    this->_activatePlugins();
}
开发者ID:coenbijlsma,项目名称:sentry-cpp,代码行数:46,代码来源:Sentry.cpp

示例3: findHookPoint

void sentry::Sentry::_activatePlugins(){

    // activate all the plug-ins
    for(map<string, IPlugin*>::iterator it = _plugins.begin(); it != _plugins.end(); it++){
        IPlugin* plugin = it->second;
        if( ! plugin->activate()){
            Logger::log("Could not activate plug-in " + plugin->getName(), Logger::LOG_WARNING);
        }
    }

    IHookPoint* post_load_plugins = findHookPoint("core.post_load_plugins");
    if(post_load_plugins == 0){
        Logger::log("Could not find hookpoint core.post_load_plugins", Logger::LOG_ERROR);
    }else{
        _executeCommandsIn(post_load_plugins);
    }

    while(this->_haveActivePlugins()){
        usleep(100000);
    }

    Logger::log("No more active plug-ins, shutting down.", Logger::LOG_INFO);
}
开发者ID:coenbijlsma,项目名称:sentry-cpp,代码行数:23,代码来源:Sentry.cpp


注:本文中的IPlugin::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。