cm_load.h 718 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #ifndef _DBP_DBCONFIG_H_
  2. #define _DBP_DBCONFIG_H_
  3. #include "global.h"
  4. #include "yaml-cpp/yaml.h"
  5. #include "cm_conn.h"
  6. class TableInfo;
  7. int GetTableIdx(void* Key, int FieldType, TableInfo* dbConfig);
  8. class ConfigHelper
  9. {
  10. private:
  11. std::string m_data;
  12. YAML::Node dtc;
  13. public:
  14. DBHost hot_instance;
  15. DBHost full_instance;
  16. public:
  17. ConfigHelper ();
  18. ~ConfigHelper ();
  19. int GetIntValue(const char* key, int default_value = 0);
  20. std::string GetStringValue(const char* key, std::string default_value = "");
  21. std::vector<int> GetIntArray(const char* key);
  22. bool load_dtc_config(std::string conf_file);
  23. bool load_hot_inst_info();
  24. bool load_full_inst_info();
  25. YAML::Node get_conf() { return dtc;}
  26. };
  27. #endif