fastcgi++
|
Query specialization for results of Data::SetContainer type and parameters of Data::Set type. More...
#include <query.hpp>
Public Member Functions | |
Query () | |
Query (const Query &x) | |
Parameters & | createParameters () |
Create the parameter set for the query object. | |
void | setParameters (Parameters *parameters) |
Set's the parameter data to point to the passed single row parameter set. | |
Parameters * | parameters () |
Returns a pointer to the parameter set. | |
const Parameters * | parameters () const |
Returns a const pointer to the parameter set. | |
Parameters * | relinquishParameters () |
Relinquishes control over the parameter set. | |
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 Query & | staticRebuild (QueryPar &x) |
Takes a QueryPar reference and return a statically generated Query reference. | |
static Query & | dynamicRebuild (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. |
Query specialization for results of Data::SetContainer type and parameters of Data::Set type.
Parameters | Type used to store parameter data. This specialization cover those types derived from Data::Set |
Results | Type used to store result data. This specialization cover those types derived from Data::SetContainer |
|
inline |
|
inline |
|
inlineinherited |
Returns true if copies of this query still exist (query is still working in another thread).
Definition at line 263 of file query.hpp.
References ASql::QueryPar::m_sharedData.
|
inlineinherited |
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 301 of file query.hpp.
References ASql::QueryPar::m_sharedData.
Referenced by ASql::QueryPar::~QueryPar().
|
inline |
Create the parameter set for the query object.
Definition at line 469 of file query.hpp.
References ASql::QueryPar::parameters(), and ASql::QueryPar::setParameters().
|
inline |
Create the result set container for the query object.
Definition at line 502 of file query.hpp.
References ASql::QueryPar::results(), and ASql::QueryPar::setResults().
|
inlinestatic |
|
inlineinherited |
Call this function to enable the retrieval of an auto-increment insert ID.
Definition at line 311 of file query.hpp.
References ASql::QueryPar::m_sharedData.
|
inlineinherited |
Call this function to enable the retrieval of a row count (affected/available rows)
Definition at line 304 of file query.hpp.
References ASql::QueryPar::m_sharedData.
|
inlineinherited |
Return the error object associated with the query.
Note this will be a default Error object if there was no error.
Definition at line 269 of file query.hpp.
References ASql::QueryPar::m_sharedData.
|
inlineinherited |
Get the callback function.
Definition at line 285 of file query.hpp.
References ASql::QueryPar::m_sharedData.
Referenced by ASql::ConnectionPar< T >::intHandler().
|
inlineinherited |
Returns the insert ID returned from the query or 0 if nothing.
Definition at line 253 of file query.hpp.
References ASql::QueryPar::m_sharedData.
|
inlineinherited |
Return true if a callback is associated with this query.
Definition at line 282 of file query.hpp.
References ASql::QueryPar::m_sharedData.
Referenced by ASql::ConnectionPar< T >::intHandler().
|
inlineinherited |
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 294 of file query.hpp.
References ASql::QueryPar::FLAG_KEEPALIVE, and ASql::QueryPar::m_flags.
Referenced by ASql::QueryPar::reset().
|
inline |
Returns a pointer to the parameter set.
Reimplemented from ASql::QueryPar.
Definition at line 481 of file query.hpp.
References ASql::QueryPar::parameters().
|
inline |
Returns a const pointer to the parameter set.
Reimplemented from ASql::QueryPar.
Definition at line 484 of file query.hpp.
References ASql::QueryPar::parameters().
|
inline |
Relinquishes control over the parameter set.
Calling this will disassociate the query object (and it's copies) from the parameter set but won't delete it. Use this if you are done with your query object but want to keep your parameter set around. The end result in the query object (and it's copies) is to have no parameter set associated with it.
Reimplemented from ASql::QueryPar.
Definition at line 496 of file query.hpp.
References ASql::QueryPar::relinquishParameters().
|
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.
Reimplemented from ASql::QueryPar.
Definition at line 529 of file query.hpp.
References ASql::QueryPar::relinquishResults().
|
inlineinherited |
Resets the object as though it was destroyed and reconstructed anew.
Definition at line 318 of file query.hpp.
References ASql::QueryPar::FLAG_ORIGINAL, ASql::QueryPar::keepAlive(), ASql::QueryPar::m_flags, and ASql::QueryPar::m_sharedData.
|
inline |
Returns a pointer to the result set container.
Reimplemented from ASql::QueryPar.
Definition at line 514 of file query.hpp.
References ASql::QueryPar::results().
|
inline |
Returns a const pointer to the result set container.
Reimplemented from ASql::QueryPar.
Definition at line 517 of file query.hpp.
References ASql::QueryPar::results().
|
inlineinherited |
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 260 of file query.hpp.
References ASql::QueryPar::m_sharedData.
|
inlineinherited |
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 275 of file query.hpp.
References ASql::QueryPar::callback(), and ASql::QueryPar::m_sharedData.
Referenced by ASql::ConnectionPar< T >::intHandler().
|
inlineprotectedinherited |
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().
[in] | parameters | A 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, 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(), createParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >::createParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, 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::Set, Results > >::type >::setParameters(), setParameters(), ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::Set, Parameters > >::type, void >::setParameters(), and ASql::Query< Parameters, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Parameters > >::type, void >::setParameters().
|
inline |
Set's the parameter data to point to the passed single row parameter set.
Note that the Query object assumes responsibility for destroying the parameter set unless explicitly released with relinquishParameters().
[in] | parameters | A pointer to the parameter data set |
Definition at line 478 of file query.hpp.
References ASql::QueryPar::setParameters().
|
inlineprotectedinherited |
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().
[out] | results | A pointer to the result data |
Definition at line 174 of file query.hpp.
References ASql::QueryPar::m_sharedData, and ASql::QueryPar::results().
Referenced by 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(), createResults(), ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::createResults(), ASql::Query< void, Results, void, 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 >::setResults(), setResults(), ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::Set, Results > >::type >::setResults(), and ASql::Query< void, Results, void, typename boost::enable_if< boost::is_base_of< Data::SetContainer, Results > >::type >::setResults().
|
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().
[in] | results | A pointer to the result data set container |
Definition at line 511 of file query.hpp.
References ASql::QueryPar::setResults().
|
inlinestatic |