Class: TRecordSourceHandle

Declaration: RecordSource.h

Taxonomy Categories:

Member Functions:


Interface Category:

API.

Inherits From:

None.

Inherited By:

TSQLColumnCatalogHandle TSQLTableCatalogHandle

Purpose:

This concrete class is the counted pointer memory management surrogate for TRecordSource class. Clients access record sources using instances of this class.

Instantiation:

Always allocate on the stack.

Deriving Classes:

None.

Concurrency:

Not multithread safe.

Resource Use:

No special requirements.

Other Considerations:

None.

Member Function: TRecordSourceHandle::~TRecordSourceHandle

virtual ~ TRecordSourceHandle ()

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: TRecordSourceHandle::TRecordSourceHandle

  1. TRecordSourceHandle (TRecordSource & source)
  2. TRecordSourceHandle (const TRecordSourceHandle & source)
  3. TRecordSourceHandle ()

Interface Category:

API.

Purpose:

  1. Downcast constructor.
  2. Copy constructor.
  3. Default constructor. Provides client with a handle to a null record source that throws an exception when its data access member functions are called.

Calling Context:

  1. Call this function directly
  2. Called to copy an object.
  3. 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: TRecordSourceHandle::operator=

TRecordSourceHandle & operator =(const TRecordSourceHandle & right)

Interface Category:

API.

Purpose:

Assignment operator.

Calling Context:

Called when an object is assigned to another compatible object.

Parameters:

Return Value:

A non-const reference to the left-hand side object.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSourceHandle::GetRecordCount

virtual ERecordSourceLength GetRecordCount (RecordCount & count) 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: TRecordSourceHandle::GetRecordsRemaining

virtual ERecordSourceLength GetRecordsRemaining (RecordCount & count) 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: TRecordSourceHandle::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: TRecordSourceHandle::GetColumnTitle

virtual void GetColumnTitle (ColumnPosition, TText &) const

Interface Category:

API.

Purpose:

Returns the title of the indicated column.

Calling Context:

Call this function directly.

Parameters:

Return Value:

None.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSourceHandle::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: TRecordSourceHandle::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: TRecordSourceHandle::GetColumnTypeHintOfType

static EColumnTypeHint GetColumnTypeHintOfType (ColumnType)

Interface Category:

API.

Purpose:

Returns an enumerated column type hint associated with the given column type.

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: TRecordSourceHandle::GetColumnTypeOfHint

static ColumnType GetColumnTypeOfHint (EColumnTypeHint)

Interface Category:

API.

Purpose:

Returns a column type associated with the given column type hint.

Calling Context:

Call this function directly.

Parameters:

Return Value:

A column type.

Exceptions:

Throws no exceptions, passes all exceptions through.

Concurrency:

Not multithread safe.

Other Considerations:

None.

Member Function: TRecordSourceHandle::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: TRecordSourceHandle::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: TRecordSourceHandle::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: TRecordSourceHandle::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: TRecordSourceHandle::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: TRecordSourceHandle::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.

Member Function: TRecordSourceHandle::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.
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.