GDAL
ogrmutexedlayer.h
1 /******************************************************************************
2  * $Id: ogrmutexedlayer.h 28601 2015-03-03 11:06:40Z 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 #include "cpl_multiproc.h"
35 
43 class CPL_DLL OGRMutexedLayer : public OGRLayerDecorator
44 {
45  protected:
46  CPLMutex *m_hMutex;
47 
48  public:
49 
50  /* The construction of the object isn't protected by the mutex */
51  OGRMutexedLayer(OGRLayer* poDecoratedLayer,
52  int bTakeOwnership,
53  CPLMutex* hMutex);
54 
55  /* The destruction of the object isn't protected by the mutex */
56  virtual ~OGRMutexedLayer();
57 
58  virtual OGRGeometry *GetSpatialFilter();
59  virtual void SetSpatialFilter( OGRGeometry * );
60  virtual void SetSpatialFilterRect( double dfMinX, double dfMinY,
61  double dfMaxX, double dfMaxY );
62  virtual void SetSpatialFilter( int iGeomField, OGRGeometry * );
63  virtual void SetSpatialFilterRect( int iGeomField, double dfMinX, double dfMinY,
64  double dfMaxX, double dfMaxY );
65 
66  virtual OGRErr SetAttributeFilter( const char * );
67 
68  virtual void ResetReading();
69  virtual OGRFeature *GetNextFeature();
70  virtual OGRErr SetNextByIndex( GIntBig nIndex );
71  virtual OGRFeature *GetFeature( GIntBig nFID );
72  virtual OGRErr ISetFeature( OGRFeature *poFeature );
73  virtual OGRErr ICreateFeature( OGRFeature *poFeature );
74  virtual OGRErr DeleteFeature( GIntBig nFID );
75 
76  virtual const char *GetName();
78  virtual OGRFeatureDefn *GetLayerDefn();
79 
81 
82  virtual GIntBig GetFeatureCount( int bForce = TRUE );
83  virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce = TRUE);
84  virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE);
85 
86  virtual int TestCapability( const char * );
87 
88  virtual OGRErr CreateField( OGRFieldDefn *poField,
89  int bApproxOK = TRUE );
90  virtual OGRErr DeleteField( int iField );
91  virtual OGRErr ReorderFields( int* panMap );
92  virtual OGRErr AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlags );
93 
94  virtual OGRErr SyncToDisk();
95 
96  virtual OGRStyleTable *GetStyleTable();
97  virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
98 
99  virtual void SetStyleTable(OGRStyleTable *poStyleTable);
100 
101  virtual OGRErr StartTransaction();
102  virtual OGRErr CommitTransaction();
103  virtual OGRErr RollbackTransaction();
104 
105  virtual const char *GetFIDColumn();
106  virtual const char *GetGeometryColumn();
107 
108  virtual OGRErr SetIgnoredFields( const char **papszFields );
109 
110  virtual char **GetMetadata( const char * pszDomain = "" );
111  virtual CPLErr SetMetadata( char ** papszMetadata,
112  const char * pszDomain = "" );
113  virtual const char *GetMetadataItem( const char * pszName,
114  const char * pszDomain = "" );
115  virtual CPLErr SetMetadataItem( const char * pszName,
116  const char * pszValue,
117  const char * pszDomain = "" );
118 };
119 
120 #endif // _OGRMUTEXEDLAYER_H_INCLUDED
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition: ogrlayerdecorator.cpp:68
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: ogrlayerdecorator.cpp:263
virtual void ResetReading()
Reset feature reading to start on the first feature.
Definition: ogrlayerdecorator.cpp:88
virtual OGRErr SetNextByIndex(GIntBig nIndex)
Move read cursor to the nIndex&#39;th feature in the current resultset.
Definition: ogrlayerdecorator.cpp:100
virtual OGRErr DeleteFeature(GIntBig nFID)
Delete feature from layer.
Definition: ogrlayerdecorator.cpp:124
virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, int bForce=TRUE)
Fetch the extent of this layer, on the specified geometry field.
Definition: ogrlayerdecorator.cpp:166
virtual int TestCapability(const char *)
Test if this layer supported the named capability.
Definition: ogrlayerdecorator.cpp:172
virtual OGRSpatialReference * GetSpatialRef()
Fetch the spatial reference system for this layer.
Definition: ogrlayerdecorator.cpp:148
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE)
Create a new field on a layer.
Definition: ogrlayerdecorator.cpp:178
Definition: ogrlayerdecorator.h:35
virtual OGRFeature * GetFeature(GIntBig nFID)
Fetch a feature by its identifier.
Definition: ogrlayerdecorator.cpp:106
Definition of a feature class or feature layer.
Definition: ogr_feature.h:200
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:62
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: ogrlayerdecorator.cpp:276
virtual OGRErr DeleteField(int iField)
Delete an existing field on a layer.
Definition: ogrlayerdecorator.cpp:185
virtual OGRFeatureDefn * GetLayerDefn()
Fetch the schema information for this layer.
Definition: ogrlayerdecorator.cpp:142
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:309
virtual OGRStyleTable * GetStyleTable()
Returns layer style table.
Definition: ogrlayerdecorator.cpp:209
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:104
virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlags)
Alter the definition of an existing field on a layer.
Definition: ogrlayerdecorator.cpp:197
virtual GIntBig GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrlayerdecorator.cpp:154
OGRMutexedLayer class protects all virtual methods of OGRLayer with a mutex.
Definition: ogrmutexedlayer.h:43
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:221
virtual const char * GetGeometryColumn()
This method returns the name of the underlying database column being used as the geometry column...
Definition: ogrlayerdecorator.cpp:251
virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="")
Set single metadata item.
Definition: ogrlayerdecorator.cpp:283
virtual OGRErr ReorderFields(int *panMap)
Reorder all the fields of a layer.
Definition: ogrlayerdecorator.cpp:191
This class respresents a OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:129
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition: ogrlayerdecorator.cpp:269
virtual OGRFeature * GetNextFeature()
Fetch the next available feature from this layer.
Definition: ogrlayerdecorator.cpp:94
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:215
Simple container for a bounding region.
Definition: ogr_core.h:48
virtual OGRErr ICreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition: ogrlayerdecorator.cpp:118
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:66
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:265
This class represents a style table.
Definition: ogr_featurestyle.h:81
virtual OGRwkbGeometryType GetGeomType()
Return the layer geometry type.
Definition: ogrlayerdecorator.cpp:136
virtual OGRErr SetAttributeFilter(const char *)
Set a new attribute query.
Definition: ogrlayerdecorator.cpp:82
virtual OGRGeometry * GetSpatialFilter()
This method returns the current spatial filter for this layer.
Definition: ogrlayerdecorator.cpp:50
virtual OGRErr ISetFeature(OGRFeature *poFeature)
Rewrite an existing feature.
Definition: ogrlayerdecorator.cpp:112
virtual OGRErr SyncToDisk()
Flush pending changes to disk.
Definition: ogrlayerdecorator.cpp:203
virtual const char * GetFIDColumn()
This method returns the name of the underlying database column being used as the FID column...
Definition: ogrlayerdecorator.cpp:245
virtual void SetSpatialFilter(OGRGeometry *)
Set a new spatial filter.
Definition: ogrlayerdecorator.cpp:56
virtual const char * GetName()
Return the layer name.
Definition: ogrlayerdecorator.cpp:130
virtual OGRErr SetIgnoredFields(const char **papszFields)
Set which fields can be omitted when retrieving features from the layer.
Definition: ogrlayerdecorator.cpp:257

Generated for GDAL by doxygen 1.8.11.