Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

pqxx::icursorstream Class Reference

Simple read-only cursor represented as a stream of results. More...

#include <cursor.hxx>

Inheritance diagram for pqxx::icursorstream:

pqxx::cursor_base List of all members.

Public Member Functions

 icursorstream (transaction_base &context, const PGSTD::string &query, const PGSTD::string &basename, size_type stride=1)
 Set up a read-only, forward-only cursor.
icursorstreamget (result &res)
 Read new value into given result object; same as operator >>.
icursorstreamoperator>> (result &res)
 Read new value into given result object; same as get(result &).
icursorstreamignore (PGSTD::streamsize n=1)
 Move given number of rows forward (ignoring stride) without reading data.
void set_stride (size_type stride)
 Change stride, i.e. the number of rows to fetch per read operation.

Detailed Description

Simple read-only cursor represented as a stream of results.

Data is fetched from the cursor as a sequence of result objects. Each of these will contain the number of rows defined as the stream's stride, except of course the last block of data which may contain fewer rows.

Warning:
This code is experimental. It is not fully covered by libpqxx' regression tests, and may see considerable change before becoming part of a stable release. Do not use except to test it.


Constructor & Destructor Documentation

pqxx::icursorstream::icursorstream transaction_base context,
const PGSTD::string &  query,
const PGSTD::string &  basename,
size_type  stride = 1
 

Set up a read-only, forward-only cursor.

Roughly equivalent to a C++ Standard Library istream, this cursor type supports only two operations: reading a block of rows while moving forward, and moving forward without reading any data.

Parameters:
context transaction context that this cursor will be active in
query SQL query whose results this cursor shall iterate
basename suggested name for the SQL cursor; a unique code will be appended by the library to ensure its uniqueness
stride the number of rows to fetch per read operation; must be a positive number


Member Function Documentation

icursorstream& pqxx::icursorstream::get result res  ) 
 

Read new value into given result object; same as operator >>.

The result set may continue any number of rows from zero to the chosen stride, inclusive. An empty result will only be returned if there are no more rows to retrieve.

pqxx::icursorstream & pqxx::icursorstream::ignore PGSTD::streamsize  n = 1  ) 
 

Move given number of rows forward (ignoring stride) without reading data.

icursorstream& pqxx::icursorstream::operator>> result res  ) 
 

Read new value into given result object; same as get(result &).

The result set may continue any number of rows from zero to the chosen stride, inclusive. An empty result will only be returned if there are no more rows to retrieve.

void pqxx::icursorstream::set_stride size_type  stride  ) 
 

Change stride, i.e. the number of rows to fetch per read operation.

Parameters:
stride must be a positive number


The documentation for this class was generated from the following files:
Generated on Sat Aug 21 03:39:34 2004 for libpqxx by doxygen 1.3.8