EII ConfigMgr C/C++ Reference
subscriber_cfg.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_SUBSCRIBER_CFG_H
28 #define _EII_CH_SUBSCRIBER_CFG_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"
39 
40 namespace eii {
41  namespace config_manager {
42 
43  class SubscriberCfg : public AppCfg {
44  private:
45 
46  // cfgmgr_interface_t object
47  cfgmgr_interface_t* m_cfgmgr_interface;
48 
52  SubscriberCfg(const SubscriberCfg& src);
53 
57  SubscriberCfg& operator=(const SubscriberCfg& src);
58  public:
65  explicit SubscriberCfg(cfgmgr_interface_t* cfgmgr_interface);
66 
72  config_t* getMsgBusConfig() override;
73 
80  config_value_t* getInterfaceValue(const char* key) override;
81 
87  std::string getEndpoint() override;
88 
94  std::vector<std::string> getTopics() override;
95 
101  bool setTopics(std::vector<std::string> topics_list) override;
102 
107 
111  ~SubscriberCfg();
112 
113  };
114 
115  }
116 }
117 #endif
app_cfg.hpp
ConfigMgr AppCfg class.
eii::config_manager::SubscriberCfg::~SubscriberCfg
~SubscriberCfg()
eii::config_manager::SubscriberCfg::setTopics
bool setTopics(std::vector< std::string > topics_list) override
eii::config_manager::SubscriberCfg::getSubCfg
cfgmgr_interface_t * getSubCfg()
cfgmgr_interface_t
Definition: cfgmgr.h:90
eii::config_manager::SubscriberCfg::getMsgBusConfig
config_t * getMsgBusConfig() override
eii::config_manager::SubscriberCfg::getInterfaceValue
config_value_t * getInterfaceValue(const char *key) override
eii::config_manager::SubscriberCfg::getEndpoint
std::string getEndpoint() override
cfgmgr.h
Configuration Manager C APIs.
eii::config_manager::SubscriberCfg::getTopics
std::vector< std::string > getTopics() override
eii::config_manager::AppCfg
Definition: app_cfg.hpp:49
eii::config_manager::SubscriberCfg
Definition: subscriber_cfg.hpp:43