glc_cachemanager.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 
00003  This file is part of the GLC-lib library.
00004  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
00005  http://glc-lib.sourceforge.net
00006 
00007  GLC-lib is free software; you can redistribute it and/or modify
00008  it under the terms of the GNU Lesser General Public License as published by
00009  the Free Software Foundation; either version 3 of the License, or
00010  (at your option) any later version.
00011 
00012  GLC-lib is distributed in the hope that it will be useful,
00013  but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  GNU Lesser General Public License for more details.
00016 
00017  You should have received a copy of the GNU Lesser General Public License
00018  along with GLC-lib; if not, write to the Free Software
00019  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
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 // Private members
00124 private:
00125 
00127         QDir m_Dir;
00128 
00130         bool m_UseCompression;
00131 
00133         int m_CompressionLevel;
00134 };
00135 
00136 #endif /* GLC_CACHEMANAGER_H_ */

SourceForge.net Logo

©2005-2011 Laurent Ribon