GLC_lib  2.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
glc_cachemanager.h
Go to the documentation of this file.
1 /****************************************************************************
2 
3  This file is part of the GLC-lib library.
4  Copyright (C) 2005-2008 Laurent Ribon (laumaya@users.sourceforge.net)
5  http://glc-lib.sourceforge.net
6 
7  GLC-lib is free software; you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation; either version 3 of the License, or
10  (at your option) any later version.
11 
12  GLC-lib is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with GLC-lib; if not, write to the Free Software
19  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 
21  *****************************************************************************/
23 
24 #ifndef GLC_CACHEMANAGER_H_
25 #define GLC_CACHEMANAGER_H_
26 
27 #include <QDir>
28 #include <QString>
29 #include <QDateTime>
30 #include "geometry/glc_bsrep.h"
31 
32 #include "glc_config.h"
33 
36 
41 
43 {
44 public:
46 
48 
49 
50  GLC_CacheManager(const QString& path= QString());
51 
54 
56  GLC_CacheManager& operator=(const GLC_CacheManager&);
57 
59  virtual ~GLC_CacheManager();
61 
63 
65 
66 public:
68  inline QString absolutePath() const
69  {return m_Dir.absolutePath();}
70 
72  inline bool exists() const
73  {return m_Dir.exists();}
74 
76  bool isReadable() const;
77 
79  bool isWritable() const;
80 
82  bool isCashed(const QString&, const QString&) const;
83 
85  bool isUsable(const QDateTime&, const QString&, const QString&) const;
86 
88  GLC_BSRep binary3DRep(const QString&, const QString&) const;
89 
91  bool addToCache(const QString&, const GLC_3DRep&);
92 
94  inline bool compressionIsUsed() const
95  {return m_UseCompression;}
96 
98  inline int compressionLevel() const
99  {return m_CompressionLevel;}
100 
102 
104 
106 
107 public:
108 
110  bool setCachePath(const QString&);
111 
113  inline void setCompressionUsage(bool use)
114  {m_UseCompression= use;}
115 
117  inline void setCompressionLevel(int level)
118  {m_CompressionLevel= level;}
120 
122 // Private members
124 private:
125 
127  QDir m_Dir;
128 
131 
134 };
135 
136 #endif /* GLC_CACHEMANAGER_H_ */

©2005-2013 Laurent Ribon