/*************************************************************************** Replicate Work Class ----------------------------------------- begin : 2012/10/14 copyright : (C) 2010 SolutionBox Inc. author : Service 1 Team email : svc1@solbox.com version : 1.0 CopyRight(C) 2010 SolutionBox Inc. All Rights reserved. Redistribution and use in source and binary forms, with or with out modification, are not permitted in outside of SolutionBox Inc. ***************************************************************************/ #ifndef __CATEGORIZE_THREAD__ #define __CATEGORIZE_THREAD__ #include #include #include "Logger.h" #include "Data.h" #include "DataQueue.h" #include "ProcessStatus.h" #include "Database.h" /// @brief class CCategorizeThread { public: /// @brief »ý¼ºÀÚ /// @param [in] pLogger ·Î±ëÀ» À§ÇÑ Å¬·¡½º. CCategorizeThread(CQueue* pQueueFileInfo , CQueue* pQueueDeleteJob , CQueue* pQueueCompleteJob); ~CCategorizeThread(); /// @brief Thread¸¦ »ý¼ºÇϰí, À̸¦ ½ÃÀÛÇÑ´Ù. /// @param none /// @return ¼º°øÀº return true ½ÇÆÐ´Â return false bool Start(); bool DbConnect(); void DbClose(); /// @brief ProcessStatus ³»ÀÇ RCDB °ü·Ã ¼³Á¤°ªÀ» ÀÌ¿ëÇØ DB ConnectionÀ» ÇÑ´Ù. /// @param None /// @return ¼º°øÇϸé return true ½ÇÆÐÇϸé return false bool ThreadInit(); bool Categorize(); // Attributes private: DataBase* m_pPgSQL; CQueue* m_pQueueFileInfo; CQueue* m_pQueueDeleteJob; CQueue* m_pQueueCompleteJob; std::string m_szHost; int m_nPort; std::string m_szDBName; std::string m_szAcct; std::string m_szPasswd; bool m_bServiceTableSeparate; // ¾²·¹µå ÇÚµé pthread_t m_threadHandle; // ¾²·¹µå ½ÃÀÛ ·çƾÀÌ´Ù. static void* EntryPoint(void* arg); // ÇØ´ç ÇÔ¼öÀÇ ³»¿ëÀº ¼öÁ¤ÇÏÁö ¸»°Í. void Execute(); }; #endif //__CATEGORIZE_THREAD__