Ilwis-Objects
1.0
GIS and Remote Sensing framework for data access and processing
|
#include <connectorfactory.h>
Public Member Functions | |
ConnectorFactory () | |
ConnectorFactory constructor for the factory. | |
void | addCreator (quint64 objecttypes, const QString &provider, ConnectorCreate) |
Each connector must implement a create method (static method) that can be passed to this factory to be available to the system. More... | |
void | addCreator (const QString &format, const QString &provider, ConnectorCreate) |
Each connector must implement a create method (static method) that can be passed to this factory to be available to the system. More... | |
template<class T = ConnectorInterface> | |
T * | createFromResource (const Resource &resource, const QString &provider, const PrepareOptions &options=PrepareOptions()) const |
template<class T = ConnectorInterface> | |
QList< T * > | connectorsForResource (const Resource &resource, const QString &provider="*", const PrepareOptions &options=PrepareOptions()) const |
template<class T = ConnectorInterface> | |
T * | createFromFormat (const Resource &resource, const QString &format, const QString &provider=sUNDEF, const PrepareOptions &options=PrepareOptions()) const |
template<class T = ConnectorInterface> | |
T * | createContainerConnector (const Resource &resource, const QString &provider=sUNDEF, const PrepareOptions &options=PrepareOptions()) const |
std::vector< CatalogExplorer * > | explorersForResource (const Resource &resource, const QString &provider=sUNDEF, const PrepareOptions &options=PrepareOptions()) const |
![]() | |
QString | description () const |
QString | type () const |
QString | subtype () const |
QString | key () const |
bool | prepare () |
bool | canUse (const Resource &resource) const |
Static Public Member Functions | |
static std::nullptr_t | registerCatalogExplorer (createCatalogExplorer func) |
Protected Attributes | |
QHash< ConnectorFilter, ConnectorCreate > | _creatorsPerObject |
QHash< ConnectorFormatSelector, ConnectorCreate > | _creatorsPerFormat |
Static Protected Attributes | |
static std::vector < createCatalogExplorer > | _explorers |
Friends | |
class | ConnectorInterface |
Additional Inherited Members | |
![]() | |
AbstractFactory (const QString &ty, const QString &sub, const QString &desc="") | |
This class creates a connector for a certain resource Connectors (implementations of the connector interface) exist in many forms in Ilwis. They are usually tied to specific type of format. The factory produces a specific implementation of the interface. It does this by applying a filter on the set of known connectors to find a suitable create function for a specific type of resource. Connectors can be created based on a format or purely on the resource.
void ConnectorFactory::addCreator | ( | quint64 | objecttypes, |
const QString & | provider, | ||
ConnectorCreate | func | ||
) |
Each connector must implement a create method (static method) that can be passed to this factory to be available to the system.
objecttypes | a create function creates an connector that creates at least one type of objects but it may create more types. This parameter is OR combination of all the types it might create |
provider | the search key that is used to locate a particular create method |
void ConnectorFactory::addCreator | ( | const QString & | format, |
const QString & | provider, | ||
ConnectorCreate | func | ||
) |
Each connector must implement a create method (static method) that can be passed to this factory to be available to the system.
format | |
provider |
|
inline |
Creates a connector based on the properties of the resource. The method will try to find a create function based on the type of the resource and the format This method is usually called when a object must be connected to a specific format. For example when a script forces the use of a certain output format.
resource | a resource of a certain type. To work the type must have a valid IlwisType |
|
inline |
Creates a connector based on the properties of the resource. The method will try to find a create function based on the type of the resource and the provider This method is usually called from objectfactories in a plug-in that implements a defined set of connectors. At that place the name of the provider is known and can be used. outside the plug-in the name of the provider is often not known and can not be used.
resource | a resource of a certain type. To work the type must have a valid IlwisType |
provider | an identifier identifying the connector type |