summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-25 18:29:48 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commitb7dd0a6e19d5387bc8d499bd1b3a99d457fa58d9 (patch)
tree0d1a26964435e8f91b96713e2b5beb3c1e94d0b2 /signal-composer-binding/signal-composer.hpp
parentdb45a68715c07e6b8fe35e322ddcbbc6c473cb2b (diff)
Enhance pointer manage and container browsing
- SourceAPI now holds share_ptr of Signal - Signal are stored in a map<string,signal> that change way to browse the signals - subscribed property included in SourceAPI. - Clean old code - renaming struct SignalValue->signalValue Change-Id: Ic5c28296ddd7197c6562e12fbc91c504c1cc0b4d Signed-off-by: Romain Forlot <romain.forlot@iot.bzh>
Diffstat (limited to 'signal-composer-binding/signal-composer.hpp')
-rw-r--r--signal-composer-binding/signal-composer.hpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/signal-composer-binding/signal-composer.hpp b/signal-composer-binding/signal-composer.hpp
index 2fd471c..a5ee0f1 100644
--- a/signal-composer-binding/signal-composer.hpp
+++ b/signal-composer-binding/signal-composer.hpp
@@ -42,7 +42,9 @@ private:
int loadOneSignal(json_object* signalsJ);
static int loadSignals(CtlSectionT* section, json_object *signalsJ);
- void processOptions(const char** opts, Signal* sig, json_object* response) const;
+ int initSourcesAPI();
+ SourceAPI* getSourceAPI(const std::string& api);
+ void processOptions(const char** opts, std::shared_ptr<Signal> sig, json_object* response) const;
public:
static Composer& instance();
static void* createContext(void* ctx);
@@ -52,18 +54,16 @@ public:
int loadSignals(json_object* signalsJ);
CtlConfigT* ctlConfig();
- int initSourcesAPI();
- std::vector<Signal*> getAllSignals();
- SourceAPI* getSourceAPI(const std::string& api);
- std::vector<Signal*> searchSignals(const std::string& aName);
- json_object* getSignalValue(const std::string& sig, json_object* options);
+ std::vector<std::shared_ptr<Signal>> getAllSignals();
+ std::vector<std::shared_ptr<Signal>> searchSignals(const std::string& aName);
+ json_object* getsignalValue(const std::string& sig, json_object* options);
int execSignalsSubscription();
};
struct pluginCBT
{
- void (*setSignalValue)(const char* aName, long long int timestamp, struct SignalValue value);
+ void (*setsignalValue)(const char* aName, long long int timestamp, struct signalValue value);
};
-extern "C" void setSignalValueHandle(const char* aName, long long int timestamp, struct SignalValue value);
+extern "C" void setsignalValueHandle(const char* aName, long long int timestamp, struct signalValue value);