summaryrefslogtreecommitdiffstats
path: root/signal-composer-binding/signal-composer.hpp
diff options
context:
space:
mode:
authorRomain Forlot <romain.forlot@iot.bzh>2017-09-22 18:16:57 +0200
committerRomain Forlot <romain.forlot@iot.bzh>2017-12-14 11:00:25 +0100
commit51ee5299a7db41e52da2cf52dd9cd9c05b76740a (patch)
treeecdc922c7c7573ddb0dc091c9cbc3b111a0cc981 /signal-composer-binding/signal-composer.hpp
parenta758f4a632adc7fff4769d97379264de6c68685d (diff)
Finalize subscription to be a simple relay for now
Adding new object holding signals subscribed and afb event that observes Signals using Reactive response observer design pattern Change-Id: I96647d36e0d27c25a399c1b3789621a803a845b6 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.hpp18
1 files changed, 4 insertions, 14 deletions
diff --git a/signal-composer-binding/signal-composer.hpp b/signal-composer-binding/signal-composer.hpp
index 95cbc68..2fd471c 100644
--- a/signal-composer-binding/signal-composer.hpp
+++ b/signal-composer-binding/signal-composer.hpp
@@ -16,18 +16,12 @@
*/
#pragma once
-#include <memory>
+
#include <vector>
#include <string>
#include "source.hpp"
-typedef struct clientAppCtxS
-{
- std::vector<std::shared_ptr<Signal>> subscribedSignals;
- struct afb_event event;
-} clientAppCtxT;
-
class Composer
{
private:
@@ -35,7 +29,6 @@ private:
static CtlSectionT ctlSections_[]; ///< Config Section definition (note: controls section index should match handle retrieval in)
std::vector<SourceAPI> sourcesListV_;
- std::vector<clientAppCtxT*> subscriptions_;
explicit Composer(const std::string& filepath);
Composer();
@@ -49,7 +42,7 @@ private:
int loadOneSignal(json_object* signalsJ);
static int loadSignals(CtlSectionT* section, json_object *signalsJ);
- void processOptions(const char** opts, std::shared_ptr<Signal> sig, json_object* response) const;
+ void processOptions(const char** opts, Signal* sig, json_object* response) const;
public:
static Composer& instance();
static void* createContext(void* ctx);
@@ -60,15 +53,12 @@ public:
CtlConfigT* ctlConfig();
int initSourcesAPI();
- std::vector<std::shared_ptr<Signal>> getAllSignals();
+ std::vector<Signal*> getAllSignals();
SourceAPI* getSourceAPI(const std::string& api);
- std::vector<std::shared_ptr<Signal>> searchSignals(const std::string& aName);
+ std::vector<Signal*> searchSignals(const std::string& aName);
json_object* getSignalValue(const std::string& sig, json_object* options);
int execSignalsSubscription();
-
- void addSubscription(clientAppCtxT* ctx);
- void removeSubscription(clientAppCtxT* ctx);
};
struct pluginCBT