Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
ilwiscontext.h
1 #ifndef ILWISCONTEXT_H
2 #define ILWISCONTEXT_H
3 
4 #include "Kernel_global.h"
5 #include <QThreadStorage>
6 #include <QJsonObject>
7 #include "ilwisdata.h"
8 
9 namespace Ilwis{
10 
11 class Catalog;
12 typedef Ilwis::IlwisData<Ilwis::Catalog> ICatalog;
13 
19 class KERNELSHARED_EXPORT IlwisContext
20 {
21 public:
22  friend KERNELSHARED_EXPORT IlwisContext* context();
23 
24  IlwisContext();
25  ~IlwisContext();
26 
27  void loadConfigFile(QFileInfo configFile);
28  void addSystemLocation(const QUrl &resource);
29  void removeSystemLocation(const QUrl &resource);
30  QFileInfo ilwisFolder() const;
31  Ilwis::ICatalog workingCatalog() const;
32  void setWorkingCatalog(const Ilwis::ICatalog &cat);
33  QUrl cacheLocation() const;
34  quint64 memoryLeft() const;
35  quint64 changeMemoryLeft(quint64 amount);
36  QJsonObject configuration() const;
37 
38 private:
39  void init();
40  static IlwisContext *_context;
41 
42  std::vector<QUrl> _systemlocations;
43  //QThreadStorage<Catalog *> _workingCatalog;
44  ICatalog _workingCatalog;
45  quint64 _memoryLimit;
46  quint64 _memoryLeft;
47  QFileInfo _ilwisDir;
48  QJsonObject _configuration;
49  QUrl _cacheLocation;
50 };
51 KERNELSHARED_EXPORT IlwisContext* context();
52 }
53 
54 
55 
56 
57 //KERNELSHARED_EXPORT Ilwis::IlwisContext* context();
58 
59 #endif // ILWISCONTEXT_H