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

O3DBIRecord Class Reference

#include <O3DBIRecord.h>

Inheritance diagram for O3DBIRecord:

Inheritance graph
[legend]
Collaboration diagram for O3DBIRecord:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 O3DBIRecord ()
 O3DBIRecord (const O3DBIRecord &record)
 O3DBIRecord (TDataFieldsConstIter &first, TDataFieldsConstIter &last)
virtual ~O3DBIRecord ()
TDataFieldIndex InsertField (const O3DBIDataField &field)
O3DBIDataField GetField (TDataFieldIndex index) const
O3DBIDataField & operator[] (TDataFieldIndex index)
TO3DBIResult RemoveField (const O3DBIDataField &field)
TO3DBIResult RemoveField (TDataFieldIndex index)
TDataFields & GetFields (void)
TDataFieldsSize GetFieldCount (void) const
void CancelModified (void)
bool IsModified (void) const
virtual TO3DBIString ToString (void) const

Detailed Description

Objects of type O3DBIRecord represent one row in a data base table or one record of joined data from two or more tables.

Definition at line 84 of file O3DBIRecord.h.


Constructor & Destructor Documentation

O3DBIRecord::O3DBIRecord (   ) 
 

The default constructor.

Definition at line 19 of file O3DBIRecord.cpp.

O3DBIRecord::O3DBIRecord (  const O3DBIRecord &  record  ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

A copy constructor.

Parameters:
record is a const reference to another O3DBIRecord object.

Definition at line 24 of file O3DBIRecord.cpp.

References _fields.

O3DBIRecord::O3DBIRecord (  TDataFieldsConstIter &  first,
TDataFieldsConstIter &  last
) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

An initialization constructor, initializing the new O3DBIRecord object with a range of O3DBIDataFields which are copied from a TDataFields container.

Parameters:
first is an iterator of a TDataFields container, pointing to an element of type O3DBIDataField.
last is an iterator of a TDataFields container, pointing to an element of type O3DBIDataField.
Note:
[first, last) must be a valid range.

Definition at line 29 of file O3DBIRecord.cpp.

O3DBIRecord::~O3DBIRecord (   )  [virtual]
 

The virtual destructor.

Definition at line 36 of file O3DBIRecord.cpp.


Member Function Documentation

void O3DBIRecord::CancelModified (  void   ) 
 

Use this member function to cancel all modified flags of all data fields the O3DBIRecord object consistst of.

See also:
O3DBIDataField::CancelModified

Definition at line 105 of file O3DBIRecord.cpp.

References O3DBIDataField::CancelModified(), and TDataFieldsIter.

Referenced by O3DBIRecordSet::CancelModified().

O3DBIDataField O3DBIRecord::GetField (  TDataFieldIndex  index  )  const
 

Call this member function to get access to a specified data field, when its index is known.

See also:
O3DBIRecord::operator[]
Parameters:
index is the zero-based index number of the field.
Returns:
An O3DBIDataField on success.
Exceptions:
O3DBIException - if the specified field doesn't exist (invalid index parameter).

Definition at line 57 of file O3DBIRecord.cpp.

TDataFieldsSize O3DBIRecord::GetFieldCount (  void   )  const
 

Call this member function to get the amount of O3DBIDataField objects the O3DBIRecord object consists of.

Returns:
The amount of data fields or 0, if no O3DBIDataField objects are managed by the O3DBIRecord object.

Definition at line 100 of file O3DBIRecord.cpp.

References TDataFieldsSize.

Referenced by O3DBIRecordSet::InsertRecord().

TDataFields & O3DBIRecord::GetFields (  void   ) 
 

Access to the internal TDataFields container, managing the O3DBIDataFields objects the O3DBIRecord object consistst of.

Returns:
A reference to the TDataFields vector instance.

Definition at line 95 of file O3DBIRecord.cpp.

References TDataFields.

TDataFieldIndex O3DBIRecord::InsertField (  const O3DBIDataField &  field  ) 
 

Call this member function to add an O3DBIDataField object to the O3DBIRecord object. The new O3DBIDataField object will be inserted at the end of the internal TDataFields container.

Parameters:
field is a const reference to an O3DBIDataField object.
Returns:
The index of the inserted element on success, otherwise -1.
Example of usage
        O3DBIRecord employee;
        if (employee.InsertField(O3DBIDataField(_T("EMPNO"), 256)) != -1 ||
            employee.InsertField(O3DBIDataField(_T("NAME"), _T("Scott Tiger"))) != -1 ||
            employee.InsertField(O3DBIDataField(_T("POSITION"), _T("Developer"))))
        {
            // Print employee on std out
            std::cout << employee.ToString().c_str() << std::endl;
        } else {
            std::cout << _T("Error!") << std::endl;
        }

Definition at line 51 of file O3DBIRecord.cpp.

bool O3DBIRecord::IsModified (  void   )  const
 

Use this member function to determine if one or more fields, of those the data record consistst, is/are marked as modified.

See also:
O3DBIDataField::IsModified
Returns:
true, if the O3DBIRecord object contains one ore more fields whose modified flag(s) is/are set, otherwise false.

Definition at line 115 of file O3DBIRecord.cpp.

References TDataFieldsConstIter.

O3DBIDataField & O3DBIRecord::operator[] (  TDataFieldIndex  index  ) 
 

Call this operator to get access to a specified data field, when its index is known.

See also:
O3DBIRecord::GetField
Parameters:
index is the zero-based index number of the field.
Returns:
A reference to the field on success.
Exceptions:
O3DBIException - if the specified field doesn't exist (invalid index parameter).

Definition at line 65 of file O3DBIRecord.cpp.

TO3DBIResult O3DBIRecord::RemoveField (  TDataFieldIndex  index  ) 
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Call this member function to delete a specified data field.

Parameters:
index is the zero-based index number of the field to remove.
Returns:
OSUCCESS if the defined field was existing and could be deleted, OFAILED otherwise.

Definition at line 86 of file O3DBIRecord.cpp.

References RemoveField(), and TO3DBIResult.

TO3DBIResult O3DBIRecord::RemoveField (  const O3DBIDataField &  field  ) 
 

Call this member function to delete a specified data field.

Parameters:
field is a const reference to an O3DBIDataField object, defining the field to be removed.
Returns:
OSUCCESS if the defined field was existing and could be deleted, OFAILED otherwise.

Definition at line 74 of file O3DBIRecord.cpp.

References TDataFieldsIter, and TO3DBIResult.

Referenced by RemoveField().

TO3DBIString O3DBIRecord::ToString (  void   )  const [virtual]
 

This member function returns a string that "textually represents" this object.

Returns:
A TO3DBIString object containing the string.

Reimplemented from O3DBIObject.

Definition at line 123 of file O3DBIRecord.cpp.

References TDataFieldsConstIter, TO3DBIString, and O3DBIDataField::ToString().

Referenced by O3DBIRecordSet::ToString().


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


SourceForge.net Logo Generated on Sun Jan 23 11:36:47 2005 for Oracle Object Oriented Database Interface (O3DBI) by  doxygen 1.3.9.1