68 Plugins::const_iterator itFound =
m_plugins.find(iName);
74 <<
"The plugin '" << iName <<
"' should have been in loadable\n '" << lib
75 <<
"'\n but was not there. This means the plugin cache is incorrect. Please run 'EdmPluginRefresh " << lib
79 auto const&
value = itFound->second.front();
80 while (
value.m_ptr.load(std::memory_order_acquire) ==
nullptr) {
84 auto const&
value = itFound->second.front();
85 while (
value.m_ptr.load(std::memory_order_acquire) ==
nullptr) {
89 return itFound->second.front().m_ptr.load(std::memory_order_acquire);
94 Plugins::const_iterator itFound =
m_plugins.find(iName);
97 if (
nullptr != slib) {
102 <<
"The plugin '" << iName <<
"' should have been in loadable\n '" << lib
103 <<
"'\n but was not there. This means the plugin cache is incorrect. Please run 'EdmPluginRefresh "
109 auto const&
value = itFound->second.front();
110 while (
value.m_ptr.load(std::memory_order_acquire) ==
nullptr) {
114 return itFound !=
m_plugins.end() ? itFound->second.front().m_ptr.load(std::memory_order_acquire) :
nullptr;
118 for (PMakers::const_iterator it = makers.begin(); it != makers.end(); ++it) {
119 while (
nullptr == it->m_ptr.load(std::memory_order_acquire))
122 iReturn.push_back(iInfo);
129 info.
name_ = it->first;
130 fillInfo(it->second, info, iReturn);
140 <<
"The plugin '" << iName <<
"' should have been loaded from\n '"
142 <<
"'\n but instead it was already loaded from\n '" << iLoadedFrom
143 <<
"'\n because some other plugin was loaded from the latter loadables.\n"
144 "To work around the problem the plugin '"
145 << iName <<
"' should only be defined in one of these loadables.";
151 assert(
nullptr != iPMaker);
162 std::vector<PluginInfo> returnValue;
const SharedLibrary * tryToLoad(const std::string &iCategory, const std::string &iPlugin)
void registerPMaker(void *iPMaker, const std::string &iName)
const std::filesystem::path & path() const
static const std::string & staticallyLinkedLoadingFileName()
if the value returned from loadingFile matches this string then the file is statically linked ...
static bool isAvailable()
virtual ~PluginFactoryBase()
void fillAvailable(std::vector< PluginInfo > &iReturn) const
std::filesystem::path loadable_
edm::signalslot::Signal< void(const std::string &, const PluginInfo &)> newPluginAdded_
signal containing plugin category, and plugin info for newly added plugin
void checkProperLoadable(const std::string &iName, const std::string &iLoadedFrom) const
static const std::string & loadingFile()
file name of the shared object being loaded
void finishedConstruction()
void fillInfo(const PMakers &makers, PluginInfo &iInfo, std::vector< PluginInfo > &iReturn) const
void addFactory(const PluginFactoryBase *)
virtual const std::string & category() const =0
returns the name of the category to which this plugin factory belongs
void * findPMaker(const std::string &iName) const
tbb::concurrent_vector< PluginMakerInfo, edm::zero_allocator< PluginMakerInfo > > PMakers
const std::filesystem::path & loadableFor(const std::string &iCategory, const std::string &iPlugin)
virtual std::vector< PluginInfo > available() const
return info about all plugins which are already available in the program
const SharedLibrary & load(const std::string &iCategory, const std::string &iPlugin)
static PluginManager * get()
void * tryToFindPMaker(const std::string &iName) const
static PluginFactoryManager * get()
void newPlugin(const std::string &iName)