diff options
author | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-13 23:07:33 +0100 |
---|---|---|
committer | Romain Forlot <romain.forlot@iot.bzh> | 2017-03-16 17:15:55 +0100 |
commit | 63d31e29e366fb9dd85debc897fdbc91d9cb2e42 (patch) | |
tree | 3218c15604ce2e7ec0ceba56368e273512f664da /src/utils/signals.hpp | |
parent | a0e0cb5ac95e779cd2746d8c1f0740e141bbcc41 (diff) |
Search into generic_name as well as name + prefix, but
always register generic_name into subscribed_signals.
It will be the output on event and make easier to find
the subscribed signals into the map without prefix.
Change-Id: Iaf0060bedb54003b0c77121afd2bd35d832dba25
Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'src/utils/signals.hpp')
-rw-r--r-- | src/utils/signals.hpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/utils/signals.hpp b/src/utils/signals.hpp index 4675b1f4..00b9e3ed 100644 --- a/src/utils/signals.hpp +++ b/src/utils/signals.hpp @@ -46,6 +46,8 @@ void lookup_signals_by_name(const std::string& key, std::vector<T>& signals, std { if(::fnmatch(key.c_str(), s.get_generic_name().c_str(), FNM_CASEFOLD) == 0) found_signals.push_back(&s); + if(::fnmatch(key.c_str(), s.get_name().c_str(), FNM_CASEFOLD) == 0) + found_signals.push_back(&s); } } @@ -55,7 +57,9 @@ void lookup_signals_by_name(const std::string& key, std::vector<T>& signals, std for(T& s : signals) { if(::fnmatch(key.c_str(), s.get_generic_name().c_str(), FNM_CASEFOLD) == 0) - found_signals_name.push_back(s.get_name()); + found_signals_name.push_back(s.get_generic_name()); + if(::fnmatch(key.c_str(), s.get_name().c_str(), FNM_CASEFOLD) == 0) + found_signals_name.push_back(s.get_generic_name()); } } |