summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/source.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-22 18:16:57 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit51ee5299a7db41e52da2cf52dd9cd9c05b76740a (patch)
treeecdc922c7c7573ddb0dc091c9cbc3b111a0cc981 /signal-composer-binding/source.cpp
parenta758f4a632adc7fff4769d97379264de6c68685d (diff)
Finalize subscription to be a simple relay for now
Adding new object holding signals subscribed and afb event that observes Signals using Reactive response observer design pattern Change-Id: I96647d36e0d27c25a399c1b3789621a803a845b6 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/source.cpp')
-rw-r--r--signal-composer-binding/source.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp
index d777515..f7dee11 100644
--- a/signal-composer-binding/source.cpp
+++ b/signal-composer-binding/source.cpp
@@ -44,14 +44,14 @@ std::string SourceAPI::api() const
void SourceAPI::addSignal(const std::string& id, const std::string& event, std::vector<std::string>& depends, const std::string& sClass, const std::string& unit, double frequency, CtlActionT* onReceived, json_object* getSignalsArgs)
{
- std::shared_ptr<Signal> sig = std::make_shared<Signal>(id, event, depends, unit, frequency, onReceived, getSignalsArgs);
+ Signal* sig = new Signal(id, event, depends, unit, frequency, onReceived, getSignalsArgs);
signalsMap_[sig] = false;
}
-std::vector<std::shared_ptr<Signal>> SourceAPI::getSignals() const
+std::vector<Signal*> SourceAPI::getSignals() const
{
- std::vector<std::shared_ptr<Signal>> signals;
+ std::vector<Signal*> signals;
for (auto& sig: signalsMap_)
{
signals.push_back(sig.first);
@@ -59,9 +59,9 @@ std::vector<std::shared_ptr<Signal>> SourceAPI::getSignals() const
return signals;
}
-std::vector<std::shared_ptr<Signal>> SourceAPI::searchSignals(const std::string& name) const
+std::vector<Signal*> SourceAPI::searchSignals(const std::string& name) const
{
- std::vector<std::shared_ptr<Signal>> signals;
+ std::vector<Signal*> signals;
for (auto& sig: signalsMap_)
{
if(*sig.first == name)