/** * @file NFThread.h * @brief Auto Thread »ý¼º Ŭ·¡½º * @remarks * @author °­µ¿¸í(edith2580@gmail.com) * @date 2009-04-02 */ #pragma once #include namespace Nave { /** * @class NFThread * @brief ½º·¹µå °´Ã¼ Ŭ·¡½º * @remarks * * @par * @author Edith * @date 2009-04-05 */ class NFThread { public: NFThread() : m_hThreadHandle(INVALID_HANDLE_VALUE) { } ~NFThread() { } typedef unsigned int(__stdcall *LPThreadFunc)(void*); /// ½º·¹µå ÇÔ¼öÆ÷ÀÎÅÍ static inline unsigned int __stdcall ThreadFunc(void* pArg); /// ½º·¹µå ÇÚµéÀ» ¸®ÅÏÇÑ´Ù. inline HANDLE GetHandle() { return m_hThreadHandle; } /// ½º·¹µå ÇÚµéÀ» ¼³Á¤ÇÑ´Ù. inline void SetHandle(HANDLE hHandle) { m_hThreadHandle = hHandle; } /// ½ÇÁ¦ ½ÇÇà µÇ´Â ·çÇÁ¸¦ ³Ö´Â´Ù. virtual unsigned int Run() = 0; /// ·çÇÁ°¡ ³¡³¯ ¼ö ÀÖ´Â ·çƾÀ» ³Ö´Â´Ù. virtual BOOL End() = 0; private: /// ½º·¹µåÇÚµé HANDLE m_hThreadHandle; // friend class NFThreadManager; }; /// ½º·¹µå È£ÃâÇÔ¼ö inline unsigned int __stdcall NFThread::ThreadFunc(void* pArg) { return static_cast(pArg)->Run(); } }