fastcgi++
|
Defines some functions and data types shared between ASql engines. More...
#include <asql.hpp>
Classes | |
class | Queries |
Thread safe queue of queries. More... | |
struct | QuerySet |
class | SetCanceler |
Locks the mutex on a statement and set's the canceller to the queries canceller. More... | |
Public Member Functions | |
int | queriesSize () const |
Returns the number of queued queries. | |
void | start () |
Start all threads of the handler. | |
void | terminate () |
Terminate all thread of the handler. | |
void | queue (Transaction< T > &transaction, int instance) |
Queue up a transaction for completion. | |
void | queue (T *const &statement, QueryPar &query, int instance) |
int | threads () const |
Returns the number of threads. | |
bool | running () const |
Return true if the handler is running. | |
Static Public Attributes | |
static const bool | s_false = false |
Protected Member Functions | |
ConnectionPar (const int maxThreads_) | |
virtual void | commit (const unsigned int thread=0)=0 |
virtual void | rollback (const unsigned int thread=0)=0 |
Protected Attributes | |
const int | maxThreads |
Number of threads to pool for simultaneous queries. | |
boost::mutex | threadsMutex |
boost::condition_variable | threadsChanged |
int | m_threads |
boost::scoped_array < boost::condition_variable > | wakeUp |
boost::mutex | terminateMutex |
bool | terminateBool |
Private Member Functions | |
void | intHandler (const unsigned int id) |
Function that runs in threads. | |
Private Attributes | |
boost::scoped_array< Queries > | queries |
Defines some functions and data types shared between ASql engines.
ASql::ConnectionPar< T >::ConnectionPar | ( | const int | maxThreads_ | ) | [inline, protected] |
virtual void ASql::Connection::commit | ( | const unsigned int | thread = 0 | ) | [protected, pure virtual, inherited] |
Implemented in ASql::MySQL::Connection.
void ASql::ConnectionPar< T >::intHandler | ( | const unsigned int | id | ) | [private] |
Function that runs in threads.
Definition at line 242 of file asql.hpp.
References ASql::QueryPar::callback(), ASql::QueryPar::clearResults(), ASql::QueryPar::getCallback(), ASql::QueryPar::isCallback(), ASql::ConnectionPar< T >::QuerySet::m_commit, ASql::ConnectionPar< T >::QuerySet::m_query, ASql::QueryPar::m_sharedData, ASql::ConnectionPar< T >::QuerySet::m_statement, ASql::QueryPar::parameters(), ASql::QueryPar::results(), and ASql::QueryPar::setCallback().
int ASql::ConnectionPar< T >::queriesSize | ( | ) | const |
void ASql::ConnectionPar< T >::queue | ( | Transaction< T > & | transaction, |
int | instance | ||
) |
Queue up a transaction for completion.
Definition at line 344 of file asql.hpp.
References ASql::Transaction< T >::begin(), and ASql::Transaction< T >::end().
Referenced by ASql::MySQL::Statement::queue().
void ASql::ConnectionPar< T >::queue | ( | T *const & | statement, |
QueryPar & | query, | ||
int | instance | ||
) | [inline] |
virtual void ASql::Connection::rollback | ( | const unsigned int | thread = 0 | ) | [protected, pure virtual, inherited] |
Implemented in ASql::MySQL::Connection.
bool ASql::Connection::running | ( | ) | const [inline, inherited] |
Return true if the handler is running.
Definition at line 119 of file asql.hpp.
References ASql::Connection::m_threads.
void ASql::ConnectionPar< T >::start | ( | ) |
void ASql::ConnectionPar< T >::terminate | ( | ) |
int ASql::Connection::threads | ( | ) | const [inline, inherited] |
Returns the number of threads.
Definition at line 116 of file asql.hpp.
References ASql::Connection::maxThreads.
Referenced by ASql::MySQL::Connection::connect().
int ASql::Connection::m_threads [protected, inherited] |
Definition at line 127 of file asql.hpp.
Referenced by ASql::Connection::running().
const int ASql::Connection::maxThreads [protected, inherited] |
Number of threads to pool for simultaneous queries.
Definition at line 124 of file asql.hpp.
Referenced by ASql::Connection::threads().
boost::scoped_array<Queries> ASql::ConnectionPar< T >::queries [private] |
const bool ASql::ConnectionPar< T >::s_false = false [static] |
Definition at line 195 of file asql.hpp.
Referenced by ASql::ConnectionPar< T >::SetCanceler::~SetCanceler().
bool ASql::Connection::terminateBool [protected, inherited] |
boost::mutex ASql::Connection::terminateMutex [protected, inherited] |
boost::condition_variable ASql::Connection::threadsChanged [protected, inherited] |
boost::mutex ASql::Connection::threadsMutex [protected, inherited] |
boost::scoped_array<boost::condition_variable> ASql::Connection::wakeUp [protected, inherited] |