VisualIB  1.0
IBExpress library for making use of Borland IBExpress outside of C++Builder
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
VIB::DataSet Class Reference

VIB::DataSet wraps the VisualIB VIBDataSet C structure to provide a C++11 object with semantics compatible with those of Borland TIBDataSet. More...

#include <classVIBDataSet.h>

Classes

class  FieldByNameClass
 Class for VIB::DataSet::FieldByName method's return value. More...
 
class  FieldClass
 Fields property wrapper object. More...
 
class  FieldProp
 Intermediary for array-style access to fields, equivalent to the Borland TFields::Fields array. More...
 
class  FieldsClass
 Top-level Fields property wrapper class, equivalent to Borland TFields object. More...
 
class  SelectSQLClass
 Property implementation class for the SelectSQL property. More...
 

Public Member Functions

 DataSet (VIBDataSet *pvds=NULL)
 Construct a VIB::DataSet instance.
 
virtual ~DataSet ()
 Destroy the VIB::DataSet and the VIBDataSet instance it wraps.
 
void Open ()
 Opens the dataset.
 
void First ()
 Positions the cursor on the first record in the dataset and makes it the active record.
 
void Next ()
 Positions the cursor on the next record in the dataset and makes it the active record.
 
void Close ()
 Closes a dataset.
 
void Prepare ()
 Prepares all queries in the dataset to be executed.
 
bool Eof ()
 Returns true or false if the dataset is at Eof.
 
std::string Plan ()
 Undocumented method.
 
FieldByNameClassFieldByName (const std::string &fieldname)
 Finds a field based on its name.
 

Public Attributes

Property< VIBDatabase * > Database
 Identifies the database component for which the dataset represents one or more tables.
 
Property< int > FieldCount
 Indicates the number of field components associated with the dataset.
 
Property< FieldsClass * > Fields
 Lists all non-aggregate field components of the dataset.
 
Property< SelectSQLClass * > SelectSQL
 Provides the ability to directly access the SQL object encapsulating the SelectSQL statement.
 
Property< VIBTransaction * > Transaction
 Identifies the transaction under which the query executes.
 
Property< bool > UniDirectional
 Determines whether or not bidirectional cursors are enabled for a table.
 

Protected Attributes

VIBDataSetvds
 Pointer to the wrapped VIBDataSet instance.
 
FieldByNameClass fbnc
 Instance of FieldByName property wrapper.
 
FieldsClass fc
 Instance of Fields property wrapper.
 
SelectSQLClass sql
 Instance of SelectSQL property wrapper.
 

Friends

class FieldByNameClass
 
class FieldClass
 
class SelectSQLClass
 

Detailed Description

VIB::DataSet wraps the VisualIB VIBDataSet C structure to provide a C++11 object with semantics compatible with those of Borland TIBDataSet.

Constructor & Destructor Documentation

VIB::DataSet::DataSet ( VIBDataSet pvds = NULL)

Construct a VIB::DataSet instance.

Parameters
[in]pvdsOptional pointer to an existing VIBDataSet structure of which this class instance should take ownership.

Member Function Documentation

void VIB::DataSet::Close ( )

Closes a dataset.

The Active property will be set to false, and data can no longer be read from or written to the database using this object.

Note
Reimplements TDataSet::Close
bool VIB::DataSet::Eof ( )

Returns true or false if the dataset is at Eof.

Note
API Difference - This is a property in TIBDataSet, not a method.
VIB::DataSet::FieldByNameClass * VIB::DataSet::FieldByName ( const std::string &  fieldname)

Finds a field based on its name.

If the specified field does not exist, an exception will be thrown.

Parameters
[in]fieldnameThe name of a simple field, subfield of an object field qualified by the parent field's name, or name of an aggregated field.
Returns
Pointer to the field object. An application can directly access specific properties and methods of the field returned by FieldByName.
Note
Reimplements TDataSet::FieldByName
void VIB::DataSet::First ( )

Positions the cursor on the first record in the dataset and makes it the active record.

Note
Reimplements TDataSet::First
void VIB::DataSet::Next ( )

Positions the cursor on the next record in the dataset and makes it the active record.

Bof and Eof properties will be set to false. If the cursor was already on the last record in the dataset, the Eof property will be set to true.

Note
Reimplements TDataSet::Next
void VIB::DataSet::Open ( )

Opens the dataset.

Call to set the Active property to true, and enable data to be read from and written to the database.

Note
Reimplements TDataSet::Open
std::string VIB::DataSet::Plan ( )

Undocumented method.

Returns
The SQL query plan for the SelectSQL statement?
void VIB::DataSet::Prepare ( )

Prepares all queries in the dataset to be executed.

Note
Reimplements TIBDataSet::Prepare

Member Data Documentation

Property<VIBDatabase *> VIB::DataSet::Database

Identifies the database component for which the dataset represents one or more tables.

Note
Reimplements TIBCustomDataSet::Database
API Difference - The returned object is a VIBDatabase C structure, not a TIBDatabase. The corresponding TIBDatabase is hidden by the VIBDatabase abstraction.
Property<int> VIB::DataSet::FieldCount

Indicates the number of field components associated with the dataset.

For datasets with dynamically created fields, FieldCount may differ each time a dataset is opened. FieldCount includes only the fields listed by the Fields property. Any aggregated fields listed by the AggFields property are not included in the count.

Note
Reimplements TDataSet::FieldCount
Property<FieldsClass *> VIB::DataSet::Fields

Lists all non-aggregate field components of the dataset.

If fields are generated dynamically at runtime, the order of field components in Fields corresponds directly to the order of columns in the table or tables underlying a dataset.

Note
Reimplements TDataSet::Fields
Property<SelectSQLClass *> VIB::DataSet::SelectSQL

Provides the ability to directly access the SQL object encapsulating the SelectSQL statement.

Note
Reimplements TIBDataSet::SelectSQL
Property<VIBTransaction *> VIB::DataSet::Transaction

Identifies the transaction under which the query executes.

Note
Reimplements TIBCustomDataSet::Transaction
API Difference - The returned object is a VIBTransaction C structure, not a TIBTransaction. The corresponding TIBTransaction is hidden by the VIBTransaction abstraction.
Property<bool> VIB::DataSet::UniDirectional

Determines whether or not bidirectional cursors are enabled for a table.

Note
Reimplements TIBDataSet::UniDirectional

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