Class: TRecordSource

Declaration: RecordSource.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

MReferenceCounted

Inherited By:

None.

Purpose:

The TRecordSource is an abstract base class that defines the member functions that record source providers must define. The TRecordSource class is associated with a stateless memory management surrogate class, TRecordSourceHandle. Record source instances cannot be assigned or copied to one another.

Instantiation:

Abstract class; do not allocate. Clients access record sources using instances of TRecordSourceHandle.

Deriving Classes:

Record source providers will need to derive from this class.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TRecordSource::TRecordSource

TRecordSource ()

Interface Category:

API.

Purpose:

Default constructor.

Calling Context:

Called by the stream-in operators and any other function that needs to construct an uninitialized object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::~TRecordSource

virtual ~ TRecordSource ()

Interface Category:

API.

Purpose:

Destructor.

Calling Context:

Called to destroy an object.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetRecordCount

virtual ERecordSourceLength GetRecordCount (RecordCount &) const

Interface Category:

API.

Purpose:

Returns the number of records in the record source if the returned value (ELength) is kFixed; otherwise, returns 0.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns kFixed if the record source has a prespecified fixed length; otherwise, returns 0.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetRecordsRemaining

virtual ERecordSourceLength GetRecordsRemaining (RecordCount &) const

Interface Category:

API.

Purpose:

Returns the number of records remaining in the record source if the returned value (ELength) is kFixed; otherwise, returns 0.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns kFixed if the record source has a prespecified fixed length; otherwise, returns 0.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetColumnCount

virtual ColumnCount GetColumnCount () const

Interface Category:

API.

Purpose:

Returns the number of columns in the record source.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The number of columns in the record source.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetColumnTitle

virtual const TText & GetColumnTitle (ColumnPosition, TText &) const

Interface Category:

API.

Purpose:

Returns the title of the indicated column.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A const reference to the column's title.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetColumnType

virtual const ColumnType & GetColumnType (ColumnPosition, ColumnType &) const

Interface Category:

API.

Purpose:

Returns the data type of fields in the indicated column. This is identical to the value returned by a TRecordFieldHandle::Name member function.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A const reference to the column type.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetColumnTypeHint

virtual EColumnTypeHint GetColumnTypeHint (ColumnPosition) const

Interface Category:

API.

Purpose:

Returns an enumerated column type hint. This type can be more convenient to work with than the column type returned by GetColumnType.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A column type hint.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetColumnSize

virtual size_t GetColumnSize (ColumnPosition) const

Interface Category:

API.

Purpose:

Returns the column size of the largest data element in the given column. Might return 0 if the size is not known.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The column size of the largest data element, or 0 if the size in unknown.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetField

  1. virtual bool GetField (TRecordFieldHandle &, ColumnPosition) const
  2. virtual bool GetField (unsigned char &, ColumnPosition) const
  3. virtual bool GetField (short &, ColumnPosition) const
  4. virtual bool GetField (long &, ColumnPosition) const
  5. virtual bool GetField (double &, ColumnPosition) const
  6. virtual bool GetField (TText &, ColumnPosition) const
  7. virtual bool GetField (TTime &, ColumnPosition) const
  8. virtual bool GetField (TSQLTime &, ColumnPosition) const
  9. virtual bool GetField (TSQLDate &, ColumnPosition) const
  10. virtual bool GetField (TSQLTimestamp &, ColumnPosition) const

Interface Category:

API.

Purpose:

  1. Updates the client field handle of the specified field of the current record.
  2. Fetches an unsigned char from the specified field of the current record.
  3. Fetches a short from the specified field of the current record.
  4. Fetches a long from the specified field of the current record.
  5. Fetches a double from the specified field of the current record.
  6. Fetches a TText from the specified field of the current record.
  7. Fetches a TTime from the specified field of the current record.
  8. Fetches a TSQLTime from the specified field of the current record.
  9. Fetches a TSQLDate from the specified field of the current record.
  10. Fetches a TSQLTimestamp from the specified field of the current record.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Call this function directly.
  5. Call this function directly.
  6. Call this function directly.
  7. Call this function directly.
  8. Call this function directly.
  9. Call this function directly.
  10. Call this function directly.

Parameters:

Return Value:

Returns true if data exists. Returns false if no data exists in the indicated field of the current record.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::FetchRecord

  1. virtual bool FetchRecord ()
  2. virtual bool FetchRecord (TRecordHandle &)

Interface Category:

API.

Purpose:

  1. Returns true if the next record can be fetched successfully from the source. Returns false at the end of the source.
  2. Returns a record that the client can keep.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.

Parameters:

Return Value:

Returns true if the record is fetched successfully from the source.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::IsRandomAccess

virtual bool IsRandomAccess () const

Interface Category:

API.

Purpose:

Determines if the random access member functions are enabled for this record source.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the random access member functions are enabled.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetRecordPosition

virtual RecordPosition GetRecordPosition () const

Interface Category:

API.

Purpose:

Returns the record index of the current record in the record source.

Calling Context:

Call this function directly.

Parameters:

Return Value:

The record index of the current record.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::SetRecordPosition

virtual bool SetRecordPosition (RecordPosition)

Interface Category:

API.

Purpose:

Positions the current record to the given record index.

Calling Context:

Call this function directly.

Parameters:

Return Value:

Returns true if the record position can successfully be set, that is, if the specified record index exists.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSource::GetFieldOfRecord

  1. virtual bool GetFieldOfRecord (TRecordFieldHandle &, ColumnPosition, RecordPosition) const
  2. virtual bool GetFieldOfRecord (unsigned char &, ColumnPosition, RecordPosition) const
  3. virtual bool GetFieldOfRecord (short &, ColumnPosition, RecordPosition) const
  4. virtual bool GetFieldOfRecord (long &, ColumnPosition, RecordPosition) const
  5. virtual bool GetFieldOfRecord (double &, ColumnPosition, RecordPosition) const
  6. virtual bool GetFieldOfRecord (TText &, ColumnPosition, RecordPosition) const
  7. virtual bool GetFieldOfRecord (TTime &, ColumnPosition, RecordPosition) const
  8. virtual bool GetFieldOfRecord (TSQLTime &, ColumnPosition, RecordPosition) const
  9. virtual bool GetFieldOfRecord (TSQLDate &, ColumnPosition, RecordPosition) const
  10. virtual bool GetFieldOfRecord (TSQLTimestamp &, ColumnPosition, RecordPosition) const

Interface Category:

API.

Purpose:

  1. Updates the client field handle of the specified field of the specified record.
  2. Fetches an unsigned char from the specified field of the specified record.
  3. Fetches a short from the specified field of the specified record.
  4. Fetches a long from the specified field of the specified record.
  5. Fetches a double from the specified field of the specified record.
  6. Fetches a TText from the specified field of the specified record.
  7. Fetches a TTime from the specified field of the specified record.
  8. Fetches a TSQLTime from the specified field of the specified record.
  9. Fetches a TSQLDate from the specified field of the specified record.
  10. Fetches a TSQLTimestamp from the specified field of the specified record.

Calling Context:

  1. Call this function directly.
  2. Call this function directly.
  3. Call this function directly.
  4. Call this function directly.
  5. Call this function directly.
  6. Call this function directly.
  7. Call this function directly.
  8. Call this function directly.
  9. Call this function directly.
  10. Call this function directly.

Parameters:

Return Value:

Returns true if data exists. Returns false if no data exists in the indicated field of the specified record.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.