map2d_widget
pureimagecache.h
Go to the documentation of this file.
1 
12 /*
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
17 *
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
22 *
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 */
27 #ifndef PUREIMAGECACHE_H
28 #define PUREIMAGECACHE_H
29 
30 #include <QtSql/QSqlDatabase>
31 #include <QString>
32 #include <QDir>
33 #include <QDebug>
34 #include <QFileInfo>
35 #include <QtSql/QSqlQuery>
36 #include <QtSql/QSqlError>
37 #include <QBuffer>
38 #include "maptype.h"
39 #include "point.h"
40 #include <QVariant>
41 #include "pureimage.h"
42 #include <QList>
43 #include <QMutex>
44 #include <QReadWriteLock>
45 namespace core {
47  {
48 
49  public:
51  static bool CreateEmptyDB(const QString &file);
52  bool PutImageToCache(const QByteArray &tile,const MapType::Types &type,const core::Point &pos, const int &zoom);
53  QByteArray GetImageFromCache(MapType::Types type, core::Point pos, int zoom);
54  QString GtileCache();
55  void setGtileCache(const QString &value);
56  static bool ExportMapDataToDB(QString sourceFile, QString destFile);
57  void deleteOlderTiles(int const& days);
58  private:
59  QString gtilecache;
60  QMutex Mcounter;
61  QReadWriteLock lock;
62  static qlonglong ConnCounter;
63 
64  };
65 
66 }
67 #endif // PUREIMAGECACHE_H
static bool CreateEmptyDB(const QString &file)
Definition: pureimagecache.cpp:69
Types
Definition: maptype.h:39
Definition: point.h:35
QByteArray GetImageFromCache(MapType::Types type, core::Point pos, int zoom)
Definition: pureimagecache.cpp:215
bool PutImageToCache(const QByteArray &tile, const MapType::Types &type, const core::Point &pos, const int &zoom)
Definition: pureimagecache.cpp:172
void deleteOlderTiles(int const &days)
Definition: pureimagecache.cpp:257
Definition: pureimagecache.h:46
QString GtileCache()
Definition: pureimagecache.cpp:63
PureImageCache()
Definition: pureimagecache.cpp:34
void setGtileCache(const QString &value)
Definition: pureimagecache.cpp:39
static bool ExportMapDataToDB(QString sourceFile, QString destFile)
Definition: pureimagecache.cpp:299