Minor header cleanups and documentation improvements

This commit is contained in:
Nyall Dawson 2020-03-06 08:24:43 +10:00
parent 266d920d99
commit fa6d62f9dd
10 changed files with 47 additions and 29 deletions

View File

@ -118,7 +118,9 @@ Gets the data source specification.
virtual QgsDataProviderTemporalCapabilities *temporalCapabilities();
%Docstring
Returns data provider temporal capabilities. This may be ``None``, depending on the data provider.
Returns the provider's temporal capabilities.
This may be ``None``, depending on the data provider.
.. versionadded:: 3.14
%End

View File

@ -11,11 +11,10 @@
class QgsDataProviderTemporalCapabilities : QgsTemporalProperty
{
%Docstring
Class for handling data providers temporal capabilities.
Base class for handling properties relating to a data provider's temporal capabilities.
.. versionadded:: 3.14
%End
@ -28,6 +27,8 @@ Class for handling data providers temporal capabilities.
QgsDataProviderTemporalCapabilities( bool enabled = false );
%Docstring
Constructor for QgsDataProviderTemporalCapabilities.
The ``enabled`` argument specifies whether the data provider has temporal capabilities.
%End
virtual ~QgsDataProviderTemporalCapabilities();

View File

@ -194,6 +194,7 @@ their own layers, such as WMS
%End
virtual QgsRasterDataProviderTemporalCapabilities *temporalCapabilities();
%Docstring
Returns temporal capabilities associated with the data provider.
%End

View File

@ -9,7 +9,6 @@
class QgsRasterDataProviderTemporalCapabilities : QgsDataProviderTemporalCapabilities
{
%Docstring
@ -30,13 +29,15 @@ and should only be set by the QgsDataProvider itself.
QgsRasterDataProviderTemporalCapabilities( bool enabled = false );
%Docstring
Constructor for :py:class:`QgsRasterDataProviderTemporalProperties`.
The ``enabled`` argument specifies whether the data provider has temporal capabilities.
%End
virtual ~QgsRasterDataProviderTemporalCapabilities();
void setFixedTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setFixedTemporalRange( const QgsDateTimeRange &range );
%Docstring
Sets the fixed datetime range for the temporal properties.
Sets the fixed datetime ``range`` for the temporal properties.
.. seealso:: :py:func:`fixedTemporalRange`
%End
@ -48,9 +49,9 @@ Returns the fixed datetime range for these temporal properties.
.. seealso:: :py:func:`setFixedTemporalRange`
%End
void setFixedReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setFixedReferenceTemporalRange( const QgsDateTimeRange &range );
%Docstring
Sets the fixed reference datetime range. This is to be used for
Sets the fixed reference datetime ``range``. This is to be used for
bi-temporal based data. Where data can have both nominal and reference times.
.. seealso:: :py:func:`fixedReferenceTemporalRange`
@ -63,9 +64,9 @@ Returns the fixed reference datetime range.
.. seealso:: :py:func:`setFixedReferenceTemporalRange`
%End
void setRequestedTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setRequestedTemporalRange( const QgsDateTimeRange &range );
%Docstring
Sets the requested temporal range to retrieve when
Sets the requested temporal ``range`` to retrieve when
returning data from the associated data provider.
.. note::
@ -85,9 +86,9 @@ Intended to be used by the provider in fetching data.
.. seealso:: :py:func:`setRequestedTemporalRange`
%End
void setRequestedReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setRequestedReferenceTemporalRange( const QgsDateTimeRange &range );
%Docstring
Sets the requested reference temporal range to retrieve when
Sets the requested reference temporal ``range`` to retrieve when
returning data from the associated data provider.
.. note::

View File

@ -25,6 +25,11 @@ QgsDataProvider::QgsDataProvider( const QString &uri, const QgsDataProvider::Pro
{
}
QgsDataProviderTemporalCapabilities *QgsDataProvider::temporalCapabilities()
{
return nullptr;
}
void QgsDataProvider::reloadData()
{
reloadProviderData();

View File

@ -173,11 +173,13 @@ class CORE_EXPORT QgsDataProvider : public QObject
}
/**
* Returns data provider temporal capabilities. This may be NULLPTR, depending on the data provider.
* Returns the provider's temporal capabilities.
*
* This may be NULLPTR, depending on the data provider.
*
* \since QGIS 3.14
*/
virtual QgsDataProviderTemporalCapabilities *temporalCapabilities() { return nullptr; }
virtual QgsDataProviderTemporalCapabilities *temporalCapabilities();
/**
* Returns the extent of the layer

View File

@ -23,12 +23,10 @@
#include "qgis_sip.h"
#include "qgstemporalproperty.h"
#include <QDomElement>
/**
* \class QgsDataProviderTemporalCapabilities
* \ingroup core
* Class for handling data providers temporal capabilities.
* Base class for handling properties relating to a data provider's temporal capabilities.
*
* \since QGIS 3.14
*/
@ -39,6 +37,8 @@ class CORE_EXPORT QgsDataProviderTemporalCapabilities : public QgsTemporalProper
/**
* Constructor for QgsDataProviderTemporalCapabilities.
*
* The \a enabled argument specifies whether the data provider has temporal capabilities.
*/
QgsDataProviderTemporalCapabilities( bool enabled = false );

View File

@ -216,15 +216,16 @@ QgsRasterBlock *QgsRasterDataProvider::block( int bandNo, QgsRectangle const &b
QgsRasterDataProvider::QgsRasterDataProvider()
: QgsDataProvider( QString(), QgsDataProvider::ProviderOptions() )
, QgsRasterInterface( nullptr )
, mTemporalCapabilities( qgis::make_unique< QgsRasterDataProviderTemporalCapabilities >() )
{
mTemporalCapabilities = qgis::make_unique< QgsRasterDataProviderTemporalCapabilities >();
}
QgsRasterDataProvider::QgsRasterDataProvider( const QString &uri, const ProviderOptions &options )
: QgsDataProvider( uri, options )
, QgsRasterInterface( nullptr )
, mTemporalCapabilities( qgis::make_unique< QgsRasterDataProviderTemporalCapabilities >() )
{
mTemporalCapabilities = qgis::make_unique< QgsRasterDataProviderTemporalCapabilities >();
}
QgsRasterDataProvider::ProviderCapabilities QgsRasterDataProvider::providerCapabilities() const
@ -407,6 +408,10 @@ void QgsRasterDataProvider::setUserNoDataValue( int bandNo, const QgsRasterRange
}
}
QgsRasterDataProviderTemporalCapabilities *QgsRasterDataProvider::temporalCapabilities()
{
return mTemporalCapabilities.get();
}
QgsRasterDataProvider *QgsRasterDataProvider::create( const QString &providerKey,
const QString &uri,

View File

@ -264,7 +264,7 @@ class CORE_EXPORT QgsRasterDataProvider : public QgsDataProvider, public QgsRast
/**
* Returns temporal capabilities associated with the data provider.
*/
QgsRasterDataProviderTemporalCapabilities *temporalCapabilities() override { return mTemporalCapabilities.get(); }
QgsRasterDataProviderTemporalCapabilities *temporalCapabilities() override;
//! \brief Returns whether the provider supplies a legend graphic
virtual bool supportsLegendGraphic() const { return false; }

View File

@ -34,24 +34,25 @@
*
* \since QGIS 3.14
*/
class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProviderTemporalCapabilities
{
public:
/**
* Constructor for QgsRasterDataProviderTemporalProperties.
*
* The \a enabled argument specifies whether the data provider has temporal capabilities.
*/
QgsRasterDataProviderTemporalCapabilities( bool enabled = false );
virtual ~QgsRasterDataProviderTemporalCapabilities() = default;
/**
* Sets the fixed datetime range for the temporal properties.
* Sets the fixed datetime \a range for the temporal properties.
*
* \see fixedTemporalRange()
*/
void setFixedTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setFixedTemporalRange( const QgsDateTimeRange &range );
/**
* Returns the fixed datetime range for these temporal properties.
@ -61,12 +62,12 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
const QgsDateTimeRange &fixedTemporalRange() const;
/**
* Sets the fixed reference datetime range. This is to be used for
* Sets the fixed reference datetime \a range. This is to be used for
* bi-temporal based data. Where data can have both nominal and reference times.
*
* \see fixedReferenceTemporalRange()
*/
void setFixedReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setFixedReferenceTemporalRange( const QgsDateTimeRange &range );
/**
* Returns the fixed reference datetime range.
@ -76,7 +77,7 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
const QgsDateTimeRange &fixedReferenceTemporalRange() const;
/**
* Sets the requested temporal range to retrieve when
* Sets the requested temporal \a range to retrieve when
* returning data from the associated data provider.
*
* \note this is not normally manually set, and is intended for use by
@ -85,7 +86,7 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
*
* \see requestedTemporalRange()
*/
void setRequestedTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setRequestedTemporalRange( const QgsDateTimeRange &range );
/**
* Returns the requested temporal range.
@ -96,7 +97,7 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
const QgsDateTimeRange &requestedTemporalRange() const;
/**
* Sets the requested reference temporal range to retrieve when
* Sets the requested reference temporal \a range to retrieve when
* returning data from the associated data provider.
*
* \note this is not normally manually set, and is intended for use by
@ -105,7 +106,7 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
*
* \see requestedReferenceTemporalRange()
*/
void setRequestedReferenceTemporalRange( const QgsDateTimeRange &dateTimeRange );
void setRequestedReferenceTemporalRange( const QgsDateTimeRange &range );
/**
* Returns the requested reference temporal range.