QGIS API Documentation 3.99.0-Master (26c88405ac0)
Loading...
Searching...
No Matches
qgsservercachefilter.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsservercachefilter.h
3 ------------------------
4 Cache interface for QGIS Server plugins
5
6 begin : 2018-07-05
7 copyright : (C) 2018 by René-Luc D'Hont
8 email : rldhont at 3liz dot com
9 ***************************************************************************/
10
11/***************************************************************************
12 * *
13 * This program is free software; you can redistribute it and/or modify *
14 * it under the terms of the GNU General Public License as published by *
15 * the Free Software Foundation; either version 2 of the License, or *
16 * (at your option) any later version. *
17 * *
18 ***************************************************************************/
19
20#ifndef QGSSERVERCACHEFILTER_H
21#define QGSSERVERCACHEFILTER_H
22
23#include "qgis_server.h"
24#include "qgis_sip.h"
25#include "qgsserverrequest.h"
26
27#include <QDomDocument>
28#include <QMultiMap>
29
30class QgsProject;
31
32SIP_IF_MODULE( HAVE_SERVER_PYTHON_PLUGINS )
33
35
36
43class SERVER_EXPORT QgsServerCacheFilter
44{
45 public:
46
52 QgsServerCacheFilter( const QgsServerInterface *serverInterface );
53
54 virtual ~QgsServerCacheFilter() = default;
55
63 virtual QByteArray getCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
64
73 virtual bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
74
82 virtual bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
83
89 virtual bool deleteCachedDocuments( const QgsProject *project ) const;
90
98 virtual QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
99
108 virtual bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
109
117 virtual bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
118
124 virtual bool deleteCachedImages( const QgsProject *project ) const;
125};
126
128typedef QMultiMap<int, QgsServerCacheFilter *> QgsServerCacheFilterMap;
129
130#endif // QGSSERVERCACHEFILTER_H
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition qgsproject.h:109
virtual bool deleteCachedImage(const QgsProject *project, const QgsServerRequest &request, const QString &key) const
Deletes the cached image.
virtual bool setCachedDocument(const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key) const
Updates or inserts the document in cache like capabilities.
QgsServerCacheFilter(const QgsServerInterface *serverInterface)
Constructor QgsServerInterface passed to plugins constructors and must be passed to QgsServerCacheFil...
virtual QByteArray getCachedImage(const QgsProject *project, const QgsServerRequest &request, const QString &key) const
Returns cached image (or 0 if document not in cache) like tiles.
virtual ~QgsServerCacheFilter()=default
virtual bool deleteCachedDocument(const QgsProject *project, const QgsServerRequest &request, const QString &key) const
Deletes the cached document.
virtual bool deleteCachedDocuments(const QgsProject *project) const
Deletes all cached documents for a QGIS project.
virtual QByteArray getCachedDocument(const QgsProject *project, const QgsServerRequest &request, const QString &key) const
Returns cached document (or 0 if document not in cache) like capabilities.
virtual bool deleteCachedImages(const QgsProject *project) const
Deletes all cached images for a QGIS project.
virtual bool setCachedImage(const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key) const
Updates or inserts the image in cache like tiles.
Defines interfaces exposed by QGIS Server and made available to plugins.
Defines requests passed to QgsService classes.
#define SIP_IF_MODULE(condition)
Definition qgis_sip.h:28
QMultiMap< int, QgsServerCacheFilter * > QgsServerCacheFilterMap
The registry definition.