QGIS API Documentation  3.20.0-Odense (decaadbb31)
qgsconfigcache.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsconfigcache.h
3  ----------------
4  begin : July 24th, 2010
5  copyright : (C) 2010 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 QGSCONFIGCACHE_H
19 #define QGSCONFIGCACHE_H
20 
21 #include "qgsconfig.h"
22 
23 #include <QCache>
24 #include <QFileSystemWatcher>
25 #include <QObject>
26 #include <QDomDocument>
27 
28 #include "qgis_server.h"
29 #include "qgis_sip.h"
30 #include "qgsproject.h"
31 #include "qgsserversettings.h"
32 
38 class SERVER_EXPORT QgsConfigCache : public QObject
39 {
40  Q_OBJECT
41  public:
42 
46  static QgsConfigCache *instance();
47 
52  void removeEntry( const QString &path );
53 
66  const QgsProject *project( const QString &path, const QgsServerSettings *settings = nullptr );
67 
68  private:
70 
72  QFileSystemWatcher mFileSystemWatcher;
73 
75  QDomDocument *xmlDocument( const QString &filePath );
76 
77  QCache<QString, QDomDocument> mXmlDocumentCache;
78  QCache<QString, QgsProject> mProjectCache;
79 
80  private slots:
82  void removeChangedEntry( const QString &path );
83 };
84 
85 #endif // QGSCONFIGCACHE_H
Cache for server configuration.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Definition: qgsproject.h:99
Provides a way to retrieve settings by prioritizing according to environment variables,...
#define SIP_FORCE
Definition: qgis_sip.h:131