Beispiel #1
0
PluginDatabase::func_t ModulesPluginDatabase::getSymbol (PluginSpec const & spec, std::string const & which) const
{
	try
	{
		PluginPtr plugin = impl->modules.load (spec.getName (), spec.getConfig ());
		return plugin->getSymbol (which);
	}
	catch (...)
	{
		return NULL;
	}
}
Beispiel #2
0
std::vector<PluginSpec> PluginVariantDatabase::getPluginVariants (PluginSpec const & whichplugin) const
{
	PluginPtr plugin = this->impl->modules.load (whichplugin);
	KeySet ksSysconf (this->variantImpl->pluginconf);
	KeySet ksGenconf;

	// read plugin variants via genconf
	try
	{
		auto funcGenconf = reinterpret_cast<void (*) (ckdb::KeySet *, ckdb::Key *)> (plugin->getSymbol ("genconf"));
		funcGenconf (ksGenconf.getKeySet (), 0);
	}
	catch (kdb::tools::MissingSymbol & e)
	{
		// no genconf, but maybe sysconf variants
		KeySet placeholder;
		return this->getPluginVariantsFromSysconf (whichplugin, ksSysconf, placeholder);
	}

	// get plugin variants from genconf, but also consider sysconf for disable/override
	return this->getPluginVariantsFromGenconf (whichplugin, ksGenconf, ksSysconf);
}