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;
95 void removeEntry(
const QString &path );
120 QList<QgsProject *> projects()
const;
143 QDomDocument *xmlDocument( const QString &filePath );
145 QCache<QString, QDomDocument> mXmlDocumentCache;
146 QCache<QString, std::pair<QDateTime, std::unique_ptr<
QgsProject>>> mProjectCache;
152 void cacheProject( const QString &path,
QgsProject *project );
158 void removeChangedEntry( const QString &path );
161 void removeChangedEntries();
179 QString
name()
const override {
return QStringLiteral(
"filesystem" ); };
188 void entryRemoved(
const QString &path )
override;
194 void entryInserted(
const QString &path )
override;
198 QFileSystemWatcher mFileSystemWatcher;
217 QString
name()
const override {
return QStringLiteral(
"periodic" ); };
225 void setCheckInterval(
int msec );
237 void entryRemoved(
const QString &path )
override;
243 void entryInserted(
const QString &path )
override;
267 QString
name()
const override {
return QStringLiteral(
"off" ); };
276 void entryRemoved(
const QString &path )
override;
282 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,...