4 * Created on: 2014. 10. 15.
8 #ifndef HOSTINGHANDLER_H_
9 #define HOSTINGHANDLER_H_
11 #include "NotificationManager.h"
17 static void initialize();
18 static void initialize(HostingConfig cfg);
19 static HostingHandler *getInstance();
21 void setHostingConfig(HostingConfig cfg);
23 void changeHostingMode(HostingMode hostingMode, AutomaticMethod autoMethod = AutomaticMethod::None);
24 void changeAutomaticHostingMethod(AutomaticMethod autoMethod);
25 void changeNotifiyMethod(NotifyMethod notifyMethod);
26 void changeNotifyFrequencyType(NotifyFrequency notifyFrequency);
33 static HostingHandler *s_instance;
34 static mutex s_mutexForCreation;
36 HostingConfig hostingCfg;
38 static std::function< void(bool isHosting) > s_findHostingCandidate;
39 static std::function< void(std::string) > s_addExtraStr;
40 static std::function< void(std::shared_ptr< OCResource > resource) > s_startHosting;
41 static std::function< void(OCResourceHandle resourceHandle) > s_notify;
44 void onObserve(AttributeMap &AttMap, OCResourceHandle resourceHandle);
45 void onFoundCandidate(std::shared_ptr< OCResource > resource);
47 void runAutomaticHosting(AutomaticMethod autoMethod);
48 void stopAutomaticHosting();
50 void notifyFrequence(OCResourceHandle resourceHandle);
54 #endif /* HOSTINGHANDLER_H_ */