MySQL++  3.3.0
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:
Inheritance graph
[legend]
Collaboration diagram for mysqlpp::ResultBase:
Collaboration graph
[legend]

Public Member Functions

virtual ~ResultBase ()
 Destroy object.
 
const Fieldfetch_field () const
 Returns the next field in this result set.
 
const Fieldfetch_field (Fields::size_type i) const
 Returns the given field in this result set.
 
const Fieldfield (unsigned int i) const
 Get the underlying Field structure given its index.
 
const Fieldsfields () 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.
 
ResultBasecopy (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

DBDriverdriver_
 Access to DB driver; fully initted if nonzero.
 
Fields fields_
 list of fields in result
 
RefCountedPointer< FieldNamesnames_
 list of field names in result
 
RefCountedPointer< FieldTypestypes_
 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

◆ field_num()

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

◆ current_field_

Fields::size_type mysqlpp::ResultBase::current_field_
mutableprotected

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: