[Classes] [Prev] [Next] [Methods]

CTdiTableConnection

Methods Index

Heritage
Description
Usage
Protected Data Members
Public Methods
Access Methods
Protected Methods
Private Methods
Override

CTdiTableConnection


Heritage

Superclass: CTdiConnection

Subclasses: None

Helper Class: CTdiTableFactory


Description

CTdiTableConnection specializes the services provided by CTdiConnection for the creation of connections to table-like data.


Usage

See CTdiConnection for general usage.

CTdiTableConnection creates special TDI connections to providers of data that is organized into rows and columns. Parameters may be added to indicate the column, row, or field of interest.

CTdiTableConnection relies on a factory object, derived from CTdiTableFactory, for the actual instantiation of the CTdiValue prototypes capable of making the necessary filtering and translation. You need to ensure that the connection classes are using an appropriate factory object that can create the correct prototypes for the type of data the provider sends.

There are two ways of parameterizing the connection classes with a connection factory object. One is to pass a pointer to the factory in the construction of the connection. The second is to register a default factory object with the Power++ global CFactoryMgr under the ID CTdiTableFactoryID. This default factory is then used whenever the the constructor of the connection classes is not provided a specific factory.


Protected Data Members

int itsColumn; Connections column specifier
int itsRow; Connections row specifier
CStringRW itsColumnName; Connection's string column specifier
CTdiTableFactory* itsFactory; Creates internal connection prototypes


Public Methods

CTdiTableConnection(
CNotifier* theProvider,
CNotifier* theDependent,
int theRow = CURRENT_INDEX,
int theColumn = CURRENT_INDEX,
long theContext = NULLcmd,
BOOLEAN autoConnect = TRUE,
CTdiTableFactory* theFactory = NULL );
CTdiTableConnection(
CNotifier* theProvider,
CNotifier* theDependent,
int theRow = CURRENT_INDEX,
CStringRW theColumn = NULLString,
long theContext = NULLcmd,
BOOLEAN autoConnect = TRUE,
CTdiTableFactory* theFactory = NULL);
virtual ~CTdiTableConnection();

Access Methods

int GetRowIndex() const;
int GetColumnIndex() const;
CStringRW GetColumnName() const;
void SetRowIndex(int theIndex);
void SetColumnIndex(int theIndex);
void SetColumnName(CStringRW theName);

Protected Methods

void UpdatePrototype();

Private Methods

CTdiTableConnection(
const CTdiTableConnection& theCopy);
CTdiTableConnection& operator=(
const CTdiTableConnection& theCopy);

Override

You may need to create a derived version of the CTdiTableFactory that will provide prototypes for different types of providers. For an example dealing with connection to database tables, see the derived version of CTdiTableFactory, CTdiDBTableFactory, in the XVT-ODBC++ Reference.

You can use the connection classes CTdiTableConnection or CTdiIndexConnection as an example of defining other connection classes which are specialized to handle connections to different types of data.



[Classes] [Prev] [Next] [Methods]

support@xvt.com


Visit our online help desk for tech support

Copyright © 2009, Providence Software Solutions Inc. All rights reserved.