#pragma once #include "resource.h" /** @class 杂事线程 * @brief 杂事线程类,继承 nbase::FrameworkThread * @copyright (c) 2015, NetEase Inc. All rights reserved * @date 2015/1/1 */ class MiscThread : public nbase::FrameworkThread { public: MiscThread(enum ThreadId thread_id, const char *name) : FrameworkThread(name) , thread_id_(thread_id) {} ~MiscThread(void) {} private: /** * 虚函数,初始化线程 * @return void 无返回值 */ virtual void Init() override; /** * 虚函数,线程退出时,做一些清理工作 * @return void 无返回值 */ virtual void Cleanup() override; private: enum ThreadId thread_id_; }; /** @class MainThread * @brief 主线程(UI线程)类,继承 nbase::FrameworkThread * @copyright (c) 2015, NetEase Inc. All rights reserved * @date 2015/1/1 */ class MainThread : public nbase::FrameworkThread { public: MainThread() : nbase::FrameworkThread("MainThread") {} virtual ~MainThread() {} private: /** * 虚函数,初始化主线程 * @return void 无返回值 */ virtual void Init() override; /** * 虚函数,主线程退出时,做一些清理工作 * @return void 无返回值 */ virtual void Cleanup() override; private: std::unique_ptr misc_thread_; // 专门处理杂事的线程 };