iopc::Result< T > Class Template Reference

Executes a query and iterates through returned rows. More...

#include <result.h>

Inheritance diagram for iopc::Result< T >:

Inheritance graph
[legend]

List of all members.

Public Types

typedef ResultIterator< T > iterator
 Iterator type used to iterate through the query results.

Public Member Functions

 Result (CachedConnection *conn, const Query &query, bool preload=true)
 Result (CachedConnection *conn, bool preload=true)
 Creates a Result that selects all persistent instances of the class T.
iterator begin ()
 Returns an ResultIterator<T> pointing to the first fetched object.
iterator end ()
 Returns an ResultIterator<T> representing an end of the fetched list.


Detailed Description

template<typename T>
class iopc::Result< T >

Executes a query and iterates through returned rows.

Result is used in the following way:

 Result<Person> queryResult(conn, query);
 queryResult.open();
 for (Result<Person>::iterator it = queryResult.begin(); it != queryResult.end(); it++) {
    cout << it->name << "   " << it->age << endl;
 }
 queryResult.close();

Constructor & Destructor Documentation

template<typename T>
iopc::Result< T >::Result ( CachedConnection conn,
const Query query,
bool  preload = true 
) [inline]

Parameters:
conn Connection on which the query will be executed
query The query to be executed
preload If true, open() loads all keys (OIDs or KeyValues) and immediately releases the cursor it uses.

template<typename T>
iopc::Result< T >::Result ( CachedConnection conn,
bool  preload = true 
) [inline]

Creates a Result that selects all persistent instances of the class T.

Parameters:
conn Connection on which the query will be executed
preload If true, open() loads all keys (OIDs or KeyValues) and immediately releases the cursor it uses.


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

Generated on Tue Apr 14 16:46:51 2009 for IOPC 2 by  doxygen 1.5.6