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:
parent
2bf8bf93bd
commit
63a443527c
2 changed files with 3 additions and 2 deletions
|
@ -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);
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue