fastcgi++
Public Types | Public Member Functions | Public Attributes
ASql::QueryPar::SharedData Struct Reference

Sub-structure to store shared data for the query. More...

List of all members.

Public Types

enum  Flags { FLAG_SINGLE_PARAMETERS = 1, FLAG_SINGLE_RESULTS = 1<<1 }
 Contains the possible flags a query can have set. More...

Public Member Functions

 SharedData ()
 Only constructor.
 ~SharedData ()
 Destroys the shared data.
void destroyResults ()
 Safely destroys(or doesn't) the result data set.
void destroyParameters ()
 Safely destroys(or doesn't) the parameter data set.

Public Attributes

void * m_parameters
 Pointer to the data object containing the parameters to be passed to the statement.
void * m_results
 Pointer to the data object that should store the results returned from the statement.
unsigned long long int * m_insertId
 Used to return a potential last auto increment insert id.
unsigned long long int * m_rows
 Used to return the number of rows available/affected by the query.
Error m_error
 Contains the error (if any) returned by the query.
boost::function< void()> m_callback
 A callback function to be called when the query completes.
boost::mutex m_callbackMutex
bool m_cancel
 If set true the query should cancel when the opportunity arises.
unsigned char m_flags
 flags for the shared data

Detailed Description

Sub-structure to store shared data for the query.

Definition at line 31 of file query.hpp.


Member Enumeration Documentation

Contains the possible flags a query can have set.

Enumerator:
FLAG_SINGLE_PARAMETERS 
FLAG_SINGLE_RESULTS 

Definition at line 34 of file query.hpp.


Constructor & Destructor Documentation

Only constructor.

The default constructor zeros all data and sets the shared flags to 0

Definition at line 40 of file query.hpp.

Destroys the shared data.

This should obviously only get called when at last all associated QueryPar objects go out of scope.

Definition at line 47 of file query.hpp.

References destroyParameters(), destroyResults(), m_insertId, and m_rows.


Member Function Documentation

Safely destroys(or doesn't) the parameter data set.

This will destroy the parameter set and set the m_parameters pointer to null.

Definition at line 116 of file query.hpp.

References FLAG_SINGLE_PARAMETERS, m_flags, and m_parameters.

Referenced by ~SharedData().

Safely destroys(or doesn't) the result data set.

This will destroy the result set and set the m_results pointer to null.

Definition at line 103 of file query.hpp.

References FLAG_SINGLE_RESULTS, m_flags, and m_results.

Referenced by ~SharedData().


Member Data Documentation

boost::function<void()> ASql::QueryPar::SharedData::m_callback

A callback function to be called when the query completes.

Definition at line 82 of file query.hpp.

Definition at line 84 of file query.hpp.

If set true the query should cancel when the opportunity arises.

Definition at line 87 of file query.hpp.

Contains the error (if any) returned by the query.

Definition at line 79 of file query.hpp.

flags for the shared data

FLAG_SINGLE_RESULTS: This means that the data pointed to be m_results is a Data::Set and not a Data::SetContainer.

FLAG_SINGLE_RESULTS: This means that the data pointed to be m_parameters is a Data::Set and not a Data::SetContainer.

Definition at line 97 of file query.hpp.

Referenced by destroyParameters(), and destroyResults().

unsigned long long int* ASql::QueryPar::SharedData::m_insertId

Used to return a potential last auto increment insert id.

Definition at line 71 of file query.hpp.

Referenced by ~SharedData().

Pointer to the data object containing the parameters to be passed to the statement.

This is a void pointer so that it may contain a single row of parameters (Data::Set) or multiple rows of parameters (Data::SetContainer). Multiple rows of parameters is in effect just executing the query multiple times in a single transaction.

Definition at line 61 of file query.hpp.

Referenced by destroyParameters().

Pointer to the data object that should store the results returned from the statement.

This is a void pointer so that it may contain a single row of results (Data::Set) or multiple rows of results (Data::SetContainer).

Definition at line 68 of file query.hpp.

Referenced by destroyResults().

unsigned long long int* ASql::QueryPar::SharedData::m_rows

Used to return the number of rows available/affected by the query.

Definition at line 76 of file query.hpp.

Referenced by ~SharedData().


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