QGIS API Documentation
4.3.0-Master (16eddb2670e)
Toggle main menu visibility
Loading...
Searching...
No Matches
src
core
qgssourcecache.h
Go to the documentation of this file.
1
/***************************************************************************
2
qgssourcecache.h
3
---------------
4
begin : July 2020
5
copyright : (C) 2020 by Mathieu Pellerin
6
email : nirvn dot asia at gmail dot com
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 QGSSOURCECACHE_H
19
#define QGSSOURCECACHE_H
20
21
#include "qgis_core.h"
22
#include "
qgis_sip.h
"
23
#include "
qgsabstractcontentcache.h
"
24
25
class
QTemporaryDir;
26
27
#ifndef SIP_RUN
28
30
37
class
CORE_EXPORT QgsSourceCacheEntry :
public
QgsAbstractContentCacheEntry
38
{
39
public
:
43
QgsSourceCacheEntry(
const
QString &path );
44
46
QString filePath;
47
48
int
dataSize
()
const override
;
49
void
dump
()
const override
;
50
bool
isEqual
(
const
QgsAbstractContentCacheEntry *other )
const override
;
51
};
52
54
#endif
55
66
#ifdef SIP_RUN
67
class
CORE_EXPORT
QgsSourceCache
:
public
QgsAbstractContentCacheBase
// for sip we skip to the base class and avoid the template difficulty
68
{
69
#else
70
class
CORE_EXPORT
QgsSourceCache
:
public
QgsAbstractContentCache
< QgsSourceCacheEntry >
71
{
72
#endif
73
Q_OBJECT
74
75
public
:
79
QgsSourceCache
( QObject *parent
SIP_TRANSFERTHIS
=
nullptr
);
80
86
QString
localFilePath
(
const
QString &path,
bool
blocking =
false
);
87
88
signals:
89
93
void
remoteSourceFetched
(
const
QString &url );
94
95
private
:
96
QString fetchSource(
const
QString &path,
bool
&isBroken,
bool
blocking =
false
)
const
;
97
98
std::unique_ptr< QTemporaryDir > temporaryDir;
99
};
100
101
#endif
// QGSSOURCECACHE_H
QgsAbstractContentCacheBase
A QObject derived base class for QgsAbstractContentCache.
Definition
qgsabstractcontentcache.h:130
QgsAbstractContentCacheEntry
Base class for entries in a QgsAbstractContentCache.
Definition
qgsabstractcontentcache.h:55
QgsAbstractContentCacheEntry::dataSize
virtual int dataSize() const =0
Returns the memory usage in bytes for the entry.
QgsAbstractContentCacheEntry::dump
virtual void dump() const =0
Dumps debugging strings containing the item's properties.
QgsAbstractContentCacheEntry::isEqual
virtual bool isEqual(const QgsAbstractContentCacheEntry *other) const =0
Tests whether this entry matches another entry.
QgsAbstractContentCache< QgsSourceCacheEntry >::QgsAbstractContentCache
QgsAbstractContentCache(QObject *parent=nullptr, const QString &typeString=QString(), long maxCacheSize=20000000, int fileModifiedCheckTimeout=30000)
Definition
qgsabstractcontentcache.h:250
QgsSourceCache
A cache for source strings that returns a local file path containing the source content.
Definition
qgssourcecache.h:71
QgsSourceCache::QgsSourceCache
QgsSourceCache(QObject *parent=nullptr)
Constructor for QgsSourceCache, with the specified parent object.
Definition
qgssourcecache.cpp:63
QgsSourceCache::remoteSourceFetched
void remoteSourceFetched(const QString &url)
Emitted when the cache has finished retrieving a 3D model from a remote url.
QgsSourceCache::localFilePath
QString localFilePath(const QString &path, bool blocking=false)
Returns a local file path reflecting the content of a specified source path.
Definition
qgssourcecache.cpp:71
qgis_sip.h
SIP_TRANSFERTHIS
#define SIP_TRANSFERTHIS
Definition
qgis_sip.h:52
qgsabstractcontentcache.h
Generated on
for QGIS API Documentation by
1.17.0