GDAL

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