Public Types | Public Member Functions | Public Attributes

ASql::Query::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, FLAG_NO_MANAGE_RESULTS = 1<<2, FLAG_NO_MANAGE_PARAMETERS = 1<<3 }
 

Contains the possible flags a query can have set.

More...

Public Member Functions

 SharedData ()
 ~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 711 of file asql.hpp.


Member Enumeration Documentation

Contains the possible flags a query can have set.

Only constructor

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

Enumerator:
FLAG_SINGLE_PARAMETERS 
FLAG_SINGLE_RESULTS 
FLAG_NO_MANAGE_RESULTS 
FLAG_NO_MANAGE_PARAMETERS 

Definition at line 721 of file asql.hpp.


Constructor & Destructor Documentation

ASql::Query::SharedData::SharedData (  ) [inline]

Definition at line 722 of file asql.hpp.

ASql::Query::SharedData::~SharedData (  ) [inline]

Destroys the shared data.

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

Definition at line 728 of file asql.hpp.

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


Member Function Documentation

void ASql::Query::SharedData::destroyParameters (  ) [inline]

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

This will destroy the parameter set if FLAG_NO_MANAGE_PARAMETERS is not set and set the m_parameters pointer to null.

Definition at line 811 of file asql.hpp.

References FLAG_NO_MANAGE_PARAMETERS, FLAG_SINGLE_PARAMETERS, m_flags, and m_parameters.

Referenced by ~SharedData().

void ASql::Query::SharedData::destroyResults (  ) [inline]

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

This will destroy the result set if FLAG_NO_MANAGE_RESULTS is not set and set the m_results pointer to null.

Definition at line 796 of file asql.hpp.

References FLAG_NO_MANAGE_RESULTS, FLAG_SINGLE_RESULTS, m_flags, and m_results.

Referenced by ~SharedData().


Member Data Documentation

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

A callback function to be called when the query completes.

Definition at line 765 of file asql.hpp.

Definition at line 766 of file asql.hpp.

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

Definition at line 770 of file asql.hpp.

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

Definition at line 761 of file asql.hpp.

flags for the shared data

FLAG_NO_MANAGE_RESULTS: This means that result data should not be freed when the shared data structure goes out of scope. One would use this if that are done with the query object but want control over the scope of the results.

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

FLAG_NO_MANAGE_PARAMETERS: This means that parameter data should not be freed when the shared data structure goes out of scope. One would use this if that are done with the query object but want control over the scope of the parameters.

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 788 of file asql.hpp.

Referenced by destroyParameters(), and destroyResults().

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

Used to return a potential last auto increment insert id.

Definition at line 753 of file asql.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 742 of file asql.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 749 of file asql.hpp.

Referenced by destroyResults().

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

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

Definition at line 757 of file asql.hpp.

Referenced by ~SharedData().


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