本文整理汇总了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 ();
}
}
示例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;
}
示例3: checkResolver
void Plugins::checkResolver (Plugin & plugin)
{
if (plugin.findInfo ("resolver", "provides"))
{
++nrResolverPlugins;
}
if (nrResolverPlugins > 1)
{
--nrResolverPlugins;
throw ResolverPlugin ();
}
}
示例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;
}