GDAL

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

ogrmutexedlayer.h
1 /******************************************************************************
2 * $Id: ogrmutexedlayer.h 31812 2015-11-28 22:37:37Z goatbar $
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();
77 virtual OGRwkbGeometryType GetGeomType();
78 virtual OGRFeatureDefn *GetLayerDefn();
79
80 virtual OGRSpatialReference *GetSpatialRef();
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
OGRLayerDecorator::SetSpatialFilterRect
virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, double dfMaxX, double dfMaxY)
Set a new rectangular spatial filter.
Definition: ogrlayerdecorator.cpp:68
OGRLayerDecorator::GetMetadata
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: ogrlayerdecorator.cpp:270
OGRLayerDecorator::ResetReading
virtual void ResetReading()
Reset feature reading to start on the first feature.
Definition: ogrlayerdecorator.cpp:88
OGRLayerDecorator::SetNextByIndex
virtual OGRErr SetNextByIndex(GIntBig nIndex)
Move read cursor to the nIndex'th feature in the current resultset.
Definition: ogrlayerdecorator.cpp:100
OGRLayerDecorator::DeleteFeature
virtual OGRErr DeleteFeature(GIntBig nFID)
Delete feature from layer.
Definition: ogrlayerdecorator.cpp:124
OGRLayerDecorator::GetExtent
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
OGRLayerDecorator::TestCapability
virtual int TestCapability(const char *)
Test if this layer supported the named capability.
Definition: ogrlayerdecorator.cpp:172
OGRLayerDecorator::GetSpatialRef
virtual OGRSpatialReference * GetSpatialRef()
Fetch the spatial reference system for this layer.
Definition: ogrlayerdecorator.cpp:148
OGRLayerDecorator::CreateField
virtual OGRErr CreateField(OGRFieldDefn *poField, int bApproxOK=TRUE)
Create a new field on a layer.
Definition: ogrlayerdecorator.cpp:178
OGRLayerDecorator
Definition: ogrlayerdecorator.h:35
OGRLayerDecorator::GetFeature
virtual OGRFeature * GetFeature(GIntBig nFID)
Fetch a feature by its identifier.
Definition: ogrlayerdecorator.cpp:106
OGRFeatureDefn
Definition of a feature class or feature layer.
Definition: ogr_feature.h:206
OGRFieldDefn
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:62
OGRLayerDecorator::GetMetadataItem
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: ogrlayerdecorator.cpp:283
OGRLayerDecorator::DeleteField
virtual OGRErr DeleteField(int iField)
Delete an existing field on a layer.
Definition: ogrlayerdecorator.cpp:185
OGRLayerDecorator::GetLayerDefn
virtual OGRFeatureDefn * GetLayerDefn()
Fetch the schema information for this layer.
Definition: ogrlayerdecorator.cpp:142
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:333
OGRLayerDecorator::GetStyleTable
virtual OGRStyleTable * GetStyleTable()
Returns layer style table.
Definition: ogrlayerdecorator.cpp:216
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:104
OGRLayerDecorator::AlterFieldDefn
virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, int nFlags)
Alter the definition of an existing field on a layer.
Definition: ogrlayerdecorator.cpp:197
OGRLayerDecorator::GetFeatureCount
virtual GIntBig GetFeatureCount(int bForce=TRUE)
Fetch the feature count in this layer.
Definition: ogrlayerdecorator.cpp:154
OGRMutexedLayer
OGRMutexedLayer class protects all virtual methods of OGRLayer with a mutex.
Definition: ogrmutexedlayer.h:43
OGRLayerDecorator::SetStyleTable
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:228
OGRLayerDecorator::GetGeometryColumn
virtual const char * GetGeometryColumn()
This method returns the name of the underlying database column being used as the geometry column...
Definition: ogrlayerdecorator.cpp:258
OGRLayerDecorator::SetMetadataItem
virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="")
Set single metadata item.
Definition: ogrlayerdecorator.cpp:290
OGRLayerDecorator::ReorderFields
virtual OGRErr ReorderFields(int *panMap)
Reorder all the fields of a layer.
Definition: ogrlayerdecorator.cpp:191
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:129
OGRLayerDecorator::SetMetadata
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition: ogrlayerdecorator.cpp:276
OGRLayerDecorator::GetNextFeature
virtual OGRFeature * GetNextFeature()
Fetch the next available feature from this layer.
Definition: ogrlayerdecorator.cpp:94
OGRLayerDecorator::SetStyleTableDirectly
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set layer style table.
Definition: ogrlayerdecorator.cpp:222
OGREnvelope
Simple container for a bounding region.
Definition: ogr_core.h:48
OGRLayerDecorator::ICreateFeature
virtual OGRErr ICreateFeature(OGRFeature *poFeature)
Create and write a new feature within a layer.
Definition: ogrlayerdecorator.cpp:118
OGRLayer
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:66
OGRFeature
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:274
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:82
OGRLayerDecorator::GetGeomType
virtual OGRwkbGeometryType GetGeomType()
Return the layer geometry type.
Definition: ogrlayerdecorator.cpp:136
OGRLayerDecorator::SetAttributeFilter
virtual OGRErr SetAttributeFilter(const char *)
Set a new attribute query.
Definition: ogrlayerdecorator.cpp:82
OGRLayerDecorator::GetSpatialFilter
virtual OGRGeometry * GetSpatialFilter()
This method returns the current spatial filter for this layer.
Definition: ogrlayerdecorator.cpp:50
OGRLayerDecorator::ISetFeature
virtual OGRErr ISetFeature(OGRFeature *poFeature)
Rewrite an existing feature.
Definition: ogrlayerdecorator.cpp:112
OGRLayerDecorator::SyncToDisk
virtual OGRErr SyncToDisk()
Flush pending changes to disk.
Definition: ogrlayerdecorator.cpp:210
OGRLayerDecorator::GetFIDColumn
virtual const char * GetFIDColumn()
This method returns the name of the underlying database column being used as the FID column...
Definition: ogrlayerdecorator.cpp:252
OGRLayerDecorator::SetSpatialFilter
virtual void SetSpatialFilter(OGRGeometry *)
Set a new spatial filter.
Definition: ogrlayerdecorator.cpp:56
OGRLayerDecorator::GetName
virtual const char * GetName()
Return the layer name.
Definition: ogrlayerdecorator.cpp:130
OGRLayerDecorator::SetIgnoredFields
virtual OGRErr SetIgnoredFields(const char **papszFields)
Set which fields can be omitted when retrieving features from the layer.
Definition: ogrlayerdecorator.cpp:264

Generated for GDAL by 1.8.8.