Skip to content
Permalink
Browse files
Merge pull request #4487 from nyalldawson/memory
Move memory provider to core
  • Loading branch information
nyalldawson committed May 6, 2017
2 parents df679a2 + e2a735f commit 8d03642
Show file tree
Hide file tree
Showing 45 changed files with 690 additions and 278 deletions.
@@ -4,7 +4,6 @@ usr/lib/qgis/plugins/libdelimitedtextprovider.so
usr/lib/qgis/plugins/libgdalprovider.so
usr/lib/qgis/plugins/libgpxprovider.so
usr/lib/qgis/plugins/libidentcertauthmethod.so
usr/lib/qgis/plugins/libmemoryprovider.so
usr/lib/qgis/plugins/libmssqlprovider.so
usr/lib/qgis/plugins/libdb2provider.so
usr/lib/qgis/plugins/libogrprovider.so
@@ -66,6 +66,8 @@ IF(WITH_APIDOC)
${CMAKE_SOURCE_DIR}/src/core/metadata
${CMAKE_SOURCE_DIR}/src/core/pal
${CMAKE_SOURCE_DIR}/src/core/processing
${CMAKE_SOURCE_DIR}/src/core/providers
${CMAKE_SOURCE_DIR}/src/core/providers/memory
${CMAKE_SOURCE_DIR}/src/core/raster
${CMAKE_SOURCE_DIR}/src/core/scalebar
${CMAKE_SOURCE_DIR}/src/core/symbology-ng
@@ -1678,6 +1678,14 @@ QgsProjectPropertyValue {#qgis_api_break_3_0_QgsProjectPropertyValue}

- The unused count() and entryList() methods were removed.

QgsProviderRegistry {#qgis_api_break_3_0_QgsProviderRegistry}
-------------------

- provider() was renamed to createProvider()
- selectWidget() was renamed to createSelectionWidget()
- providerLibrary() was renamed to createProviderLibrary()


QgsRaster {#qgis_api_break_3_0_QgsRaster}
---------

@@ -302,7 +302,6 @@ tar -C %OSGEO4W_ROOT% -cjf %ARCH%/release/qgis/%PACKAGENAME%-common/%PACKAGENAME
"apps/%PACKAGENAME%/plugins/gdalprovider.dll" ^
"apps/%PACKAGENAME%/plugins/gpxprovider.dll" ^
"apps/%PACKAGENAME%/plugins/identcertauthmethod.dll" ^
"apps/%PACKAGENAME%/plugins/memoryprovider.dll" ^
"apps/%PACKAGENAME%/plugins/mssqlprovider.dll" ^
"apps/%PACKAGENAME%/plugins/db2provider.dll" ^
"apps/%PACKAGENAME%/plugins/ogrprovider.dll" ^
@@ -107,6 +107,8 @@ INCLUDE_DIRECTORIES(
../src/core/layertree
../src/core/metadata
../src/core/processing
../src/core/providers
../src/core/providers/memory
../src/core/raster
../src/core/scalebar
../src/core/symbology-ng
@@ -59,8 +59,6 @@ core/qgssnappingconfig.sip
core/qgsprojectversion.sip
core/qgsproperty.sip
core/qgspropertycollection.sip
core/qgsprovidermetadata.sip
core/qgsproviderregistry.sip
core/qgspythonrunner.sip
core/qgsrange.sip
core/qgsrelationmanager.sip
@@ -286,6 +286,8 @@
%Include processing/qgsprocessingregistry.sip
%Include processing/qgsprocessingutils.sip

%Include providers/memory/qgsmemoryproviderutils.sip

%Include raster/qgsbilinearrasterresampler.sip
%Include raster/qgsbrightnesscontrastfilter.sip
%Include raster/qgscliptominmaxenhancement.sip
@@ -0,0 +1,48 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/providers/memory/qgsmemoryproviderutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/





class QgsMemoryProviderUtils
{
%Docstring
Utility functions for use with the memory vector data provider.
.. versionadded:: 3.0
%End

%TypeHeaderCode
#include "qgsmemoryproviderutils.h"
%End
public:

static QgsVectorLayer *createMemoryLayer( const QString &name,
const QgsFields &fields,
QgsWkbTypes::Type geometryType = QgsWkbTypes::NoGeometry,
const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() ) /Factory/;
%Docstring
Creates a new memory layer using the specified parameters. The caller takes responsibility
for deleting the newly created layer.
\param name layer name
\param fields fields for layer
\param geometryType optional layer geometry type
\param crs optional layer CRS for layers with geometry
:rtype: QgsVectorLayer
%End
};



/************************************************************************
* This file has been generated automatically from *
* *
* src/core/providers/memory/qgsmemoryproviderutils.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -1,43 +1,75 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsprovidermetadata.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




/** \ingroup core
* Holds data provider key, description, and associated shared library file information.

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.

*/
class QgsProviderMetadata
{
%TypeHeaderCode
#include <qgsprovidermetadata.h>
%Docstring
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.
%End

%TypeHeaderCode
#include "qgsprovidermetadata.h"
%End
public:


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

/** This returns the unique key associated with the provider

This key string is used for the associative container in QgsProviderRegistry
*/
QString key() const;
%Docstring
This returns the unique key associated with the provider

/** This returns descriptive text for the provider
This key string is used for the associative container in QgsProviderRegistry
:rtype: str
%End

This is used to provide a descriptive list of available data providers.
*/
QString description() const;
%Docstring
This returns descriptive text for the provider

/** This returns the library file name
This is used to provide a descriptive list of available data providers.
:rtype: str
%End

This is used to QLibrary calls to load the data provider.
*/
QString library() const;
%Docstring
This returns the library file name

This is used to QLibrary calls to load the data provider.
:rtype: str
%End


};


}; // class QgsProviderMetadata
/************************************************************************
* This file has been generated automatically from *
* *
* src/core/qgsprovidermetadata.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/

0 comments on commit 8d03642

Please sign in to comment.