Ceetron Data Provider Framework
|
Public Member Functions | |
virtual bool | getProviderInfo (CDPDataProviderInfo *info)=0 |
virtual bool | isSupportedByProvider (const CDPString &modelKey)=0 |
virtual CDPDataProvider * | createProviderInstance ()=0 |
virtual void | destroyProviderInstance (CDPDataProvider *instance)=0 |
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:
|
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.
|
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.
|
pure virtual |
Get information about the provider produced by this factory.
Populate the info object with information relevant to your provider.
|
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.