GlobalInfo.h 544 B

123456789101112131415161718192021222324252627282930313233343536
  1. #ifndef GLOBALINFO_H
  2. #define GLOBALINFO_H
  3. #include "nlohmann/json.hpp"
  4. #define nJson nlohmann::json
  5. /*********************** 全局配置 ************************/
  6. #define GConfig GlobalConfig::getInstance()
  7. class GlobalConfig
  8. {
  9. GlobalConfig() {}
  10. GlobalConfig(const GlobalConfig&) = delete;
  11. GlobalConfig& operator=(const GlobalConfig&) = delete;
  12. public:
  13. ~GlobalConfig();
  14. GlobalConfig& getInstance()
  15. {
  16. static GlobalConfig gConfig;
  17. return gConfig;
  18. }
  19. };
  20. #endif /* GLOBALINFO_H */