Ceetron Data Provider Framework
Public Member Functions | List of all members
CDPDataProviderFactory Class Referenceabstract

Public Member Functions

virtual bool getProviderInfo (CDPDataProviderInfo *info)=0
 
virtual bool isSupportedByProvider (const CDPString &modelKey)=0
 
virtual CDPDataProvidercreateProviderInstance ()=0
 
virtual void destroyProviderInstance (CDPDataProvider *instance)=0
 

Detailed Description

A Data Provider Plugin has two classes. One CDPDataProviderFactory and one CDPDataProvider. The host will instantiate the factory once (usually at startup), and use the factory to determine if a given modelKey is supported by the plugin or not.

If the modelKey is supported, the host will use the factory to create a CDPDataProvider instance. Whenever the model/analysis is closed, the CDPDataProvider will be deleted.

The factory is only created once per process, and usually kept until the app/server closes.

The factory has two roles:

  1. Provide information about the associated data provider and check if a modelKey is supported by the provider.
  2. Create and destroy the associated data provider.

Member Function Documentation

CDPDataProvider * CDPDataProviderFactory::createProviderInstance ( )
pure virtual

Create and return an instance of the data provider associated with this factory.

Create and return the new instance. The instance is managed by the host, but it will be deleted with the destroyProviderInstance() method to ensure that it is allocated and deleted with the same heap manager.

void CDPDataProviderFactory::destroyProviderInstance ( CDPDataProvider instance)
pure virtual

Destroy the given data provider.

This method will be called whenever the host is done with the use of the data provider. The provider passed to this method will always have been allocated with createProviderInstance() in the same factory. This is to ensure that it is allocated and deleted with the same heap manager.

bool CDPDataProviderFactory::getProviderInfo ( CDPDataProviderInfo info)
pure virtual

Get information about the provider produced by this factory.

Populate the info object with information relevant to your provider.

bool CDPDataProviderFactory::isSupportedByProvider ( const CDPString modelKey)
pure virtual

Check if the given modelKey is supported by the data providers produced by this factory.

In this method you need to check if the incoming modelKey points to a resource that your provider can read.

Return true if the modelKey is supported, false if it is not.

If you return true, the next action from the host will be to create a CDPDataProvider with the createProviderInstance() method, and then call init on this object with the given modelKey.


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