1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

plugin: treat empty name in lookup() as wildcard

This commit is contained in:
daniel-k 2017-12-06 17:30:24 +01:00
parent 2bf8bf93bd
commit 63a443527c
2 changed files with 3 additions and 2 deletions

View file

@ -56,7 +56,8 @@ public:
static void
dumpList();
/** Find registered and loaded plugin with given name and type. */
/// Find plugin by type and (optional if empty) by name. If more match, it
/// is not defined which one will be returned.
static Plugin *
lookup(Type type, std::string name);

View file

@ -133,7 +133,7 @@ Plugin*
Plugin::lookup(Plugin::Type type, std::string name)
{
for(auto& p : pluginList) {
if(p->pluginType == type and p->name == name)
if(p->pluginType == type and (name.empty() or p->name == name))
return p;
}