summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-10-05 01:38:18 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit8df3e437f941912067231250ff5695b8a3a7fd92 (patch)
treec812fb252ad0f8a48041aff28b7fc60a75f245d1 /signal-composer-binding/signal.hpp
parent8364673ab93eb484e25c7c4776e5d705b73330b4 (diff)
LUA lib and bin embedded in project
Change-Id: I1a61b49f55e4daa305800e754a14b6041aa81b34 Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal.hpp')
-rw-r--r--signal-composer-binding/signal.hpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/signal-composer-binding/signal.hpp b/signal-composer-binding/signal.hpp
index 3d373fa..ba3e8c7 100644
--- a/signal-composer-binding/signal.hpp
+++ b/signal-composer-binding/signal.hpp
@@ -40,6 +40,17 @@ struct signalValue {
double numVal;
bool hasStr;
std::string strVal;
+
+ signalValue():
+ hasBool(false), boolVal(false), hasNum(false), numVal(0), hasStr(false), strVal("") {};
+ signalValue(bool b):
+ hasBool(true), boolVal(b), hasNum(false), numVal(0), hasStr(false), strVal("") {};
+ signalValue(int b):
+ hasBool(true), boolVal(b), hasNum(false), numVal(0), hasStr(false), strVal("") {};
+ signalValue(double d):
+ hasBool(false), boolVal(false), hasNum(true), numVal(d), hasStr(false), strVal("") {};
+ signalValue(const std::string& s):
+ hasBool(false), boolVal(false), hasNum(false), numVal(0), hasStr(true), strVal(s) {};
};
/// @brief Holds a signal (raw or virtual) definition. Value could be of
@@ -68,6 +79,7 @@ public:
Signal();
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);
+ ~Signal();
explicit operator bool() const;
bool operator==(const Signal& other) const;
@@ -92,7 +104,13 @@ public:
int recursionCheck(Signal* obs);
};
+extern "C" void searchNsetSignalValueHandle(const char* aName, uint64_t timestamp, struct signalValue value);
+extern "C" void setSignalValueHandle(void* aSignal, uint64_t timestamp, struct signalValue value);
+
+/// @brief Holds composer callbacks and obj to manipulate
struct signalCBT
{
- void (*setSignalValue)(const char* aName, uint64_t timestamp, struct signalValue value);
+ void (*searchNsetSignalValue)(const char* aName, uint64_t timestamp, struct signalValue value);
+ void (*setSignalValue)(void* aSignal, uint64_t timestamp, struct signalValue value);
+ void* aSignal;
};