EII ConfigMgr C/C++ Reference
config_mgr.hpp
Go to the documentation of this file.
1 // Copyright (c) 2020 Intel Corporation.
2 //
3 // Permission is hereby granted, free of charge, to any person obtaining a copy
4 // of this software and associated documentation files (the "Software"), to
5 // deal in the Software without restriction, including without limitation the
6 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7 // sell copies of the Software, and to permit persons to whom the Software is
8 // furnished to do so, subject to the following conditions:
9 //
10 // The above copyright notice and this permission notice shall be included in
11 // all copies or substantial portions of the Software.
12 //
13 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
18 // FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19 // IN THE SOFTWARE.
20 
21 
27 #ifndef _EII_CH_CONFIGMAGR_H
28 #define _EII_CH_CONFIGMAGR_H
29 
30 #include <string.h>
31 #include <cjson/cJSON.h>
32 #include <iostream>
33 #include <safe_lib.h>
34 #include <eii/utils/logger.h>
35 #include "eii/utils/json_config.h"
36 #include "eii/config_manager/kv_store_plugin/kv_store_plugin.h"
42 
43 
44 namespace eii {
45  namespace config_manager {
46 
50  class ConfigMgr {
51  private:
52  // AppCfg handler
53  AppCfg* m_app_cfg_handler;
54 
55  // cfgmgr_ctx_t object
56  cfgmgr_ctx_t* m_cfgmgr;
57 
61  ConfigMgr(const ConfigMgr& src);
62 
66  ConfigMgr& operator=(const ConfigMgr& src);
67 
68  public:
69 
74  ConfigMgr();
75 
81 
86  int getNumPublishers();
87 
92  int getNumSubscribers();
93 
98  int getNumServers();
99 
104  int getNumClients();
105 
110  bool isDevMode();
111 
116  std::string getAppName();
117 
123  ServerCfg* getServerByIndex(int index);
124 
130  ServerCfg* getServerByName(const char* name);
131 
137  ClientCfg* getClientByIndex(int index);
138 
144  ClientCfg* getClientByName(const char* name);
145 
151  PublisherCfg* getPublisherByIndex(int index);
152 
158  PublisherCfg* getPublisherByName(const char* name);
159 
166 
172  SubscriberCfg* getSubscriberByName(const char* name);
173 
177  ~ConfigMgr();
178 
179  };
180  }
181 }
182 #endif
eii::config_manager::ConfigMgr::getNumServers
int getNumServers()
app_cfg.hpp
ConfigMgr AppCfg class.
eii::config_manager::ConfigMgr::getServerByIndex
ServerCfg * getServerByIndex(int index)
eii::config_manager::ConfigMgr::getAppName
std::string getAppName()
subscriber_cfg.hpp
ConfigMgr interface.
publisher_cfg.hpp
ConfigMgr interface.
eii::config_manager::ConfigMgr::getSubscriberByIndex
SubscriberCfg * getSubscriberByIndex(int index)
eii::config_manager::ConfigMgr::getAppConfig
AppCfg * getAppConfig()
eii::config_manager::ConfigMgr::getNumClients
int getNumClients()
eii::config_manager::ConfigMgr::getServerByName
ServerCfg * getServerByName(const char *name)
server_cfg.hpp
ConfigMgr interface.
eii::config_manager::ServerCfg
Definition: server_cfg.hpp:44
cfgmgr_ctx_t
Definition: cfgmgr.h:58
client_cfg.hpp
ConfigMgr interface.
eii::config_manager::ClientCfg
Definition: client_cfg.hpp:43
eii::config_manager::ConfigMgr::getNumPublishers
int getNumPublishers()
eii::config_manager::ConfigMgr::ConfigMgr
ConfigMgr()
eii::config_manager::ConfigMgr::getPublisherByName
PublisherCfg * getPublisherByName(const char *name)
eii::config_manager::ConfigMgr::getSubscriberByName
SubscriberCfg * getSubscriberByName(const char *name)
eii::config_manager::ConfigMgr
Definition: config_mgr.hpp:50
eii::config_manager::ConfigMgr::getClientByIndex
ClientCfg * getClientByIndex(int index)
eii::config_manager::ConfigMgr::getPublisherByIndex
PublisherCfg * getPublisherByIndex(int index)
eii::config_manager::ConfigMgr::isDevMode
bool isDevMode()
eii::config_manager::ConfigMgr::getNumSubscribers
int getNumSubscribers()
eii::config_manager::ConfigMgr::getClientByName
ClientCfg * getClientByName(const char *name)
eii::config_manager::ConfigMgr::~ConfigMgr
~ConfigMgr()
eii::config_manager::PublisherCfg
Definition: publisher_cfg.hpp:45
eii::config_manager::AppCfg
Definition: app_cfg.hpp:49
eii::config_manager::SubscriberCfg
Definition: subscriber_cfg.hpp:43