GDAL

ogrmutexedlayer.h
1/******************************************************************************
2 * $Id$
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Defines OGRLMutexedLayer class
6 * Author: Even Rouault, even dot rouault at spatialys.com
7 *
8 ******************************************************************************
9 * Copyright (c) 2013, Even Rouault <even dot rouault at spatialys.com>
10 *
11 * SPDX-License-Identifier: MIT
12 ****************************************************************************/
13
14#ifndef OGRMUTEXEDLAYER_H_INCLUDED
15#define OGRMUTEXEDLAYER_H_INCLUDED
16
17#ifndef DOXYGEN_SKIP
18
19#include "ogrlayerdecorator.h"
20#include "cpl_multiproc.h"
21
29 class CPL_DLL OGRMutexedLayer : public OGRLayerDecorator
30{
31 CPL_DISALLOW_COPY_ASSIGN(OGRMutexedLayer)
32
33 protected:
34 CPLMutex *m_hMutex;
35
36 public:
37 /* The construction of the object isn't protected by the mutex */
38 OGRMutexedLayer(OGRLayer *poDecoratedLayer, int bTakeOwnership,
39 CPLMutex *hMutex);
40
41 /* The destruction of the object isn't protected by the mutex */
42 virtual ~OGRMutexedLayer();
43
44 virtual OGRGeometry *GetSpatialFilter() override;
45 virtual void SetSpatialFilter(OGRGeometry *) override;
46 virtual void SetSpatialFilterRect(double dfMinX, double dfMinY,
47 double dfMaxX, double dfMaxY) override;
48 virtual void SetSpatialFilter(int iGeomField, OGRGeometry *) override;
49 virtual void SetSpatialFilterRect(int iGeomField, double dfMinX,
50 double dfMinY, double dfMaxX,
51 double dfMaxY) override;
52
53 virtual OGRErr SetAttributeFilter(const char *) override;
54
55 virtual void ResetReading() override;
56 virtual OGRFeature *GetNextFeature() override;
57 virtual OGRErr SetNextByIndex(GIntBig nIndex) override;
58 virtual OGRFeature *GetFeature(GIntBig nFID) override;
59 virtual OGRErr ISetFeature(OGRFeature *poFeature) override;
60 virtual OGRErr ICreateFeature(OGRFeature *poFeature) override;
61 virtual OGRErr IUpsertFeature(OGRFeature *poFeature) override;
62 OGRErr IUpdateFeature(OGRFeature *poFeature, int nUpdatedFieldsCount,
63 const int *panUpdatedFieldsIdx,
64 int nUpdatedGeomFieldsCount,
65 const int *panUpdatedGeomFieldsIdx,
66 bool bUpdateStyleString) override;
67 virtual OGRErr DeleteFeature(GIntBig nFID) override;
68
69 virtual GDALDataset *GetDataset() override;
70 virtual bool GetArrowStream(struct ArrowArrayStream *out_stream,
71 CSLConstList papszOptions = nullptr) override;
72
73 virtual const char *GetName() override;
74 virtual OGRwkbGeometryType GetGeomType() override;
75 virtual OGRFeatureDefn *GetLayerDefn() override;
76
77 virtual OGRSpatialReference *GetSpatialRef() override;
78
79 virtual GIntBig GetFeatureCount(int bForce = TRUE) override;
80 virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent,
81 int bForce = TRUE) override;
82 virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override;
83
84 virtual int TestCapability(const char *) override;
85
86 virtual OGRErr CreateField(const OGRFieldDefn *poField,
87 int bApproxOK = TRUE) override;
88 virtual OGRErr DeleteField(int iField) override;
89 virtual OGRErr ReorderFields(int *panMap) override;
90 virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn,
91 int nFlags) override;
92 virtual OGRErr
93 AlterGeomFieldDefn(int iGeomField,
94 const OGRGeomFieldDefn *poNewGeomFieldDefn,
95 int nFlags) override;
96
97 virtual OGRErr SyncToDisk() override;
98
99 virtual OGRStyleTable *GetStyleTable() override;
100 virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable) override;
101
102 virtual void SetStyleTable(OGRStyleTable *poStyleTable) override;
103
104 virtual OGRErr StartTransaction() override;
105 virtual OGRErr CommitTransaction() override;
106 virtual OGRErr RollbackTransaction() override;
107
108 virtual const char *GetFIDColumn() override;
109 virtual const char *GetGeometryColumn() override;
110
111 virtual OGRErr SetIgnoredFields(CSLConstList papszFields) override;
112
113 virtual char **GetMetadata(const char *pszDomain = "") override;
114 virtual CPLErr SetMetadata(char **papszMetadata,
115 const char *pszDomain = "") override;
116 virtual const char *GetMetadataItem(const char *pszName,
117 const char *pszDomain = "") override;
118 virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue,
119 const char *pszDomain = "") override;
120 virtual OGRErr Rename(const char *pszNewName) override;
121};
122
123#endif /* #ifndef DOXYGEN_SKIP */
124
125#endif // OGRMUTEXEDLAYER_H_INCLUDED
GDALDataset
A set of associated raster bands, usually from one file.
Definition: gdal_priv.h:495
OGREnvelope
Simple container for a bounding region (rectangle)
Definition: ogr_core.h:45
OGRFeatureDefn
Definition of a feature class or feature layer.
Definition: ogr_feature.h:501
OGRFeature
A simple feature, including geometry and attributes.
Definition: ogr_feature.h:877
OGRFieldDefn
Definition of an attribute of an OGRFeatureDefn.
Definition: ogr_feature.h:95
OGRGeomFieldDefn
Definition of a geometry field of an OGRFeatureDefn.
Definition: ogr_feature.h:330
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:361
OGRLayer
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:58
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:153
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:70
CPLErr
CPLErr
Error category.
Definition: cpl_error.h:37
CPL_DISALLOW_COPY_ASSIGN
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition: cpl_port.h:1030
CSLConstList
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition: cpl_port.h:1179
GIntBig
long long GIntBig
Large signed integer type (generally 64-bit integer type).
Definition: cpl_port.h:199
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:407
OGRErr
int OGRErr
Type for a OGR error.
Definition: ogr_core.h:371