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/source.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/source.cpp')
-rw-r--r-- | signal-composer-binding/source.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp index 2f4ab03..8481740 100644 --- a/signal-composer-binding/source.cpp +++ b/signal-composer-binding/source.cpp @@ -59,13 +59,15 @@ std::vector<std::shared_ptr<Signal>> SourceAPI::getSignals() const return signals; } -std::shared_ptr<Signal> SourceAPI::searchSignal(const std::string& name) const +std::vector<std::shared_ptr<Signal>> SourceAPI::searchSignals(const std::string& name) const { + std::vector<std::shared_ptr<Signal>> signals; for (auto& sig: signalsMap_) { - if(*sig.first == name) {return sig.first;} + if(*sig.first == name) + {signals.emplace_back(sig.first);} } - return nullptr; + return signals; } int SourceAPI::makeSubscription() |