Ilwis-Objects  1.0
GIS and Remote Sensing framework for data access and processing
 All Classes Functions Enumerations Pages
attributerecord.h
1 #ifndef ATTRIBUTETABLE_H
2 #define ATTRIBUTETABLE_H
3 
4 #define hash32(x) ((x)*2654435761)
5 #define H_BITS 24 // Hashtable size
6 #define H_SHIFT (32-H_BITS)
7 #define COVERAGETABLE -1
8 
9 
10 namespace Ilwis {
11 class KERNELSHARED_EXPORT AttributeRecord
12 {
13 public:
15  AttributeRecord(quint32 keyrecord, const ITable& attTable);
16 
17  quint32 columnCount(bool coverages=true) const;
18  ColumnDefinition columndefinition(const QString& nme, bool coverages=true) const;
19  ColumnDefinition columndefinition(int colindex, bool coverages=true) const;
20  quint32 columnIndex(const QString& nme, bool coverages=true) const;
21  void cell(quint32 colIndex, const QVariant &var, int index=-1);
22  QVariant cell(quint32 colIndex, int index, bool asRaw);
23  //void setTable(const ITable& tbl, const QString& keyColumn, int indexCount=COVERAGETABLE);
24  bool isValid() const;
25  AttributeRecord *clone() const;
26 private:
27  void indexKeyColumn();
28  void indexVerticalIndex(int index);
29  ITable _coverageTable;
30  ITable _indexTable;
31  quint32 _keyRecord = iUNDEF;
32  //std::unordered_map<quint32, quint32> _coverageIndex;
33  //std::vector<std::unordered_map<quint32, quint32>> _verticalIndex;
34 
35 };
36 
37 typedef std::unique_ptr<AttributeRecord> UPAttributeRecord;
38 }
39 
40 #endif // ATTRIBUTETABLE_H