MySQL++  3.2.5
Public Types | Public Member Functions | List of all members
mysqlpp::StoreQueryResult Class Reference

StoreQueryResult set type for "store" queries. More...

#include <result.h>

Inheritance diagram for mysqlpp::StoreQueryResult:
Inheritance graph
[legend]
Collaboration diagram for mysqlpp::StoreQueryResult:
Collaboration graph
[legend]

Public Types

typedef std::vector< Row > list_type
 type of vector base class
 

Public Member Functions

 StoreQueryResult ()
 Default constructor.
 
 StoreQueryResult (MYSQL_RES *result, DBDriver *dbd, bool te=true)
 Fully initialize object.
 
 StoreQueryResult (const StoreQueryResult &other)
 Initialize object as a copy of another StoreQueryResult object.
 
 ~StoreQueryResult ()
 Destroy result set.
 
list_type::size_type num_rows () const
 Returns the number of rows in this result set.
 
StoreQueryResult & operator= (const StoreQueryResult &rhs)
 Copy another StoreQueryResult object's data into this object.
 
 operator private_bool_type () const
 Test whether the query that created this result succeeded. More...
 
- Public Member Functions inherited from mysqlpp::ResultBase
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.
 

Additional Inherited Members

- Protected Member Functions inherited from mysqlpp::ResultBase
 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 inherited from mysqlpp::ResultBase
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

StoreQueryResult set type for "store" queries.

This is the obvious C++ implementation of a class to hold results from a SQL query that returns rows: a specialization of std::vector holding Row objects in memory so you get random-access semantics. MySQL++ also supports UseQueryResult which is less friendly, but has better memory performance. See the user manual for more details on the distinction and the usage patterns required.

Member Function Documentation

◆ operator private_bool_type()

mysqlpp::StoreQueryResult::operator private_bool_type ( ) const
inline

Test whether the query that created this result succeeded.

If you test this object in bool context and it's false, it's a signal that the query this was created from failed in some way. Call Query::error() or Query::errnum() to find out what exactly happened.


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