18#ifndef QGSCONFIGCACHE_H
19#define QGSCONFIGCACHE_H
25#include <QFileSystemWatcher>
27#include <QDomDocument>
29#include "qgis_server.h"
49 virtual QString
name()
const = 0;
97 void removeEntry(
const QString &path );
122 QList<QgsProject *> projects()
const;
145 QDomDocument *xmlDocument( const QString &filePath );
147 QCache<QString, QDomDocument> mXmlDocumentCache;
148 QCache<QString, std::pair<QDateTime, std::unique_ptr<
QgsProject> > > mProjectCache;
154 void cacheProject( const QString &path,
QgsProject *project );
160 void removeChangedEntry( const QString &path );
163 void removeChangedEntries();
181 QString
name()
const override {
return QStringLiteral(
"filesystem" ); };
190 void entryRemoved(
const QString &path )
override;
196 void entryInserted(
const QString &path )
override;
200 QFileSystemWatcher mFileSystemWatcher;
220 QString
name()
const override {
return QStringLiteral(
"periodic" ); };
228 void setCheckInterval(
int msec );
240 void entryRemoved(
const QString &path )
override;
246 void entryInserted(
const QString &path )
override;
270 QString
name()
const override {
return QStringLiteral(
"off" ); };
279 void entryRemoved(
const QString &path )
override;
285 void entryInserted(
const QString &path )
override;
Abstract base class for implementing cache invalidation strategy.
virtual void attach(QgsConfigCache *cache)=0
Attache cache to this strategy.
virtual void entryInserted(const QString &path)=0
Called when an entry is removed from cache.
virtual ~QgsAbstractCacheStrategy()=default
virtual QString name() const =0
The name of the strategy.
virtual void entryRemoved(const QString &path)=0
Called when an entry is removed from cache.
Cache for server configuration.
QString strategyName() const
Returns the name of the current strategy.
void projectRemovedFromCache(const QString &path)
Emitted whenever a project is removed from the cache.
File system cache strategy for server configuration.
QString name() const override
The name of the strategy.
Null system cache strategy for server configuration, completely disable cache invalidation invalidati...
QgsNullCacheStrategy()=default
Creates a new null strategy.
QString name() const override
The name of the strategy.
Periodic system cache strategy for server configuration.
int checkInterval() const
Returns the invalidation check interval.
QString name() const override
The name of the strategy.
Encapsulates a QGIS project, including sets of map layers and their styles, layouts,...
Provides a way to retrieve settings by prioritizing according to environment variables,...