fastcgi++
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes
ASql::MySQL::TypedConversion< T > Struct Template Reference

Handle retrieval of variable length data chunks. More...

#include <mysql.hpp>

Inheritance diagram for ASql::MySQL::TypedConversion< T >:
ASql::Data::Conversion

List of all members.

Public Member Functions

virtual void convertResult ()
 Retrieve the data chunk into the container pointer to by external.
virtual void convertParam ()
 Set the buffer to the address of the start of the container pointed to be external.
void * getPointer ()
 Get a pointer to data chunk the MySQL library should write to. In this case, it won't be writing.
 TypedConversion (const int &column_, MYSQL_STMT *const &statement_, const enum_field_types &bufferType_, void *&buffer_)

Public Attributes

enum_field_types bufferType
 &MySQL buffer type (MYSQL_TYPE_BLOB or MYSQL_TYPE_STRING)
unsigned long length
 Actual length of field.
void * external
 Pointer to standard data type.

Protected Member Functions

void grabIt (T &data)
 Retrieve data from the query into the passed vector.

Protected Attributes

void *& buffer
 Reference to associated MySQL bind object buffer pointer.
int column
 Associated column/parameter number.
MYSQL_STMT *const & statement
 Reference to associated MySQL C API statement object.

Detailed Description

template<class T>
struct ASql::MySQL::TypedConversion< T >

Handle retrieval of variable length data chunks.

Although no conversion is necessary for these data chunks, we wait to retrieve the data until we actually know how many bytes of it there is. This "conversion" handles that.

Definition at line 381 of file mysql.hpp.


Constructor & Destructor Documentation

template<class T>
ASql::MySQL::TypedConversion< T >::TypedConversion ( const int &  column_,
MYSQL_STMT *const &  statement_,
const enum_field_types &  bufferType_,
void *&  buffer_ 
)
inline
Parameters:
[in]column_Associated column/parameter number.
[in]statement_Reference to MySQL C API statement object.
[in]bufferType_&MySQL buffer type (MYSQL_TYPE_BLOB or MYSQL_TYPE_STRING).
[out]buffer_Reference to associated MySQL bind object buffer pointer.

Definition at line 407 of file mysql.hpp.


Member Function Documentation

template<class T >
void ASql::MySQL::TypedConversion< T >::convertParam ( )
virtual

Set the buffer to the address of the start of the container pointed to be external.

Implements ASql::Data::Conversion.

Reimplemented in ASql::MySQL::TypedConversion< Data::Wtext >.

Definition at line 452 of file mysql.cpp.

template<class T>
void ASql::MySQL::TypedConversion< T >::convertResult ( )
inlinevirtual

Retrieve the data chunk into the container pointer to by external.

Implements ASql::Data::Conversion.

Reimplemented in ASql::MySQL::TypedConversion< Data::Wtext >.

Definition at line 390 of file mysql.hpp.

template<class T>
void* ASql::MySQL::TypedConversion< T >::getPointer ( )
inlinevirtual

Get a pointer to data chunk the MySQL library should write to. In this case, it won't be writing.

Returns:
Null pointer.

Implements ASql::Data::Conversion.

Definition at line 399 of file mysql.hpp.

template<class T>
void ASql::MySQL::TypedConversion< T >::grabIt ( T &  data)
protected

Retrieve data from the query into the passed vector.

Parameters:
[out]dataVector to dump the data into. Size will be adjusted.

Definition at line 499 of file mysql.cpp.

Referenced by ASql::MySQL::TypedConversion< Data::Blob >::convertResult().


Member Data Documentation

template<class T>
void*& ASql::MySQL::TypedConversion< T >::buffer
protected

Reference to associated MySQL bind object buffer pointer.

Definition at line 410 of file mysql.hpp.

Referenced by ASql::MySQL::Statement::buildBindings().

template<class T>
enum_field_types ASql::MySQL::TypedConversion< T >::bufferType

&MySQL buffer type (MYSQL_TYPE_BLOB or MYSQL_TYPE_STRING)

Definition at line 384 of file mysql.hpp.

Referenced by ASql::MySQL::Statement::buildBindings().

template<class T>
int ASql::MySQL::TypedConversion< T >::column
protected

Associated column/parameter number.

Definition at line 413 of file mysql.hpp.

void* ASql::Data::Conversion::external
inherited

Pointer to standard data type.

Definition at line 705 of file data.hpp.

Referenced by ASql::MySQL::TypedConversion< Data::Blob >::convertResult().

template<class T>
unsigned long ASql::MySQL::TypedConversion< T >::length

Actual length of field.

Definition at line 387 of file mysql.hpp.

Referenced by ASql::MySQL::Statement::buildBindings().

template<class T>
MYSQL_STMT* const& ASql::MySQL::TypedConversion< T >::statement
protected

Reference to associated MySQL C API statement object.

Definition at line 416 of file mysql.hpp.


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