QGIS API Documentation 3.37.0-Master (df6056bf1be)
Loading...
Searching...
No Matches
qgscapabilitiescache.h
Go to the documentation of this file.
1/***************************************************************************
2 qgscapabilitiescache.h
3 ----------------------
4 begin : May 11th, 2011
5 copyright : (C) 2011 by Marco Hugentobler
6 email : marco dot hugentobler at sourcepole dot ch
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSCAPABILITIESCACHE_H
19#define QGSCAPABILITIESCACHE_H
20
21#include <QDomDocument>
22#include <QFileSystemWatcher>
23#include <QHash>
24#include <QObject>
25#include <QDateTime>
26#include <QTimer>
27
28#include "qgis_server.h"
29#include "qgsserversettings.h"
30
35class SERVER_EXPORT QgsCapabilitiesCache : public QObject
36{
37 Q_OBJECT
38 public:
39 QgsCapabilitiesCache( int size );
40
46 const QDomDocument *searchCapabilitiesDocument( const QString &configFilePath, const QString &key );
47
54 void insertCapabilitiesDocument( const QString &configFilePath, const QString &key, const QDomDocument *doc );
55
56 public slots:
57
62 void removeCapabilitiesDocument( const QString &path );
63
64 private:
65 QHash< QString, QHash< QString, QDomDocument > > mCachedCapabilities;
66 QHash< QString, QDateTime> mCachedCapabilitiesTimestamps;
67 QFileSystemWatcher mFileSystemWatcher;
68 QTimer mTimer;
69 int mCacheSize;
70
71 private slots:
73 void removeChangedEntry( const QString &path );
75 void removeOutdatedEntries();
76};
77
78#endif // QGSCAPABILITIESCACHE_H
A cache for capabilities xml documents (by configuration file path)