OGR
ogr_attrind.h
1/******************************************************************************
2 * $Id$
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Classes related to generic implementation of attribute indexing.
6 * Author: Frank Warmerdam, warmerdam@pobox.com
7 *
8 ******************************************************************************
9 * Copyright (c) 2003, Frank Warmerdam <warmerdam@pobox.com>
10 *
11 * Permission is hereby granted, free of charge, to any person obtaining a
12 * copy of this software and associated documentation files (the "Software"),
13 * to deal in the Software without restriction, including without limitation
14 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
15 * and/or sell copies of the Software, and to permit persons to whom the
16 * Software is furnished to do so, subject to the following conditions:
17 *
18 * The above copyright notice and this permission notice shall be included
19 * in all copies or substantial portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
22 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
24 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
26 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
27 * DEALINGS IN THE SOFTWARE.
28 ****************************************************************************/
29
30#ifndef OGR_ATTRIND_H_INCLUDED
31#define OGR_ATTRIND_H_INCLUDED
32
33#include "ogrsf_frmts.h"
34
36
37/************************************************************************/
38/* OGRAttrIndex */
39/* */
40/* Base class for accessing the indexing info about one field. */
41/************************************************************************/
42
43class CPL_DLL OGRAttrIndex
44{
45protected:
46 OGRAttrIndex();
47
48public:
49 virtual ~OGRAttrIndex();
50
51 virtual GIntBig GetFirstMatch( OGRField *psKey ) = 0;
52 virtual GIntBig *GetAllMatches( OGRField *psKey ) = 0;
53 virtual GIntBig *GetAllMatches( OGRField *psKey, GIntBig* panFIDList, int* nFIDCount, int* nLength ) = 0;
54
55 virtual OGRErr AddEntry( OGRField *psKey, GIntBig nFID ) = 0;
56 virtual OGRErr RemoveEntry( OGRField *psKey, GIntBig nFID ) = 0;
57
58 virtual OGRErr Clear() = 0;
59};
60
61/************************************************************************/
62/* OGRLayerAttrIndex */
63/* */
64/* Base class representing attribute indexes for all indexed */
65/* fields in a layer. */
66/************************************************************************/
67
68class CPL_DLL OGRLayerAttrIndex
69{
70protected:
71 OGRLayer *poLayer;
72 char *pszIndexPath;
73
74 OGRLayerAttrIndex();
75
76public:
77 virtual ~OGRLayerAttrIndex();
78
79 virtual OGRErr Initialize( const char *pszIndexPath, OGRLayer * ) = 0;
80
81 virtual OGRErr CreateIndex( int iField ) = 0;
82 virtual OGRErr DropIndex( int iField ) = 0;
83 virtual OGRErr IndexAllFeatures( int iField = -1 ) = 0;
84
85 virtual OGRErr AddToIndex( OGRFeature *poFeature, int iField = -1 ) = 0;
86 virtual OGRErr RemoveFromIndex( OGRFeature *poFeature ) = 0;
87
88 virtual OGRAttrIndex *GetFieldIndex( int iField ) = 0;
89};
90
91OGRLayerAttrIndex CPL_DLL *OGRCreateDefaultLayerIndex();
92
94
95#endif /* ndef OGR_ATTRIND_H_INCLUDED */
96
Definition: ogr_feature.h:354
Definition: ogrsf_frmts.h:71
long long GIntBig
Definition: cpl_port.h:246
int OGRErr
Definition: ogr_core.h:290
Definition: ogr_core.h:679

Generated for GDAL by doxygen 1.9.3.