GLC_CacheManager : The 3D Rep Binary cache manager. More...
#include <glc_cachemanager.h>
Public Member Functions | |
Constructor | |
| GLC_CacheManager (const QString &path=QString()) | |
| Default constructor. | |
| GLC_CacheManager (const GLC_CacheManager &) | |
| Copy constructor. | |
| GLC_CacheManager & | operator= (const GLC_CacheManager &) |
| Assignement operator. | |
| virtual | ~GLC_CacheManager () |
| Destructor. | |
Get Functions | |
| QString | absolutePath () const |
| Return the cache absolute path. | |
| bool | exists () const |
| Return true if the cache dir exists. | |
| bool | isReadable () const |
| Return true if the cache is is readable. | |
| bool | isWritable () const |
| Return true if the cache is is writable. | |
| bool | isCashed (const QString &, const QString &) const |
| Return True if the specified file is cashed in the specified context. | |
| bool | isUsable (const QDateTime &, const QString &, const QString &) const |
| Return True if the cached file is usable. | |
| GLC_BSRep | binary3DRep (const QString &, const QString &) const |
| Return the binary serialized representation of the specified file. | |
| bool | addToCache (const QString &, const GLC_3DRep &) |
| Add the specified file in the cache. | |
| bool | compressionIsUsed () const |
| Return true if the compression is used. | |
| int | compressionLevel () const |
| Return the cache compression level. | |
Set Functions | |
| bool | setCachePath (const QString &) |
| Set the cache file path. | |
| void | setCompressionUsage (bool use) |
| Set the cache compression usage. | |
| void | setCompressionLevel (int level) |
| Set the cache compression level. | |
Private Attributes | |
| QDir | m_Dir |
| The cache directory. | |
| bool | m_UseCompression |
| Compress Data. | |
| int | m_CompressionLevel |
| The compression level. | |
GLC_CacheManager : The 3D Rep Binary cache manager.
By default the binary rep are compressed with a default compression level
Definition at line 42 of file glc_cachemanager.h.
| GLC_CacheManager::GLC_CacheManager | ( | const QString & | path = QString() |
) |
| GLC_CacheManager::GLC_CacheManager | ( | const GLC_CacheManager & | cacheManager | ) |
Copy constructor.
Definition at line 43 of file glc_cachemanager.cpp.
| GLC_CacheManager::~GLC_CacheManager | ( | ) | [virtual] |
Destructor.
Definition at line 61 of file glc_cachemanager.cpp.
| QString GLC_CacheManager::absolutePath | ( | ) | const [inline] |
Return the cache absolute path.
Definition at line 68 of file glc_cachemanager.h.
| bool GLC_CacheManager::addToCache | ( | const QString & | context, | |
| const GLC_3DRep & | rep | |||
| ) |
Add the specified file in the cache.
Definition at line 133 of file glc_cachemanager.cpp.
References glc::archiveEntryFileName(), GLC_Rep::fileName(), glc::isArchiveString(), isWritable(), m_CompressionLevel, m_Dir, m_UseCompression, GLC_BSRep::save(), and GLC_BSRep::setCompressionLevel().
Referenced by GLC_3dxmlToWorld::createReferenceRep(), and GLC_3dxmlToWorld::loadCurrentExtRep().
| GLC_BSRep GLC_CacheManager::binary3DRep | ( | const QString & | context, | |
| const QString & | fileName | |||
| ) | const |
Return the binary serialized representation of the specified file.
Definition at line 124 of file glc_cachemanager.cpp.
References m_Dir, and GLC_BSRep::suffix().
Referenced by GLC_3dxmlToWorld::create3DrepFrom3dxmlRep(), GLC_3dxmlToWorld::loadExternalRef3D(), and GLC_3dxmlToWorld::loadExternRepresentations().
| bool GLC_CacheManager::compressionIsUsed | ( | ) | const [inline] |
Return true if the compression is used.
Definition at line 94 of file glc_cachemanager.h.
| int GLC_CacheManager::compressionLevel | ( | ) | const [inline] |
Return the cache compression level.
Definition at line 98 of file glc_cachemanager.h.
| bool GLC_CacheManager::exists | ( | ) | const [inline] |
Return true if the cache dir exists.
Definition at line 72 of file glc_cachemanager.h.
| bool GLC_CacheManager::isCashed | ( | const QString & | context, | |
| const QString & | fileName | |||
| ) | const |
Return True if the specified file is cashed in the specified context.
Definition at line 94 of file glc_cachemanager.cpp.
References isReadable(), m_Dir, and GLC_BSRep::suffix().
Referenced by isUsable().
| bool GLC_CacheManager::isReadable | ( | ) | const |
Return true if the cache is is readable.
Definition at line 71 of file glc_cachemanager.cpp.
References m_Dir.
Referenced by isCashed().
| bool GLC_CacheManager::isUsable | ( | const QDateTime & | timeStamp, | |
| const QString & | context, | |||
| const QString & | fileName | |||
| ) | const |
Return True if the cached file is usable.
Definition at line 103 of file glc_cachemanager.cpp.
References isCashed(), GLC_BSRep::isUsable(), m_Dir, GLC_BSRep::setAbsoluteFileName(), and GLC_BSRep::suffix().
Referenced by GLC_3dxmlToWorld::create3DrepFrom3dxmlRep().
| bool GLC_CacheManager::isWritable | ( | ) | const |
Return true if the cache is is writable.
Definition at line 83 of file glc_cachemanager.cpp.
References m_Dir.
Referenced by addToCache().
| GLC_CacheManager & GLC_CacheManager::operator= | ( | const GLC_CacheManager & | cacheManager | ) |
Assignement operator.
Definition at line 52 of file glc_cachemanager.cpp.
References m_CompressionLevel, m_Dir, and m_UseCompression.
| bool GLC_CacheManager::setCachePath | ( | const QString & | path | ) |
| void GLC_CacheManager::setCompressionLevel | ( | int | level | ) | [inline] |
Set the cache compression level.
Definition at line 117 of file glc_cachemanager.h.
| void GLC_CacheManager::setCompressionUsage | ( | bool | use | ) | [inline] |
Set the cache compression usage.
Definition at line 113 of file glc_cachemanager.h.
int GLC_CacheManager::m_CompressionLevel [private] |
The compression level.
Definition at line 133 of file glc_cachemanager.h.
Referenced by addToCache(), and operator=().
QDir GLC_CacheManager::m_Dir [private] |
The cache directory.
Definition at line 127 of file glc_cachemanager.h.
Referenced by addToCache(), binary3DRep(), GLC_CacheManager(), isCashed(), isReadable(), isUsable(), isWritable(), operator=(), and setCachePath().
bool GLC_CacheManager::m_UseCompression [private] |
Compress Data.
Definition at line 130 of file glc_cachemanager.h.
Referenced by addToCache(), and operator=().