glc_cachemanager.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00023
00024 #ifndef GLC_CACHEMANAGER_H_
00025 #define GLC_CACHEMANAGER_H_
00026
00027 #include <QDir>
00028 #include <QString>
00029 #include <QDateTime>
00030 #include "geometry/glc_bsrep.h"
00031
00032 #include "glc_config.h"
00033
00036
00041
00042 class GLC_LIB_EXPORT GLC_CacheManager
00043 {
00044 public:
00046
00048
00049
00050 GLC_CacheManager(const QString& path= QString());
00051
00053 GLC_CacheManager(const GLC_CacheManager&);
00054
00056 GLC_CacheManager& operator=(const GLC_CacheManager&);
00057
00059 virtual ~GLC_CacheManager();
00061
00063
00065
00066 public:
00068 inline QString absolutePath() const
00069 {return m_Dir.absolutePath();}
00070
00072 inline bool exists() const
00073 {return m_Dir.exists();}
00074
00076 bool isReadable() const;
00077
00079 bool isWritable() const;
00080
00082 bool isCashed(const QString&, const QString&) const;
00083
00085 bool isUsable(const QDateTime&, const QString&, const QString&) const;
00086
00088 GLC_BSRep binary3DRep(const QString&, const QString&) const;
00089
00091 bool addToCache(const QString&, const GLC_3DRep&);
00092
00094 inline bool compressionIsUsed() const
00095 {return m_UseCompression;}
00096
00098 inline int compressionLevel() const
00099 {return m_CompressionLevel;}
00100
00102
00104
00106
00107 public:
00108
00110 bool setCachePath(const QString&);
00111
00113 inline void setCompressionUsage(bool use)
00114 {m_UseCompression= use;}
00115
00117 inline void setCompressionLevel(int level)
00118 {m_CompressionLevel= level;}
00120
00122
00124 private:
00125
00127 QDir m_Dir;
00128
00130 bool m_UseCompression;
00131
00133 int m_CompressionLevel;
00134 };
00135
00136 #endif