Skip to content

Commit

Permalink
Hide access to setRequestedTemporalRange from QgsRasterDataProviderTe…
Browse files Browse the repository at this point in the history
…mporalCapabilities

Only QgsRasterLayerRenderer should be accessing this, so block access
via friend class
  • Loading branch information
nyalldawson committed Mar 13, 2020
1 parent 14355ba commit 4b1b4ab
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 26 deletions.
Expand Up @@ -84,20 +84,6 @@ Returns the available reference datetime range, which indicates the maximum
extent of datetime values available for reference temporal ranges from the provider.

.. seealso:: :py:func:`setAvailableReferenceTemporalRange`
%End

void setRequestedTemporalRange( const QgsDateTimeRange &range );
%Docstring
Sets the requested temporal ``range`` to retrieve when
returning data from the associated data provider.

.. note::

this is not normally manually set, and is intended for use by
QgsRasterLayerRenderer to automatically set the requested temporal range
on a clone of the data provider during a render job.

.. seealso:: :py:func:`requestedTemporalRange`
%End

const QgsDateTimeRange &requestedTemporalRange() const;
Expand Down
27 changes: 15 additions & 12 deletions src/core/raster/qgsrasterdataprovidertemporalcapabilities.h
Expand Up @@ -102,18 +102,6 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
*/
const QgsDateTimeRange &availableReferenceTemporalRange() const;

/**
* 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
* QgsRasterLayerRenderer to automatically set the requested temporal range
* on a clone of the data provider during a render job.
*
* \see requestedTemporalRange()
*/
void setRequestedTemporalRange( const QgsDateTimeRange &range );

/**
* Returns the requested temporal range.
* Intended to be used by the provider in fetching data.
Expand Down Expand Up @@ -176,6 +164,18 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv

private:

/**
* 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
* QgsRasterLayerRenderer to automatically set the requested temporal range
* on a clone of the data provider during a render job.
*
* \see requestedTemporalRange()
*/
void setRequestedTemporalRange( const QgsDateTimeRange &range );

/**
* Represents available data provider datetime range.
*
Expand Down Expand Up @@ -214,6 +214,9 @@ class CORE_EXPORT QgsRasterDataProviderTemporalCapabilities : public QgsDataProv
//! Interval handling method
IntervalHandlingMethod mIntervalMatchMethod = MatchUsingWholeRange;

friend class QgsRasterLayerRenderer;
friend class TestQgsRasterDataProviderTemporalCapabilities;

};

#endif // QGSRASTERDATAPROVIDERTEMPORALCAPABILITIES_H

0 comments on commit 4b1b4ab

Please sign in to comment.