中间件底层,websocket

YamlConfig.h 1.0KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #pragma once
  2. #include <string>
  3. #include <boost/noncopyable.hpp>
  4. #include <yaml-cpp/yaml.h>
  5. #include <fstream>
  6. using namespace std;
  7. #pragma comment(lib,"libyaml-cppmd-mt.lib")
  8. #define YAMLCONFIGFILEPATH "HttpServer.yml"
  9. class YamlConfig :public boost::noncopyable
  10. {
  11. public:
  12. YamlConfig();
  13. ~YamlConfig();
  14. static YamlConfig* GetInstance() { return &sp; };
  15. auto GetWsServerIP()const { return wsServerIP; }
  16. auto GetWsServerPort()const { return wsServerPort; }
  17. auto GetAcdIP() const { return acdIP; };
  18. auto GetAcdPort() const { return acdPort; };
  19. auto GetHttpServerIP() const { return httpIP; };
  20. auto GetHttpServerPort() const { return httpPort; };
  21. std::string GetWssSSLFilePath()const { return sslFilePath; }
  22. std::string GetWssPwd() const { return sslPwd; }
  23. int GetWssPort() const { return wssPort; }
  24. private:
  25. static YamlConfig sp;
  26. private:
  27. std::string wsServerIP;
  28. int wsServerPort;
  29. std::string acdIP;
  30. int acdPort;
  31. string httpIP;
  32. int httpPort;
  33. int wssPort;
  34. std::string sslFilePath;
  35. std::string sslPwd;
  36. };