Skip to content

Commit d0041a2

Browse files
committedAug 21, 2018
[Server][Feature][needs-docs] Add Cache manager SIP files
1 parent 65f9c91 commit d0041a2

File tree

2 files changed

+277
-0
lines changed

2 files changed

+277
-0
lines changed
 
Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/server/qgsservercachefilter.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
15+
class QgsServerCacheFilter
16+
{
17+
%Docstring
18+
Class defining cache interface for QGIS Server plugins.
19+
20+
.. versionadded:: 3.4
21+
%End
22+
23+
%TypeHeaderCode
24+
#include "qgsservercachefilter.h"
25+
%End
26+
public:
27+
28+
QgsServerCacheFilter( const QgsServerInterface *serverInterface );
29+
%Docstring
30+
Constructor
31+
QgsServerInterface passed to plugins constructors
32+
and must be passed to QgsServerCacheFilter instances.
33+
%End
34+
35+
virtual ~QgsServerCacheFilter();
36+
37+
virtual QByteArray getCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
38+
%Docstring
39+
Returns cached document (or 0 if document not in cache) like capabilities
40+
41+
:param project: the project used to generate the document to provide path
42+
:param request: the request used to generate the document to provider parameters or data
43+
:param key: the key provided by the access control to identify different documents for the same request
44+
45+
:return: QByteArray of the cached document or an empty one if no corresponding document found
46+
%End
47+
48+
virtual bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
49+
%Docstring
50+
Updates or inserts the document in cache like capabilities
51+
52+
:param doc: the document to cache
53+
:param project: the project used to generate the document to provide path
54+
:param request: the request used to generate the document to provider parameters or data
55+
:param key: the key provided by the access control to identify different documents for the same request
56+
57+
:return: true if the document has been cached
58+
%End
59+
60+
virtual bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
61+
%Docstring
62+
Deletes the cached document
63+
64+
:param project: the project used to generate the document to provide path
65+
:param request: the request used to generate the document to provider parameters or data
66+
:param key: the key provided by the access control to identify different documents for the same request
67+
68+
:return: true if the document has been deleted
69+
%End
70+
71+
virtual bool deleteCachedDocuments( const QgsProject *project ) const;
72+
%Docstring
73+
Deletes all cached documents for a QGIS project
74+
75+
:param project: the project used to generate the documents to provide path
76+
77+
:return: true if the documents have been deleted
78+
%End
79+
80+
virtual QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
81+
%Docstring
82+
Returns cached image (or 0 if document not in cache) like tiles
83+
84+
:param project: the project used to generate the image to provide path
85+
:param request: the request used to generate the image to provider parameters or data
86+
:param key: the key provided by the access control to identify different images for the same request
87+
88+
:return: QByteArray of the cached image or an empty one if no corresponding image found
89+
%End
90+
91+
virtual bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
92+
%Docstring
93+
Updates or inserts the image in cache like tiles
94+
95+
:param img: the document to cache
96+
:param project: the project used to generate the image to provide path
97+
:param request: the request used to generate the image to provider parameters or data
98+
:param key: the key provided by the access control to identify different images for the same request
99+
100+
:return: true if the image has been cached
101+
%End
102+
103+
virtual bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
104+
%Docstring
105+
Deletes the cached image
106+
107+
:param project: the project used to generate the image to provide path
108+
:param request: the request used to generate the image to provider parameters or data
109+
:param key: the key provided by the access control to identify different images for the same request
110+
111+
:return: true if the image has been deleted
112+
%End
113+
114+
virtual bool deleteCachedImages( const QgsProject *project ) const;
115+
%Docstring
116+
Deletes all cached images for a QGIS project
117+
118+
:param project: the project used to generate the images to provide path
119+
120+
:return: true if the images have been deleted
121+
%End
122+
123+
};
124+
125+
typedef QMultiMap<int, QgsServerCacheFilter *> QgsServerCacheFilterMap;
126+
127+
/************************************************************************
128+
* This file has been generated automatically from *
129+
* *
130+
* src/server/qgsservercachefilter.h *
131+
* *
132+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
133+
************************************************************************/
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/server/qgsservercachemanager.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
11+
12+
13+
14+
15+
16+
class QgsServerCacheManager
17+
{
18+
%Docstring
19+
A helper class that centralizes caches accesses given by all the server cache filter plugins.
20+
21+
.. versionadded:: 3.4
22+
%End
23+
24+
%TypeHeaderCode
25+
#include "qgsservercachemanager.h"
26+
#include "qgsservercachefilter.h"
27+
%End
28+
public:
29+
QgsServerCacheManager();
30+
%Docstring
31+
Constructor
32+
%End
33+
34+
QgsServerCacheManager( const QgsServerCacheManager &copy );
35+
%Docstring
36+
Constructor
37+
%End
38+
39+
40+
~QgsServerCacheManager();
41+
42+
QByteArray getCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
43+
%Docstring
44+
Returns cached document (or 0 if document not in cache) like capabilities
45+
46+
:param project: the project used to generate the document to provide path
47+
:param request: the request used to generate the document to provider parameters or data
48+
:param key: the key provided by the access control to identify different documents for the same request
49+
50+
:return: the cached document or 0 if no corresponding document found
51+
%End
52+
53+
bool setCachedDocument( const QDomDocument *doc, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
54+
%Docstring
55+
Updates or inserts the document in cache like capabilities
56+
57+
:param doc: the document to cache
58+
:param project: the project used to generate the document to provide path
59+
:param request: the request used to generate the document to provider parameters or data
60+
:param key: the key provided by the access control to identify different documents for the same request
61+
62+
:return: true if the document has been cached
63+
%End
64+
65+
bool deleteCachedDocument( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
66+
%Docstring
67+
Deletes the cached document
68+
69+
:param project: the project used to generate the document to provide path
70+
:param request: the request used to generate the document to provider parameters or data
71+
:param key: the key provided by the access control to identify different documents for the same request
72+
73+
:return: true if the document has been deleted
74+
%End
75+
76+
bool deleteCachedDocuments( const QgsProject *project ) const;
77+
%Docstring
78+
Deletes all cached documents for a QGIS project
79+
80+
:param project: the project used to generate the document to provide path
81+
82+
:return: true if the document has been deleted
83+
%End
84+
85+
QByteArray getCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
86+
%Docstring
87+
Returns cached image (or 0 if image not in cache) like tiles
88+
89+
:param project: the project used to generate the image to provide path
90+
:param request: the request used to generate the image to provider parameters or data
91+
:param key: the key provided by the access control to identify different images for the same request
92+
93+
:return: the cached image or 0 if no corresponding image found
94+
%End
95+
96+
bool setCachedImage( const QByteArray *img, const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
97+
%Docstring
98+
Updates or inserts the image in cache like tiles
99+
100+
:param img: the image to cache
101+
:param project: the project used to generate the image to provide path
102+
:param request: the request used to generate the image to provider parameters or data
103+
:param key: the key provided by the access control to identify different images for the same request
104+
105+
:return: true if the image has been cached
106+
%End
107+
108+
bool deleteCachedImage( const QgsProject *project, const QgsServerRequest &request, const QString &key ) const;
109+
%Docstring
110+
Deletes the cached image
111+
112+
:param project: the project used to generate the image to provide path
113+
:param request: the request used to generate the image to provider parameters or data
114+
:param key: the key provided by the access control to identify different images for the same request
115+
116+
:return: true if the image has been deleted
117+
%End
118+
119+
bool deleteCachedImages( const QgsProject *project ) const;
120+
%Docstring
121+
Deletes all cached images for a QGIS project
122+
123+
:param project: the project used to generate the images to provide path
124+
125+
:return: true if the images have been deleted
126+
%End
127+
128+
void registerServerCache( QgsServerCacheFilter *serverCache, int priority = 0 );
129+
%Docstring
130+
Register a server cache filter
131+
132+
:param serverCache: the server cache to add
133+
:param priority: the priority used to define the order
134+
%End
135+
136+
};
137+
138+
/************************************************************************
139+
* This file has been generated automatically from *
140+
* *
141+
* src/server/qgsservercachemanager.h *
142+
* *
143+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
144+
************************************************************************/

0 commit comments

Comments
 (0)
Please sign in to comment.