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


C++ Plugin::findInfo方法代码示例

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


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

示例1: checkStorage

void Plugins::checkStorage (Plugin & plugin)
{
	if (plugin.findInfo ("storage", "provides"))
	{
		++nrStoragePlugins;
	}

	if (nrStoragePlugins > 1)
	{
		--nrStoragePlugins;
		throw StoragePlugin ();
	}
}
开发者ID:BernhardDenner,项目名称:libelektra,代码行数:13,代码来源:plugins.cpp

示例2: addPlugin

void Plugins::addPlugin (Plugin & plugin, std::string which)
{
	if (!plugin.findInfo (which, "placements")) return;

	std::string stacking = plugin.lookupInfo ("stacking");

	if (which == "postgetstorage" && stacking == "")
	{
		plugins[revPostGet--] = &plugin;
		return;
	}

	plugins[placementInfo[which].current++] = &plugin;
}
开发者ID:BernhardDenner,项目名称:libelektra,代码行数:14,代码来源:plugins.cpp

示例3: checkResolver

void Plugins::checkResolver (Plugin & plugin)
{
	if (plugin.findInfo ("resolver", "provides"))
	{
		++nrResolverPlugins;
	}


	if (nrResolverPlugins > 1)
	{
		--nrResolverPlugins;
		throw ResolverPlugin ();
	}
}
开发者ID:BernhardDenner,项目名称:libelektra,代码行数:14,代码来源:plugins.cpp

示例4: checkPlacement

/**
 * @brief check if this plugin can be placed in the unfortunately
 * limited number of slots
 *
 * @param plugin the plugin to check
 * @param which placementInfo it is
 *
 * @retval true if it should be added
 * @retval false no placements (will not be added)
 */
bool Plugins::checkPlacement (Plugin &plugin, std::string which)
{
	if (!plugin.findInfo(which, "placements")) return false; // nothing to check, won't be added anyway

	std::string stacking = plugin.lookupInfo("stacking");

	if (which=="postgetstorage" && stacking == "")
	{
		if (revPostGet >= placementInfo["postgetstorage"].current)
		{
			return true;
		}

		std::ostringstream os;
		os << "Too many plugins!\n"
			"The plugin "
			<< plugin.name()
			<< " can't be positioned to position "
			<< which
			<< " anymore.\n"
			"Try to reduce the number of plugins!\n"
			"\n"
			"Failed because of stack overflow: cant place to "
			<< revPostGet  << " because "
			<< placementInfo["postgetstorage"].current
			<< " is larger (this slot is in use)." << endl;
		throw TooManyPlugins(os.str());
	}

	if (placementInfo[which].current > placementInfo[which].max)
	{
		std::ostringstream os;
		os << "Too many plugins!\n"
			"The plugin "
			<< plugin.name()
			<< " can't be positioned to position "
			<< which
			<< " anymore.\n"
			"Try to reduce the number of plugins!\n"
			"\n"
			"Failed because " << which << " with "
			<< placementInfo[which].current << " is larger than "
			<< placementInfo[which].max << endl;
		throw TooManyPlugins(os.str());
	}

	return true;
}
开发者ID:tryge,项目名称:libelektra,代码行数:58,代码来源:plugins.cpp


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