/* * WeatherManager.h * * Created on: 2021年10月30日 * Author: Administrator */ #ifndef JNI_MANAGER_WEATHERMANAGER_H_ #define JNI_MANAGER_WEATHERMANAGER_H_ #include #include class WeatherManager : public Thread{ private: //城市 std::string m_city; //温度 std::string m_temperature; //天气 std::string m_weather; //天气图标 std::string m_weaIcon; bool bforceSync; private: WeatherManager(); virtual ~WeatherManager(); public: /* * @brife 获取单例实例化对象 * @return 类实例对象 * */ static WeatherManager* getInstance(void); /* * @brife 设置城市名称 * @param city 城市名 * */ void setCityName(const std::string city); /* * @brife 获取城市名称 * @return 城市名 * */ const std::string getCityName(void); /* * @brife 设置温度值 * @param temperature 温度值 * */ void setTemperature(const std::string temperature); /* * @brife 获取温度值 * @return 温度值 * */ const std::string getTemperature(void); /* * @brife 设置天气 * @param weather 天气 * */ void setWeather(const std::string weather); /* * @brife 获取天气 * @return 天气 * */ const std::string getWeather(void); /* * @brife 设置天气图标编号 * @param weaIcon 图标编号 * */ void setWeaIcon(const std::string weaIcon); /* * @brife 获取天气图标编号 * @return 图标编号 * */ const std::string getWeaIcon(void); /* * @brife 同步天气 * */ const int syncWeather(void); /** * @brife线程循环函数 * * @return true 继续线程循环 * false 推出线程 */ bool threadLoop(); /* * @brife 天气同步UI刷新回调函数 * */ void (* updateUiCb)(void* args); void reqSyncWeather(){bforceSync = 1;} }; #define WEATHERMANAGER WeatherManager::getInstance() #endif /* JNI_MANAGER_WEATHERMANAGER_H_ */