QGIS API Documentation  3.10.0-A Coruña (6c816b4204)
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 
37 class SERVER_EXPORT QgsConfigCache : public QObject
38 {
39  Q_OBJECT
40  public:
41 
45  static QgsConfigCache *instance();
46 
51  void removeEntry( const QString &path );
52 
60  const QgsProject *project( const QString &path );
61 
62  private:
64 
66  QFileSystemWatcher mFileSystemWatcher;
67 
69  QDomDocument *xmlDocument( const QString &filePath );
70 
71  QCache<QString, QDomDocument> mXmlDocumentCache;
72  QCache<QString, QgsProject> mProjectCache;
73 
74  private slots:
76  void removeChangedEntry( const QString &path );
77 };
78 
79 #endif // QGSCONFIGCACHE_H
#define SIP_FORCE
Definition: qgis_sip.h:131
Encapsulates a QGIS project, including sets of map layers and their styles, layouts, annotations, canvases, etc.
Definition: qgsproject.h:89
Cache for server configuration.