OregonCore  revision 80751cf-git
Your Favourite TBC server
SqlQuery Class Reference

#include <SqlOperations.h>

+ Inheritance diagram for SqlQuery:

Public Member Functions

 SqlQuery (const char *sql, Oregon::IQueryCallback *callback, SqlResultQueue *queue)
 
 ~SqlQuery ()
 
void Execute (Database *db)
 
- Public Member Functions inherited from SqlOperation
virtual void OnRemove ()
 
virtual ~SqlOperation ()
 

Private Attributes

const char * m_sql
 
Oregon::IQueryCallbackm_callback
 
SqlResultQueuem_queue
 

Detailed Description

Definition at line 156 of file SqlOperations.h.

Constructor & Destructor Documentation

SqlQuery::SqlQuery ( const char *  sql,
Oregon::IQueryCallback callback,
SqlResultQueue queue 
)
inline

Definition at line 163 of file SqlOperations.h.

164  : m_sql(strdup(sql)), m_callback(callback), m_queue(queue) {}
Oregon::IQueryCallback * m_callback
SqlResultQueue * m_queue
const char * m_sql
SqlQuery::~SqlQuery ( )
inline

Definition at line 165 of file SqlOperations.h.

References SqlOperation::Execute().

166  {
167  void* tofree = const_cast<char*>(m_sql);
168  free(tofree);
169  }
const char * m_sql

Member Function Documentation

void SqlQuery::Execute ( Database db)
virtual

Implements SqlOperation.

Definition at line 33 of file SqlOperations.cpp.

References SqlStatement::m_sql, and Database::Query().

34 {
35  if (!m_callback || !m_queue)
36  return;
37 
38  // execute the query and store the result in the callback
40  // add the callback to the sql result queue of the thread it originated from
42 }
Oregon::IQueryCallback * m_callback
QueryResult_AutoPtr Query(const char *sql)
Definition: Database.cpp:383
SqlResultQueue * m_queue
virtual void SetResult(QueryResult_AutoPtr result)=0
void add(const T &item)
Definition: LockedQueue.h:55
const char * m_sql

Member Data Documentation

Oregon::IQueryCallback* SqlQuery::m_callback
private

Definition at line 160 of file SqlOperations.h.

SqlResultQueue* SqlQuery::m_queue
private

Definition at line 161 of file SqlOperations.h.

const char* SqlQuery::m_sql
private

Definition at line 159 of file SqlOperations.h.


The documentation for this class was generated from the following files: