fastcgi++
Public Member Functions | Static Public Member Functions | Protected Member Functions
ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type > Struct Template Reference

Query specialization for results of Data::SetContainer type and empty parameters (type void) More...

#include <query.hpp>

Inheritance diagram for ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >:
ASql::QueryPar

List of all members.

Public Member Functions

 Query ()
 Query (const Query &x)
Results & createResults ()
 Create the result set container for the query object.
void setResults (Results *results)
 Set's the result data to point to the passed single row result set container.
Results * results ()
 Returns a pointer to the result set container.
const Results * results () const
 Returns a const pointer to the result set container.
Results * relinquishResults ()
 Relinquishes control over the result set container.
unsigned int insertId () const
 Returns the insert ID returned from the query or 0 if nothing.
unsigned int rows () const
 Returns the rows affected/available from the query or 0 if nothing.
bool busy () const
 Returns true if copies of this query still exist (query is still working in another thread).
Error error () const
 Return the error object associated with the query.
void setCallback (boost::function< void()> callback=boost::function< void()>())
 Set the callback function to be called at the end of the query.
bool isCallback ()
 Return true if a callback is associated with this query.
boost::function< void()> getCallback ()
 Get the callback function.
void keepAlive (bool x)
 Set true if you want the query to not be cancelled when the original object is destroyed.
void cancel ()
 Call this function to cancel the query.
void enableRows ()
 Call this function to enable the retrieval of a row count (affected/available rows)
void enableInsertId ()
 Call this function to enable the retrieval of an auto-increment insert ID.
void reset ()
 Resets the object as though it was destroyed and reconstructed anew.

Static Public Member Functions

static QuerystaticRebuild (QueryPar &x)
 Takes a QueryPar reference and return a statically generated Query reference.
static QuerydynamicRebuild (QueryPar &x)
 Takes a QueryPar reference and return a dynamically generated Query reference.

Protected Member Functions

void setResults (void *results)
 Set's the shared data to point to the passed pointer.
void setParameters (void *parameters)
 Set's the shared data to point to the passed pointer.
void * relinquishParameters ()
 Relinquishes control over the parameter data.
void * parameters ()
 Return a void pointer to the parameter set.

Detailed Description

template<class Results>
struct ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >

Query specialization for results of Data::SetContainer type and empty parameters (type void)

Template Parameters:
ResultsType used to store result data. This specialization cover those types derived from Data::SetContainer

Definition at line 574 of file query.hpp.


Constructor & Destructor Documentation

template<class Results >
ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::Query ( ) [inline]

Definition at line 576 of file query.hpp.

template<class Results >
ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::Query ( const Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type > &  x) [inline]

Definition at line 577 of file query.hpp.


Member Function Documentation

bool ASql::QueryPar::busy ( ) const [inline, inherited]

Returns true if copies of this query still exist (query is still working in another thread).

Definition at line 256 of file query.hpp.

References ASql::QueryPar::m_sharedData.

void ASql::QueryPar::cancel ( ) [inline, inherited]

Call this function to cancel the query.

This will cancel the query at the earliest opportunity. Calling a cancel will rollback any changes in the associated transaction.

Definition at line 294 of file query.hpp.

References ASql::QueryPar::m_sharedData.

Referenced by ASql::QueryPar::~QueryPar().

template<class Results >
Results& ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::createResults ( ) [inline]

Create the result set container for the query object.

Returns:
A reference to the newly created result set container.

Definition at line 589 of file query.hpp.

References ASql::QueryPar::results(), and ASql::QueryPar::setResults().

template<class Results >
static Query& ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::dynamicRebuild ( QueryPar x) [inline, static]

Takes a QueryPar reference and return a dynamically generated Query reference.

Definition at line 583 of file query.hpp.

void ASql::QueryPar::enableInsertId ( ) [inline, inherited]

Call this function to enable the retrieval of an auto-increment insert ID.

Definition at line 304 of file query.hpp.

References ASql::QueryPar::m_sharedData.

void ASql::QueryPar::enableRows ( ) [inline, inherited]

Call this function to enable the retrieval of a row count (affected/available rows)

Definition at line 297 of file query.hpp.

References ASql::QueryPar::m_sharedData.

Error ASql::QueryPar::error ( ) const [inline, inherited]

Return the error object associated with the query.

Note this will be a default Error object if there was no error.

Definition at line 262 of file query.hpp.

References ASql::QueryPar::m_sharedData.

boost::function<void()> ASql::QueryPar::getCallback ( ) [inline, inherited]

Get the callback function.

Definition at line 278 of file query.hpp.

References ASql::QueryPar::m_sharedData.

Referenced by ASql::ConnectionPar< T >::intHandler().

unsigned int ASql::QueryPar::insertId ( ) const [inline, inherited]

Returns the insert ID returned from the query or 0 if nothing.

Definition at line 246 of file query.hpp.

References ASql::QueryPar::m_sharedData.

bool ASql::QueryPar::isCallback ( ) [inline, inherited]

Return true if a callback is associated with this query.

Definition at line 275 of file query.hpp.

References ASql::QueryPar::m_sharedData.

Referenced by ASql::ConnectionPar< T >::intHandler().

void ASql::QueryPar::keepAlive ( bool  x) [inline, inherited]

Set true if you want the query to not be cancelled when the original object is destroyed.

Note that the default is to cancel and this must be called from the original query object.

Definition at line 287 of file query.hpp.

References ASql::QueryPar::FLAG_KEEPALIVE, and ASql::QueryPar::m_flags.

Referenced by ASql::QueryPar::reset().

void* ASql::QueryPar::parameters ( ) [inline, protected, inherited]

Return a void pointer to the parameter set.

Usually you would keep the original typed pointer around but if you lost it for some reason you can use this and cast it.

Reimplemented in ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >, ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >, ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >, and ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >.

Definition at line 228 of file query.hpp.

References ASql::QueryPar::m_sharedData.

Referenced by ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >::createParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >::createParameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::createParameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::createParameters(), ASql::ConnectionPar< T >::intHandler(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >::parameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >::parameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::parameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::parameters(), and ASql::QueryPar::setParameters().

void* ASql::QueryPar::relinquishParameters ( ) [inline, protected, inherited]

Relinquishes control over the parameter data.

Calling this will disassociate the query object (and it's copies) from the parameter data but won't delete it. Use this if you are done with your query object but want to keep your parameter data around. The end result in the query object (and it's copies) is to have no parameter data associated with it.

Returns:
Pointer to the disassociated parameter data

Reimplemented in ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >, ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >, ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >, and ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >.

Definition at line 207 of file query.hpp.

References ASql::QueryPar::m_sharedData.

Referenced by ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >::relinquishParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >::relinquishParameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::relinquishParameters(), and ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::relinquishParameters().

template<class Results >
Results* ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::relinquishResults ( ) [inline]

Relinquishes control over the result set container.

Calling this will disassociate the query object (and it's copies) from the result set container but won't delete it. Use this if you are done with your query object but want to keep your result set container around. The end result in the query object (and it's copies) is to have no result set container associated with it.

Returns:
Pointer to the disassociated result set container

Reimplemented from ASql::QueryPar.

Definition at line 616 of file query.hpp.

References ASql::QueryPar::relinquishResults().

void ASql::QueryPar::reset ( ) [inline, inherited]

Resets the object as though it was destroyed and reconstructed anew.

Definition at line 311 of file query.hpp.

References ASql::QueryPar::FLAG_ORIGINAL, ASql::QueryPar::keepAlive(), ASql::QueryPar::m_flags, and ASql::QueryPar::m_sharedData.

template<class Results >
Results* ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::results ( ) [inline]

Returns a pointer to the result set container.

Reimplemented from ASql::QueryPar.

Definition at line 601 of file query.hpp.

References ASql::QueryPar::results().

template<class Results >
const Results* ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::results ( ) const [inline]

Returns a const pointer to the result set container.

Reimplemented from ASql::QueryPar.

Definition at line 604 of file query.hpp.

References ASql::QueryPar::results().

unsigned int ASql::QueryPar::rows ( ) const [inline, inherited]

Returns the rows affected/available from the query or 0 if nothing.

Note that if using for the number of rows from a query this will represent the number of rows available before a LIMIT.

Definition at line 253 of file query.hpp.

References ASql::QueryPar::m_sharedData.

void ASql::QueryPar::setCallback ( boost::function< void()>  callback = boost::function<void()>()) [inline, inherited]

Set the callback function to be called at the end of the query.

Note that this will be called even if there is an error or the query can cancelled.

Definition at line 268 of file query.hpp.

References ASql::QueryPar::callback(), and ASql::QueryPar::m_sharedData.

Referenced by ASql::ConnectionPar< T >::intHandler().

void ASql::QueryPar::setParameters ( void *  parameters) [inline, protected, inherited]

Set's the shared data to point to the passed pointer.

Note that the QueryPar class assumes responsibility for destroying the parameter set unless explicitly released with relinquishParameters().

Parameters:
[in]parametersA pointer to the parameter data

Definition at line 183 of file query.hpp.

References ASql::QueryPar::m_sharedData, and ASql::QueryPar::parameters().

Referenced by ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >::createParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >::createParameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::createParameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::createParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >::setParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >::setParameters(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::setParameters(), and ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::setParameters().

void ASql::QueryPar::setResults ( void *  results) [inline, protected, inherited]

Set's the shared data to point to the passed pointer.

Note that the QueryPar class assumes responsibility for destroying the result set unless explicitly released with relinquishResults().

Parameters:
[out]resultsA pointer to the result data

Definition at line 174 of file query.hpp.

References ASql::QueryPar::m_sharedData, and ASql::QueryPar::results().

Referenced by createResults(), ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::createResults(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::createResults(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::createResults(), setResults(), ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::setResults(), ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::setResults(), and ASql::Query< Parameters, Results, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::setResults().

template<class Results >
void ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::setResults ( Results *  results) [inline]

Set's the result data to point to the passed single row result set container.

Note that the Query object assumes responsibility for destroying the result set container unless explicitly released with relinquishResults().

Parameters:
[in]resultsA pointer to the result data set container

Definition at line 598 of file query.hpp.

References ASql::QueryPar::setResults().

template<class Results >
static Query& ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::staticRebuild ( QueryPar x) [inline, static]

Takes a QueryPar reference and return a statically generated Query reference.

Definition at line 580 of file query.hpp.


The documentation for this struct was generated from the following file: