fastcgi++  3.1alpha
A C++ FastCGI/Web API
Fastcgipp::SQL::Results_base Class Reference

De-templated base class for SQL query result sets. More...

#include <fastcgi++/sql/results.hpp>

Inheritance diagram for Fastcgipp::SQL::Results_base:
[legend]

Public Member Functions

Status status () const
 Get status of SQL query result. More...
 
const char * errorMessage () const
 Get error message associated with SQL query result. More...
 
unsigned rows () const
 How many rows were returned with the SQL query. More...
 
unsigned affectedRows () const
 How many rows were affected from the SQL query. More...
 
bool null (int row, int column) const
 Check for nullness of a specific row/column. More...
 
virtual ~Results_base ()
 
template<typename Numeric >
void field (int row, int column, Numeric &value) const
 

Protected Member Functions

 Results_base ()
 
int columns () const
 How many columns are associated with the underlying results. More...
 
template<typename T >
bool verifyColumn (int column) const
 Verify type and size consistency for the specified column. More...
 
template<typename Numeric >
void field (int row, int column, std::vector< Numeric > &value) const
 Extract typed array from specific row and column. More...
 
template<typename T >
void field (int row, int column, T &value) const
 Extract typed value from specific row and column. More...
 
template<>
void field (int row, int column, bool &value) const
 
template<>
void field (int row, int column, std::vector< char > &value) const
 

Protected Attributes

void * m_res
 Pointer to underlying SQL results object. More...
 

Friends

class Connection
 

Detailed Description

De-templated base class for SQL query result sets.

Definition at line 101 of file results.hpp.

Constructor & Destructor Documentation

◆ ~Results_base()

Fastcgipp::SQL::Results_base::~Results_base ( )
virtual

Definition at line 468 of file results.cpp.

◆ Results_base()

Fastcgipp::SQL::Results_base::Results_base ( )
inlineprotected

Definition at line 132 of file results.hpp.

Member Function Documentation

◆ affectedRows()

unsigned Fastcgipp::SQL::Results_base::affectedRows ( ) const

How many rows were affected from the SQL query.

Definition at line 463 of file results.cpp.

References Fastcgipp::Http::atoi().

Here is the call graph for this function:

◆ columns()

int Fastcgipp::SQL::Results_base::columns ( ) const
protected

How many columns are associated with the underlying results.

Definition at line 492 of file results.cpp.

Referenced by Fastcgipp::SQL::Results< Types >::verify().

Here is the caller graph for this function:

◆ errorMessage()

const char * Fastcgipp::SQL::Results_base::errorMessage ( ) const

Get error message associated with SQL query result.

Definition at line 474 of file results.cpp.

◆ field() [1/5]

template<>
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
bool &  value 
) const
protected

Definition at line 120 of file results.cpp.

◆ field() [2/5]

template<typename Numeric >
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
Numeric &  value 
) const

Definition at line 85 of file results.cpp.

References Fastcgipp::BigEndian< T >::read().

Here is the call graph for this function:

◆ field() [3/5]

template<>
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
std::vector< char > &  value 
) const
protected

Definition at line 297 of file results.cpp.

◆ field() [4/5]

template<typename Numeric >
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
std::vector< Numeric > &  value 
) const
protected

Extract typed array from specific row and column.

Definition at line 213 of file results.cpp.

References WARNING_LOG.

Referenced by Fastcgipp::SQL::Results< Types >::verify_impl().

Here is the caller graph for this function:

◆ field() [5/5]

template<typename T >
void Fastcgipp::SQL::Results_base::field ( int  row,
int  column,
T &  value 
) const
protected

Extract typed value from specific row and column.

This function has no default definition and must be specialized for each and every type that is to be used.

◆ null()

bool Fastcgipp::SQL::Results_base::null ( int  row,
int  column 
) const

Check for nullness of a specific row/column.

Definition at line 484 of file results.cpp.

◆ rows()

unsigned Fastcgipp::SQL::Results_base::rows ( ) const

How many rows were returned with the SQL query.

Definition at line 479 of file results.cpp.

Referenced by Fastcgipp::SQL::Results< Types >::verify().

Here is the caller graph for this function:

◆ status()

Fastcgipp::SQL::Status Fastcgipp::SQL::Results_base::status ( ) const

Get status of SQL query result.

This function should be called first thing after an SQL query is complete to ensure the result of the query is what you expect it to be.

Definition at line 433 of file results.cpp.

References Fastcgipp::SQL::badResponse, Fastcgipp::SQL::commandOk, Fastcgipp::SQL::copyBoth, Fastcgipp::SQL::copyIn, Fastcgipp::SQL::copyOut, Fastcgipp::SQL::emptyQuery, Fastcgipp::SQL::fatalError, Fastcgipp::SQL::nonfatalError, Fastcgipp::SQL::noResult, Fastcgipp::SQL::rowsOk, and Fastcgipp::SQL::singleTuple.

◆ verifyColumn()

template<typename T >
template bool Fastcgipp::SQL::Results_base::verifyColumn< double > ( int  column) const
protected

Verify type and size consistency for the specified column.

This function has no default definition and must be specialized for each and every type that is to be used.

Definition at line 41 of file results.cpp.

References m_res.

Friends And Related Function Documentation

◆ Connection

friend class Connection
friend

Definition at line 127 of file results.hpp.

Member Data Documentation

◆ m_res

void* Fastcgipp::SQL::Results_base::m_res
protected

Pointer to underlying SQL results object.

Definition at line 130 of file results.hpp.

Referenced by verifyColumn().


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