OregonCore  revision be9e804-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

Detailed Description

Definition at line 156 of file SqlOperations.h.

Constructor & Destructor Documentation

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

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 ( )

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)

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;
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

Definition at line 160 of file SqlOperations.h.

SqlResultQueue* SqlQuery::m_queue

Definition at line 161 of file SqlOperations.h.

const char* SqlQuery::m_sql

Definition at line 159 of file SqlOperations.h.

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