Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
symboltable.h
1 #ifndef SYMBOLTABLE_H
2 #define SYMBOLTABLE_H
3 
4 #include "Kernel_global.h"
5 #include <QVariant>
6 #include <QMultiHash>
7 
8 namespace Ilwis {
9 class KERNELSHARED_EXPORT Symbol{
10 public:
11  Symbol(int scope=iUNDEF, quint64 tp=itUNKNOWN, const QVariant& v=QVariant()) ;
12  virtual ~Symbol();
13  quint64 _type;
14  int _scope;
15  QVariant _var;
16  QVariant _modifier;
17  bool isValid() const;
18 };
19 
20 class KERNELSHARED_EXPORT SymbolTable //: private QHash<QString, Symbol>
21 {
22 public:
23  enum GetAction { gaKEEP, gaREMOVE, gaREMOVEIFANON};
24  SymbolTable();
25  virtual ~SymbolTable();
26 
27  void addSymbol(const QString& name, int scope, quint64 tp, const QVariant &v=QVariant());
28  QVariant getValue(const QString& name, int scope=1000) const;
29  Symbol getSymbol(const QString& name, GetAction act=gaKEEP, int scope=1000);
30  Symbol getSymbol(const QString& name, int scope=1000) const;
31  void unloadRasters();
32  IlwisTypes ilwisType(const QVariant &value, const QString &symname) const;
33 
34  static bool isNumerical(const QVariant &var) ;
35  static bool isRealNumerical(const QVariant &var) ;
36  static bool isIntegerNumerical(const QVariant &var) ;
37  static bool isDataLink(const QVariant &value);
38  static QString newAnonym();
39  static bool isString(const QVariant &var);
40 
41 private:
42  QHash<QString, Symbol> _symbols;
43  static quint64 _symbolid;
44 
45 
46 
47 };
48 }
49 
50 #endif // SYMBOLTABLE_H