中间件监控程序,对接5.0版本

Config.h 440B

123456789101112131415161718192021222324
  1. #pragma once
  2. #define CONFIGPATH "sys.yaml"
  3. #include <fstream>
  4. #include <yaml-cpp/yaml.h>
  5. #pragma comment(lib,"libyaml-cppmd.lib")
  6. class CConfig
  7. {
  8. private:
  9. CConfig();
  10. ~CConfig();
  11. CConfig(const CConfig&);
  12. CConfig & operator = (const CConfig&)=default;
  13. static CConfig instance;
  14. std::string ip;
  15. int port;
  16. public:
  17. static CConfig* GetInstance() { return &instance; };
  18. std::string GetServerIP()const;
  19. int GetServerPort()const;
  20. };