Initial
This commit is contained in:
65
sql/SQLTHRD.HPP
Normal file
65
sql/SQLTHRD.HPP
Normal file
@@ -0,0 +1,65 @@
|
||||
#ifndef _SQL_SQLTHREAD_HPP_
|
||||
#define _SQL_SQLTHREAD_HPP_
|
||||
#ifndef _THREAD_MESSAGETHREAD_HPP_
|
||||
#include <thread/mthread.hpp>
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
class PureVector;
|
||||
template <class T>
|
||||
class SmartPointer;
|
||||
class ThreadCallbackPointer;
|
||||
class SQLDb;
|
||||
|
||||
class SQLThread : public MessageThread
|
||||
{
|
||||
public:
|
||||
enum Mode{Sync,Async};
|
||||
SQLThread(void);
|
||||
virtual ~SQLThread();
|
||||
BOOL open(const String &nameData,const String &userID,const String &password);
|
||||
void insertHandler(ThreadCallbackPointer pThreadCallback);
|
||||
void removeHandler(void);
|
||||
private:
|
||||
SQLThread(const SQLThread &someSQLThread);
|
||||
SQLThread &operator=(const SQLThread &someSQLThread);
|
||||
DWORD threadHandler(ThreadMessage &someThreadMessage);
|
||||
|
||||
ThreadCallback<SQLThread> mThreadHandler;
|
||||
ThreadCallbackPointer mEventHandler;
|
||||
SmartPointer<SQLDb> mSQLDb;
|
||||
};
|
||||
|
||||
inline
|
||||
SQLThread::SQLThread(void)
|
||||
: mThreadHandler(this,&SQLThread::threadHandler), mlpSQLDb(0)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
SQLThread::~SQLThread()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
SQLThread(const SQLThread &someSQLThread)
|
||||
{ // private implementation
|
||||
}
|
||||
|
||||
inline
|
||||
SQLThread &operator=(const SQLThread &someSQLThread)
|
||||
{ // private implementation
|
||||
}
|
||||
|
||||
inline
|
||||
void SQLThread::insertHandler(ThreadCallbackPointer pThreadCallback)
|
||||
{
|
||||
mEventHandler=pThreadCallback;
|
||||
}
|
||||
|
||||
inline
|
||||
void SQLThread::removeHandler(void)
|
||||
{
|
||||
mEventHandler=ThreadCallbackPointer();
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user