- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
mysqlpp::ResultBase Class Reference

Base class for StoreQueryResult and UseQueryResult. More...

`#include <result.h>`

Inheritance diagram for mysqlpp::ResultBase:
[legend]
Collaboration diagram for mysqlpp::ResultBase:
[legend]

## Public Member Functions
virtual | ~ResultBase ()
| Destroy object.
const Field & | fetch_field () const
| Returns the next field in this result set.
const Field & | fetch_field (Fields::size_type i) const
| Returns the given field in this result set.
const Field & | field (unsigned int i) const
| Get the underlying Field structure given its index.
const Fields & | fields () const
| Get the underlying Fields structure.
const std::string & | field_name (int i) const
| Get the name of the field at the given index.
const RefCountedPointer < FieldNames > & | field_names () const
| Get the names of the fields within this result set.
int | field_num (const std::string &) const
| Get the index of the named field. More...
const FieldTypes::value_type & | field_type (int i) const
| Get the type of a particular field within this result set.
const RefCountedPointer < FieldTypes > & | field_types () const
| Get a list of the types of the fields within this result set.
size_t | num_fields () const
| Returns the number of fields in this result set.
const char * | table () const
| Return the name of the table the result set comes from.
Public Member Functions inherited from mysqlpp::OptionalExceptions
| OptionalExceptions (bool e=true)
| Default constructor. More...
virtual | ~OptionalExceptions ()
| Destroy object.
void | enable_exceptions () const
| Enable exceptions from the object.
void | disable_exceptions () const
| Disable exceptions from the object.
bool | throw_exceptions () const
| Returns true if exceptions are enabled.

## Protected Member Functions
| ResultBase ()
| Create empty object.
| ResultBase (MYSQL_RES *result, DBDriver *dbd, bool te=true)
| Create the object, fully initialized.
| ResultBase (const ResultBase &other)
| Create object as a copy of another ResultBase.
ResultBase & | copy (const ResultBase &other)
| Copy another ResultBase object's contents into this one.
Protected Member Functions inherited from mysqlpp::OptionalExceptions
void | set_exceptions (bool e) const
| Sets the exception state to a particular value. More...

## Protected Attributes
DBDriver * | driver_
| Access to DB driver; fully initted if nonzero.
Fields | fields_
| list of fields in result
RefCountedPointer< FieldNames > | names_
| list of field names in result
RefCountedPointer< FieldTypes > | types_
| list of field types in result
Fields::size_type | current_field_
| Default field index used by fetch_field() More...

## Detailed Description

Base class for StoreQueryResult and UseQueryResult.

Not useful directly. Just contains common functionality for its subclasses.

## Member Function Documentation

int mysqlpp::ResultBase::field_num | ( | const std::string & | i | ) | const

Get the index of the named field.

This is the inverse of field_name().

References names_, and mysqlpp::OptionalExceptions::throw_exceptions().

## Member Data Documentation

Fields::size_type mysqlpp::ResultBase::current_field_
| mutable protected

Default field index used by fetch_field()

It's mutable because it's just internal housekeeping: it's changed by fetch_field(void), but it doesn't change the "value" of the result. See mutability justification for UseQueryResult::result_: this field provides functionality we used to get through result_, so it's relevant here, too.

Referenced by copy().

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

- result.h
- result.cpp