logconfigApi.h
Go to the documentation of this file.
1 
5 #pragma once
6 
7 
8 #include <boost/function.hpp>
9 #include <boost/system/error_code.hpp>
10 #include <boost/shared_ptr.hpp>
11 
12 #include <unordered_map>
13 #include <vector>
14 
15 class LogConfigClient;
16 
17 #ifndef LOG_TYPES
18 #define LOG_TYPES
19 
25 namespace dpyLogconfig {
29 struct App
30 {
31  std::string appname;
32  std::string level;
33  std::string path;
34  std::string modificationtime;
35 };
36 
41 typedef boost::function<void(const bool &available)> service_availability_handler;
42 
49 typedef boost::function<void(boost::system::error_code error_code)> answer_pm_handler_function;
50 
57 typedef boost::function<void(boost::system::error_code error_code, std::vector<App> apps)> list_handler_function;
58 
59 }
60 
61 #endif
62 
70 class LogConfig
71 {
72 private:
73  boost::shared_ptr<LogConfigClient> mClient;
74 public:
75  explicit LogConfig(std::string ip = "127.0.0.1");
76  ~LogConfig();
77 
78  bool isAlive();
79  void monitorServiceAvailability_S(dpyLogconfig::service_availability_handler handler);
80  void monitorServiceAvailability_U();
81  void asyncGetStatus(dpyLogconfig::list_handler_function handler, std::string name="");
82  void asyncSetLevel(std::string appName, std::string level, dpyLogconfig::answer_pm_handler_function handler);
83 
84 };
boost::function< void(boost::system::error_code error_code, std::vector< App > apps)> list_handler_function
Handler for answer function callback.
Definition: logconfigApi.h:57
This class is used to modify the log configuration.
Definition: logconfigApi.h:70
std::string appname
Definition: logconfigApi.h:31
Interacts with Logging service.
Definition: logconfigClient.h:15
boost::function< void(const bool &available)> service_availability_handler
Prototype of the handler function used to monitor service availability.
Definition: logconfigApi.h:41
std::string modificationtime
Definition: logconfigApi.h:34
std::string path
Definition: logconfigApi.h:33
boost::function< void(boost::system::error_code error_code)> answer_pm_handler_function
Handler for answer function callback.
Definition: logconfigApi.h:49
Definition: logconfigApi.h:29
std::string level
Definition: logconfigApi.h:32
Deepsy LogConfig namespace that includes the different enums, structs or method signatures that shoul...