diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-09-21 08:50:38 +0200 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-12-14 11:00:25 +0100 |
commit | e93cb3415e883bbd73528ca6a08e53e854f7bee0 (patch) | |
tree | 20d2f75be8486dd05e8f64434838069145fe601e /signal-composer-binding/signal.cpp | |
parent | 78202d5bd8a8d09a55bb71b9df6d3f54b18184b8 (diff) |
Find all signals that matches the searched pattern
Change-Id: Ia562fbd90aaeaa57c1c731d0f66dd31865db7e71
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal.cpp')
-rw-r--r-- | signal-composer-binding/signal.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/signal-composer-binding/signal.cpp b/signal-composer-binding/signal.cpp index 309a156..a9a18b0 100644 --- a/signal-composer-binding/signal.cpp +++ b/signal-composer-binding/signal.cpp @@ -16,8 +16,6 @@ */ #include <float.h> -#include <fnmatch.h> -#include <memory> #include "signal.hpp" #include "signal-composer.hpp" @@ -67,7 +65,7 @@ bool Signal::operator ==(const Signal& other) const bool Signal::operator ==(const std::string& aName) const { - if(! fnmatch(aName.c_str(), id_.c_str(), FNM_CASEFOLD)) {return true;} + if(id_.find(aName) != std::string::npos) {return true;} if(event_.find(aName) != std::string::npos) {return true;} return false; @@ -168,11 +166,11 @@ void Signal::attachToSourceSignals(bindingApp& bApp) { if(srcSig.find("/") == std::string::npos) { - std::shared_ptr<Signal> sig = bApp.searchSignal(srcSig); - if(sig) + std::vector<std::shared_ptr<Signal>> sig = bApp.searchSignals(srcSig); + if(sig[0]) { AFB_NOTICE("Attaching %s to %s", id_.c_str(), srcSig.c_str()); - sig->attach(this); + sig[0]->attach(this); continue; } AFB_WARNING("Can't attach. Is %s exists ?", srcSig.c_str()); |