OGR
ogrmutexedlayer.h
1 /******************************************************************************
2  * $Id: ogrmutexedlayer.h 27044 2014-03-16 23:41:27Z rouault $
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Defines OGRLMutexedLayer class
6  * Author: Even Rouault, even dot rouault at mines dash paris dot org
7  *
8  ******************************************************************************
9  * Copyright (c) 2013, Even Rouault <even dot rouault at mines-paris dot org>
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 _OGRMUTEXEDLAYER_H_INCLUDED
31 #define _OGRMUTEXEDLAYER_H_INCLUDED
32 
33 #include "ogrlayerdecorator.h"
34 
42 class CPL_DLL OGRMutexedLayer : public OGRLayerDecorator
43 {
44  protected:
45  void *m_hMutex;
46 
47  public:
48 
49  /* The construction of the object isn't protected by the mutex */
50  OGRMutexedLayer(OGRLayer* poDecoratedLayer,
51  int bTakeOwnership,
52  void* hMutex);
53 
54  /* The destruction of the object isn't protected by the mutex */
55  virtual ~OGRMutexedLayer();
56 
57  virtual OGRGeometry *GetSpatialFilter();
58  virtual void SetSpatialFilter( OGRGeometry * );
59  virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
60  double dfMaxX, double dfMaxY );
61  virtual void SetSpatialFilter( int iGeomField, OGRGeometry * );
62  virtual void SetSpatialFilterRect( int iGeomField, double dfMinX, double dfMinY,
63  double dfMaxX, double dfMaxY );
64 
65  virtual OGRErr SetAttributeFilter( const char * );
66 
67  virtual void ResetReading();
68  virtual OGRFeature *GetNextFeature();
69  virtual OGRErr SetNextByIndex( long nIndex );
70  virtual OGRFeature *GetFeature( long nFID );
71  virtual OGRErr SetFeature( OGRFeature *poFeature );
72  virtual OGRErr CreateFeature( OGRFeature *poFeature );
73  virtual OGRErr DeleteFeature( long nFID );
74 
75  virtual const char *GetName();
77  virtual OGRFeatureDefn *GetLayerDefn();
78 
80 
81  virtual int GetFeatureCount( int bForce = TRUE );
82  virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE);
83  virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE);
84 
85  virtual int TestCapability( const char * );
86 
87  /* Deprecated (and un-implemented method) --> we won't decorate it ! */
88  /* virtual const char *GetInfo( const char * ); */
89 
90  virtual OGRErr CreateField( OGRFieldDefn *poField,
91  int bApproxOK = TRUE );
92  virtual OGRErr DeleteField( int iField );
93  virtual OGRErr ReorderFields( int* panMap );
94  virtual OGRErr AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlags );
95 
96  virtual OGRErr SyncToDisk();
97 
98  virtual OGRStyleTable *GetStyleTable();
99  virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
100 
101  virtual void SetStyleTable(OGRStyleTable *poStyleTable);
102 
103  virtual OGRErr StartTransaction();
104  virtual OGRErr CommitTransaction();
105  virtual OGRErr RollbackTransaction();
106 
107  virtual const char *GetFIDColumn();
108  virtual const char *GetGeometryColumn();
109 
110  virtual OGRErr SetIgnoredFields( const char **papszFields );
111 };
112 
113 #endif // _OGRMUTEXEDLAYER_H_INCLUDED
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition: ogrlayerdecorator.cpp:64
virtual void ResetReading()
Reset feature reading to start on the first feature.
Definition: ogrlayerdecorator.cpp:81
virtual OGRErr CreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition: ogrlayerdecorator.cpp:106
virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce=TRUE)
Fetch the extent of this layer, on the specified geometry field.
Definition: ogrlayerdecorator.cpp:146
virtual int TestCapability(const char *)
Test if this layer supported the named capability.
Definition: ogrlayerdecorator.cpp:151
virtual OGRSpatialReference * GetSpatialRef()
Fetch the spatial reference system for this layer.
Definition: ogrlayerdecorator.cpp:131
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE)
Create a new field on a layer.
Definition: ogrlayerdecorator.cpp:156
Definition: ogrlayerdecorator.h:35
virtual OGRFeature * GetFeature(long nFID)
Fetch a feature by its identifier.
Definition: ogrlayerdecorator.cpp:96
Definition: ogr_feature.h:167
virtual OGRErr SetFeature(OGRFeature *poFeature)
Rewrite an existing feature.
Definition: ogrlayerdecorator.cpp:101
Definition: ogr_feature.h:52
virtual OGRErr DeleteField(int iField)
Delete an existing field on a layer.
Definition: ogrlayerdecorator.cpp:162
virtual OGRFeatureDefn * GetLayerDefn()
Fetch the schema information for this layer.
Definition: ogrlayerdecorator.cpp:126
OGRwkbGeometryType
Definition: ogr_core.h:308
virtual OGRErr DeleteFeature(long nFID)
Delete feature from layer.
Definition: ogrlayerdecorator.cpp:111
virtual OGRStyleTable * GetStyleTable()
Returns layer style table.
Definition: ogrlayerdecorator.cpp:182
virtual OGRErr SetNextByIndex(long nIndex)
Move read cursor to the nIndex&#39;th feature in the current resultset.
Definition: ogrlayerdecorator.cpp:91
Definition: ogr_geometry.h:79
virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlags)
Alter the definition of an existing field on a layer.
Definition: ogrlayerdecorator.cpp:172
Definition: ogrmutexedlayer.h:42
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:192
virtual const char * GetGeometryColumn()
This method returns the name of the underlying database column being used as the geometry column...
Definition: ogrlayerdecorator.cpp:217
virtual OGRErr ReorderFields(int *panMap)
Reorder all the fields of a layer.
Definition: ogrlayerdecorator.cpp:167
Definition: ogr_spatialref.h:129
virtual OGRFeature * GetNextFeature()
Fetch the next available feature from this layer.
Definition: ogrlayerdecorator.cpp:86
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:187
Definition: ogr_core.h:48
Definition: ogrsf_frmts.h:59
Definition: ogr_feature.h:232
Definition: ogr_featurestyle.h:81
virtual OGRwkbGeometryType GetGeomType()
Return the layer geometry type.
Definition: ogrlayerdecorator.cpp:121
virtual OGRErr SetAttributeFilter(const char *)
Set a new attribute query.
Definition: ogrlayerdecorator.cpp:76
virtual int GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrlayerdecorator.cpp:136
virtual OGRGeometry * GetSpatialFilter()
This method returns the current spatial filter for this layer.
Definition: ogrlayerdecorator.cpp:49
virtual OGRErr SyncToDisk()
Flush pending changes to disk.
Definition: ogrlayerdecorator.cpp:177
virtual const char * GetFIDColumn()
This method returns the name of the underlying database column being used as the FID column...
Definition: ogrlayerdecorator.cpp:212
virtual void SetSpatialFilter(OGRGeometry *)
Set a new spatial filter.
Definition: ogrlayerdecorator.cpp:54
virtual const char * GetName()
Return the layer name.
Definition: ogrlayerdecorator.cpp:116
virtual OGRErr SetIgnoredFields(const char **papszFields)
Set which fields can be omitted when retrieving features from the layer.
Definition: ogrlayerdecorator.cpp:222

Generated for GDAL by doxygen 1.8.11.