QGIS API Documentation  3.4.15-Madeira (e83d02e274)
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 <QMap>
26 #include <QObject>
27 #include <QDomDocument>
28 
29 #include "qgis_server.h"
30 #include "qgis_sip.h"
31 #include "qgsproject.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 
61  const QgsProject *project( const QString &path );
62 
63  private:
65 
67  QFileSystemWatcher mFileSystemWatcher;
68 
70  QDomDocument *xmlDocument( const QString &filePath );
71 
72  QCache<QString, QDomDocument> mXmlDocumentCache;
73  QCache<QString, QgsProject> mProjectCache;
74 
75  private slots:
77  void removeChangedEntry( const QString &path );
78 };
79 
80 #endif // QGSCONFIGCACHE_H
#define SIP_FORCE
Definition: qgis_sip.h:124
Reads and writes project states.
Definition: qgsproject.h:89
Cache for server configuration.