base
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
/***************************************************************************
|
||||
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 __ANONY_UPDATE_THREAD__
|
||||
#define __ANONY_UPDATE_THREAD__
|
||||
|
||||
#include <pthread.h>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "Logger.h"
|
||||
#include "Database.h"
|
||||
#include "FimngdData.h"
|
||||
#include "SharedMemAPR.h"
|
||||
|
||||
/// @brief
|
||||
class CAnonyUpdateThread
|
||||
{
|
||||
public:
|
||||
/// @brief 생성자
|
||||
CAnonyUpdateThread();
|
||||
~CAnonyUpdateThread();
|
||||
|
||||
/// @brief Thread를 생성하고, 이를 시작한다.
|
||||
/// @param none
|
||||
/// @return 성공은 return true 실패는 return false
|
||||
bool Start();
|
||||
|
||||
bool DbConnect();
|
||||
void DbClose();
|
||||
bool GetData();
|
||||
|
||||
/// @brief ProcessStatus 내의 RCDB 관련 설정값을 이용해 DB Connection을 한다.
|
||||
/// @param sighandle 쓰레드에서 signal에 따라 정상 종료하도록 signal handle을 전달한다.
|
||||
/// @param pShmemAnony 공유메모리 포인터
|
||||
/// @return 성공하면 return true 실패하면 return false
|
||||
bool ThreadInit(const sig_atomic_t *sighandle, CSharedMem* pShmemAnony);
|
||||
|
||||
void UpdateSharedMemory();
|
||||
|
||||
// Attributes
|
||||
private:
|
||||
DataBase* m_pPgSQL;
|
||||
|
||||
std::string m_szHost;
|
||||
int m_nPort;
|
||||
std::string m_szDBName;
|
||||
std::string m_szAcct;
|
||||
std::string m_szPasswd;
|
||||
|
||||
// 쓰레드 핸들
|
||||
pthread_t m_threadHandle;
|
||||
|
||||
const sig_atomic_t *m_sighandle;
|
||||
|
||||
CSharedMem* m_pShmemAnony;
|
||||
|
||||
std::map<std::string, struct anonymous> m_mapAnony;
|
||||
|
||||
// 쓰레드 시작 루틴이다.
|
||||
static void* EntryPoint(void* arg);
|
||||
|
||||
// 해당 함수의 내용은 수정하지 말것.
|
||||
void Execute();
|
||||
};
|
||||
#endif //__ANONY_UPDATE_THREAD__
|
||||
Reference in New Issue
Block a user