QGIS API Documentation  3.2.0-Bonn (bc43194)
Public Types | Public Member Functions | List of all members
QgsProviderMetadata Class Reference

Holds data provider key, description, and associated shared library file or function pointer information. More...

#include <qgsprovidermetadata.h>

Public Types

typedef std::function< QgsDataProvider *(const QString &, const QgsDataProvider::ProviderOptions &) > CreateDataProviderFunction
 Typedef for data provider creation function. More...
 

Public Member Functions

 QgsProviderMetadata (const QString &_key, const QString &_description, const QString &_library)
 
 QgsProviderMetadata (const QString &key, const QString &description, const QgsProviderMetadata::CreateDataProviderFunction &createFunc)
 Metadata for provider with direct provider creation function pointer, where no library is involved. More...
 
CreateDataProviderFunction createFunction () const
 Returns a pointer to the direct provider creation function, if supported by the provider. More...
 
QString description () const
 This returns descriptive text for the provider. More...
 
QString key () const
 This returns the unique key associated with the provider. More...
 
QString library () const
 This returns the library file name. More...
 

Detailed Description

Holds data provider key, description, and associated shared library file or function pointer information.

Provider metadata refers either to providers which are loaded via libraries or which are native providers that are included in the core QGIS installation and accessed through function pointers.

For library based providers, the metadata class is used in a lazy load implementation in QgsProviderRegistry. To save memory, data providers are only actually loaded via QLibrary calls if they're to be used. (Though they're all iteratively loaded once to get their metadata information, and then unloaded when the QgsProviderRegistry is created.) QgsProviderMetadata supplies enough information to be able to later load the associated shared library object.

Definition at line 46 of file qgsprovidermetadata.h.

Member Typedef Documentation

◆ CreateDataProviderFunction

Typedef for data provider creation function.

Since
QGIS 3.0

Definition at line 54 of file qgsprovidermetadata.h.

Constructor & Destructor Documentation

◆ QgsProviderMetadata() [1/2]

QgsProviderMetadata::QgsProviderMetadata ( const QString &  _key,
const QString &  _description,
const QString &  _library 
)

Definition at line 23 of file qgsprovidermetadata.cpp.

◆ QgsProviderMetadata() [2/2]

QgsProviderMetadata::QgsProviderMetadata ( const QString &  key,
const QString &  description,
const QgsProviderMetadata::CreateDataProviderFunction createFunc 
)

Metadata for provider with direct provider creation function pointer, where no library is involved.

Since
QGIS 3.0

Definition at line 31 of file qgsprovidermetadata.cpp.

Member Function Documentation

◆ createFunction()

QgsProviderMetadata::CreateDataProviderFunction QgsProviderMetadata::createFunction ( ) const

Returns a pointer to the direct provider creation function, if supported by the provider.

Note
not available in Python bindings
Since
QGIS 3.0

Definition at line 52 of file qgsprovidermetadata.cpp.

◆ description()

QString QgsProviderMetadata::description ( ) const

This returns descriptive text for the provider.

This is used to provide a descriptive list of available data providers.

Definition at line 42 of file qgsprovidermetadata.cpp.

◆ key()

QString QgsProviderMetadata::key ( ) const

This returns the unique key associated with the provider.

This key string is used for the associative container in QgsProviderRegistry

Definition at line 37 of file qgsprovidermetadata.cpp.

◆ library()

QString QgsProviderMetadata::library ( ) const

This returns the library file name.

This is used to QLibrary calls to load the data provider.

Definition at line 47 of file qgsprovidermetadata.cpp.


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