fastcgi++
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
ASql::ConnectionPar< T > Class Template Reference

Defines some functions and data types shared between ASql engines. More...

#include <asql.hpp>

Inheritance diagram for ASql::ConnectionPar< T >:
ASql::Connection

List of all members.

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

Detailed Description

template<class T>
class ASql::ConnectionPar< T >

Defines some functions and data types shared between ASql engines.

Definition at line 143 of file asql.hpp.


Constructor & Destructor Documentation

template<class T>
ASql::ConnectionPar< T >::ConnectionPar ( const int  maxThreads_) [inline, protected]

Definition at line 176 of file asql.hpp.


Member Function Documentation

virtual void ASql::Connection::commit ( const unsigned int  thread = 0) [protected, pure virtual, inherited]

Implemented in ASql::MySQL::Connection.

template<class T >
void ASql::ConnectionPar< T >::intHandler ( const unsigned int  id) [private]
template<class T >
int ASql::ConnectionPar< T >::queriesSize ( ) const

Returns the number of queued queries.

Definition at line 372 of file asql.hpp.

template<class T>
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().

template<class T>
void ASql::ConnectionPar< T >::queue ( T *const &  statement,
QueryPar query,
int  instance 
) [inline]

Definition at line 324 of file asql.hpp.

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.

template<class T >
void ASql::ConnectionPar< T >::start ( )

Start all threads of the handler.

Definition at line 213 of file asql.hpp.

template<class T >
void ASql::ConnectionPar< T >::terminate ( )

Terminate all thread of the handler.

Definition at line 228 of file asql.hpp.

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


Member Data Documentation

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

template<class T>
boost::scoped_array<Queries> ASql::ConnectionPar< T >::queries [private]

Definition at line 157 of file asql.hpp.

template<class T>
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]

Definition at line 135 of file asql.hpp.

boost::mutex ASql::Connection::terminateMutex [protected, inherited]

Definition at line 134 of file asql.hpp.

boost::condition_variable ASql::Connection::threadsChanged [protected, inherited]

Definition at line 126 of file asql.hpp.

boost::mutex ASql::Connection::threadsMutex [protected, inherited]

Definition at line 125 of file asql.hpp.

boost::scoped_array<boost::condition_variable> ASql::Connection::wakeUp [protected, inherited]

Definition at line 132 of file asql.hpp.


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