OGR
ogr_attrind.h
1 /******************************************************************************
2  * $Id: ogr_attrind.h 20101 2010-07-18 15:20:35Z tamas $
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 
35 /************************************************************************/
36 /* OGRAttrIndex */
37 /* */
38 /* Base class for accessing the indexing info about one field. */
39 /************************************************************************/
40 
41 class CPL_DLL OGRAttrIndex
42 {
43 protected:
44  OGRAttrIndex();
45 
46 public:
47  virtual ~OGRAttrIndex();
48 
49  virtual long GetFirstMatch( OGRField *psKey ) = 0;
50  virtual long *GetAllMatches( OGRField *psKey ) = 0;
51  virtual long *GetAllMatches( OGRField *psKey, long* panFIDList, int* nFIDCount, int* nLength ) = 0;
52 
53  virtual OGRErr AddEntry( OGRField *psKey, long nFID ) = 0;
54  virtual OGRErr RemoveEntry( OGRField *psKey, long nFID ) = 0;
55 
56  virtual OGRErr Clear() = 0;
57 };
58 
59 /************************************************************************/
60 /* OGRLayerAttrIndex */
61 /* */
62 /* Base class representing attribute indexes for all indexed */
63 /* fields in a layer. */
64 /************************************************************************/
65 
66 class CPL_DLL OGRLayerAttrIndex
67 {
68 protected:
69  OGRLayer *poLayer;
70  char *pszIndexPath;
71 
73 
74 public:
75  virtual ~OGRLayerAttrIndex();
76 
77  virtual OGRErr Initialize( const char *pszIndexPath, OGRLayer * ) = 0;
78 
79  virtual OGRErr CreateIndex( int iField ) = 0;
80  virtual OGRErr DropIndex( int iField ) = 0;
81  virtual OGRErr IndexAllFeatures( int iField = -1 ) = 0;
82 
83  virtual OGRErr AddToIndex( OGRFeature *poFeature, int iField = -1 ) = 0;
84  virtual OGRErr RemoveFromIndex( OGRFeature *poFeature ) = 0;
85 
86  virtual OGRAttrIndex *GetFieldIndex( int iField ) = 0;
87 };
88 
89 OGRLayerAttrIndex CPL_DLL *OGRCreateDefaultLayerIndex();
90 
91 
92 #endif /* ndef _OGR_ATTRIND_H_INCLUDED */
93 
Definition: ogr_attrind.h:41
Definition: ogr_core.h:427
Definition: ogrsf_frmts.h:59
Definition: ogr_feature.h:232
Definition: ogr_attrind.h:66

Generated for GDAL by doxygen 1.8.11.