mirror of
https://github.com/FairRootGroup/FairMQ.git
synced 2025-10-15 09:31:45 +00:00
FairMQ: Add static plugin mechanism
* Add skeleton for Take/ReleaseControl API * Add skeleton for control_static builtin plugin
This commit is contained in:
committed by
Mohammad Al-Turany
parent
17d7cd8ce4
commit
052ac8487d
@@ -126,6 +126,11 @@ auto fair::mq::PluginManager::LoadPlugin(const string& pluginName) -> void
|
||||
// Mechanism B: dynamic
|
||||
LoadPluginDynamic(pluginName.substr(2));
|
||||
}
|
||||
else if (pluginName.substr(0,2) == "s:")
|
||||
{
|
||||
// Mechanism C: static (builtin)
|
||||
LoadPluginStatic(pluginName.substr(2));
|
||||
}
|
||||
else
|
||||
{
|
||||
// Mechanism B: dynamic (default)
|
||||
@@ -141,6 +146,7 @@ auto fair::mq::PluginManager::LoadPluginPrelinkedDynamic(const string& pluginNam
|
||||
try
|
||||
{
|
||||
LoadSymbols(pluginName, dll::program_location());
|
||||
fPluginOrder.push_back(pluginName);
|
||||
}
|
||||
catch (boost::system::system_error& e)
|
||||
{
|
||||
@@ -181,6 +187,23 @@ auto fair::mq::PluginManager::LoadPluginDynamic(const string& pluginName) -> voi
|
||||
}
|
||||
}
|
||||
|
||||
auto fair::mq::PluginManager::LoadPluginStatic(const string& pluginName) -> void
|
||||
{
|
||||
// Load symbol
|
||||
if (fPluginFactories.find(pluginName) == fPluginFactories.end())
|
||||
{
|
||||
try
|
||||
{
|
||||
LoadSymbols(pluginName, dll::program_location());
|
||||
fPluginOrder.push_back(pluginName);
|
||||
}
|
||||
catch (boost::system::system_error& e)
|
||||
{
|
||||
throw PluginLoadError(ToString("An error occurred while loading static plugin ", pluginName, ": ", e.what()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
auto fair::mq::PluginManager::InstantiatePlugin(const string& pluginName) -> void
|
||||
{
|
||||
if (fPlugins.find(pluginName) == fPlugins.end())
|
||||
|
Reference in New Issue
Block a user