summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-26 18:38:44 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit6b492d666ed1faeeec5f761105f473956b426cc9 (patch)
tree35b292414e134f280d9616be0e0dcc6b3e7f6bd4 /signal-composer-binding/signal.hpp
parentc22ad857bcd2f567d22f3239d91fa65720718713 (diff)
Introduce retention setting in place of class
Be able to tweak retention value for each signal in seconds Change-Id: I1cabe48a2660cdeb2e9b32b277e7c819c6b49bd9 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal.hpp')
-rw-r--r--signal-composer-binding/signal.hpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/signal-composer-binding/signal.hpp b/signal-composer-binding/signal.hpp
index aa974da..36479f6 100644
--- a/signal-composer-binding/signal.hpp
+++ b/signal-composer-binding/signal.hpp
@@ -52,9 +52,10 @@ private:
std::string id_;
std::string event_;
std::vector<std::string> dependsSigV_;
- long long int timestamp_;
+ uint64_t timestamp_;
struct signalValue value_;
- std::map<long long int, struct signalValue> history_; ///< history_ - Hold signal value history in map with <timestamp, value>
+ std::map<uint64_t, struct signalValue> history_; ///< history_ - Hold signal value history in map with <timestamp, value>
+ int retention_;
double frequency_;
std::string unit_;
CtlActionT* onReceived_;
@@ -63,8 +64,8 @@ private:
public:
bool subscribed_; ///< subscribed_ - boolean value telling if yes or no the signal has been subcribed to the low level binding.
Signal();
- Signal(const std::string& id, const std::string& event, std::vector<std::string>& depends, const std::string& unit, double frequency, CtlActionT* onReceived, json_object* getSignalsArgs);
- Signal(const std::string& id, std::vector<std::string>& depends, const std::string& unit, double frequency, CtlActionT* onReceived);
+ Signal(const std::string& id, const std::string& event, std::vector<std::string>& depends, const std::string& unit, int retention, double frequency, CtlActionT* onReceived, json_object* getSignalsArgs);
+ Signal(const std::string& id, std::vector<std::string>& depends, const std::string& unit, int retention, double frequency, CtlActionT* onReceived);
explicit operator bool() const;
bool operator==(const Signal& other) const;
@@ -73,7 +74,7 @@ public:
const std::string id() const;
json_object* toJSON() const;
- void set(long long int timestamp, struct signalValue& value);
+ void set(uint64_t timestamp, struct signalValue& value);
void update(Signal* sig);
int onReceivedCB(json_object *queryJ);
void attachToSourceSignals(Composer& composer);