summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/source.hpp
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.hpp
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.hpp')
-rw-r--r--signal-composer-binding/source.hpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/signal-composer-binding/source.hpp b/signal-composer-binding/source.hpp
index 01bb08d..6aacf4f 100644
--- a/signal-composer-binding/source.hpp
+++ b/signal-composer-binding/source.hpp
@@ -19,21 +19,29 @@
#include <memory>
#include "signal.hpp"
+struct signalsDefault {
+ CtlActionT* onReceived;
+ int retention;
+};
+
class SourceAPI {
private:
std::string api_;
std::string info_;
CtlActionT* init_;
CtlActionT* getSignals_;
+ // Parameters inherited by source's signals if none defined for it
+ struct signalsDefault signalsDefault_;
std::map<std::string, std::shared_ptr<Signal>> signalsMap_;
public:
SourceAPI();
- SourceAPI(const std::string& api, const std::string& info, CtlActionT* init, CtlActionT* getSignal);
+ SourceAPI(const std::string& api, const std::string& info, CtlActionT* init, CtlActionT* getSignal, CtlActionT* onReceived, int retention);
int init();
std::string api() const;
+ const struct signalsDefault& signalsDefault() const;
void addSignal(const std::string& id, const std::string& event, std::vector<std::string>& sources, int retention, const std::string& unit, double frequency, CtlActionT* onReceived, json_object* getSignalsArgs);
std::vector<std::shared_ptr<Signal>> getSignals() const;