aboutsummaryrefslogtreecommitdiffstats
path: root/high-viwi-binding/high.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'high-viwi-binding/high.hpp')
-rw-r--r--high-viwi-binding/high.hpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/high-viwi-binding/high.hpp b/high-viwi-binding/high.hpp
index d021ce7..b0d8f23 100644
--- a/high-viwi-binding/high.hpp
+++ b/high-viwi-binding/high.hpp
@@ -9,15 +9,15 @@
#include <systemd/sd-event.h>
extern "C"
{
- #define AFB_BINDING_VERSION 2
- #include <afb/afb-binding.h>
+ #define AFB_BINDING_VERSION 2
+ #include <afb/afb-binding.h>
};
struct TimedEvent {
- int interval;
- afb_event event;
- std::string name;
- std::string eventName;
+ int interval;
+ afb_event event;
+ std::string name;
+ std::string eventName;
};
struct Property {
@@ -39,25 +39,25 @@ struct Property {
class High
{
public:
- High();
- void treatMessage(json_object *message);
- bool subscribe(afb_req request);
- bool unsubscribe(afb_req request);
- bool get(afb_req request, json_object **json);
- void tick(sd_event_source *source, const long &now, void *interv);
- void startTimer(const int &t);
- ~High();
- static bool startsWith(const std::string &s, const std::string &val);
- static void callBackFromSubscribe(void *handle, int iserror, json_object *result);
+ High();
+ void treatMessage(json_object *message);
+ bool subscribe(afb_req request);
+ bool unsubscribe(afb_req request);
+ bool get(afb_req request, json_object **json);
+ void tick(sd_event_source *source, const long &now, void *interv);
+ void startTimer(const int &t);
+ ~High();
void parseConfigAndSubscribe(const std::string& confd);
+ static bool startsWith(const std::string &s, const std::string &val);
+ static void callBackFromSubscribe(void *handle, int iserror, json_object *result);
private:
- std::map<std::string, afb_event> events;
- std::map<int, std::vector<TimedEvent>> timedEvents;
- std::map<std::string, std::map<std::string, Property>> registeredObjects;
- std::map<std::string, std::set<std::string>> lowMessagesToObjects;
- std::set<int> timers;
- std::string generateId() const;
- json_object *generateJson(const std::string &messageObject, std::vector<std::string> *fields = nullptr);
+ std::map<std::string, afb_event> events;
+ std::map<int, std::vector<TimedEvent>> timedEvents;
+ std::map<std::string, std::map<std::string, Property>> registeredObjects;
+ std::map<std::string, std::set<std::string>> lowMessagesToObjects;
+ std::set<int> timers;
+ std::string generateId() const;
+ json_object *generateJson(const std::string &messageObject, std::vector<std::string> *fields = nullptr);
void registerObjects(const std::string& uri, const std::map<std::string, Property>& properties);
std::map<std::string, std::map<std::string, Property>> loadDefinitions(json_object* definitionsJ) const;
void loadResources(json_object* resourcesJ);