aboutsummaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/source.cpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-28 20:06:08 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit7b5a679d0ae117eb6b5bbcf516bf9e5051afd7dd (patch)
tree9b66692a0d25abba64a00bc8f5267a46007d70f1 /signal-composer-binding/source.cpp
parent0ea61ebe60b1be3b33c400bf1a8ebf9cc6644349 (diff)
Inheritance of some signals parameters from source
Stores sourceAPI as shared_ptr too. Change-Id: I2dcd919b3053f29812a9bece14feb4f620f23ce3 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/source.cpp')
-rw-r--r--signal-composer-binding/source.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/signal-composer-binding/source.cpp b/signal-composer-binding/source.cpp
index 5989dac..d1b2120 100644
--- a/signal-composer-binding/source.cpp
+++ b/signal-composer-binding/source.cpp
@@ -21,8 +21,11 @@
SourceAPI::SourceAPI()
{}
-SourceAPI::SourceAPI(const std::string& api, const std::string& info, CtlActionT* init, CtlActionT* getSignals):
- api_(api), info_(info), init_(init), getSignals_(getSignals)
+SourceAPI::SourceAPI(const std::string& api, const std::string& info, CtlActionT* init, CtlActionT* getSignals, CtlActionT* onReceived, int retention):api_(api),
+ info_(info),
+ init_(init),
+ getSignals_(getSignals),
+ signalsDefault_({onReceived, retention})
{}
int SourceAPI::init()
@@ -40,6 +43,11 @@ std::string SourceAPI::api() const
return api_;
}
+const struct signalsDefault& SourceAPI::signalsDefault() const
+{
+ return signalsDefault_;
+}
+
void SourceAPI::addSignal(const std::string& id, const std::string& event, std::vector<std::string>& depends, int retention, const std::string& unit, double frequency, CtlActionT* onReceived, json_object* getSignalsArgs)
{
std::shared_ptr<Signal> sig = std::make_shared<Signal>(id, event, depends, unit, retention, frequency, onReceived, getSignalsArgs);