Line data Source code
1 : /****************************************************************************** 2 : * 3 : * Project: OpenGIS Simple Features Reference Implementation 4 : * Purpose: Defines OGRLayerDecorator class 5 : * Author: Even Rouault, even dot rouault at spatialys.com 6 : * 7 : ****************************************************************************** 8 : * Copyright (c) 2012-2013, Even Rouault <even dot rouault at spatialys.com> 9 : * 10 : * SPDX-License-Identifier: MIT 11 : ****************************************************************************/ 12 : 13 : #ifndef OGRLAYERDECORATOR_H_INCLUDED 14 : #define OGRLAYERDECORATOR_H_INCLUDED 15 : 16 : #ifndef DOXYGEN_SKIP 17 : 18 : #include "ogrsf_frmts.h" 19 : 20 : class CPL_DLL OGRLayerDecorator : public OGRLayer 21 : { 22 : CPL_DISALLOW_COPY_ASSIGN(OGRLayerDecorator) 23 : 24 : protected: 25 : OGRLayer *m_poDecoratedLayer; 26 : int m_bHasOwnership; 27 : 28 : public: 29 : OGRLayerDecorator(OGRLayer *poDecoratedLayer, int bTakeOwnership); 30 : virtual ~OGRLayerDecorator(); 31 : 32 : virtual OGRGeometry *GetSpatialFilter() override; 33 : virtual void SetSpatialFilter(OGRGeometry *) override; 34 : virtual void SetSpatialFilterRect(double dfMinX, double dfMinY, 35 : double dfMaxX, double dfMaxY) override; 36 : virtual void SetSpatialFilter(int iGeomField, OGRGeometry *) override; 37 : virtual void SetSpatialFilterRect(int iGeomField, double dfMinX, 38 : double dfMinY, double dfMaxX, 39 : double dfMaxY) override; 40 : 41 : virtual OGRErr SetAttributeFilter(const char *) override; 42 : 43 : virtual void ResetReading() override; 44 : virtual OGRFeature *GetNextFeature() override; 45 : virtual OGRErr SetNextByIndex(GIntBig nIndex) override; 46 : virtual OGRFeature *GetFeature(GIntBig nFID) override; 47 : virtual OGRErr ISetFeature(OGRFeature *poFeature) override; 48 : virtual OGRErr ICreateFeature(OGRFeature *poFeature) override; 49 : virtual OGRErr IUpsertFeature(OGRFeature *poFeature) override; 50 : virtual OGRErr DeleteFeature(GIntBig nFID) override; 51 : OGRErr IUpdateFeature(OGRFeature *poFeature, int nUpdatedFieldsCount, 52 : const int *panUpdatedFieldsIdx, 53 : int nUpdatedGeomFieldsCount, 54 : const int *panUpdatedGeomFieldsIdx, 55 : bool bUpdateStyleString) override; 56 : 57 : virtual GDALDataset *GetDataset() override; 58 : virtual bool GetArrowStream(struct ArrowArrayStream *out_stream, 59 : CSLConstList papszOptions = nullptr) override; 60 : 61 : virtual const char *GetName() override; 62 : virtual OGRwkbGeometryType GetGeomType() override; 63 : virtual OGRFeatureDefn *GetLayerDefn() override; 64 : 65 : virtual OGRSpatialReference *GetSpatialRef() override; 66 : 67 : virtual GIntBig GetFeatureCount(int bForce = TRUE) override; 68 : virtual OGRErr GetExtent(int iGeomField, OGREnvelope *psExtent, 69 : int bForce = TRUE) override; 70 : virtual OGRErr GetExtent(OGREnvelope *psExtent, int bForce = TRUE) override; 71 : 72 : virtual int TestCapability(const char *) override; 73 : 74 : virtual OGRErr CreateField(const OGRFieldDefn *poField, 75 : int bApproxOK = TRUE) override; 76 : virtual OGRErr DeleteField(int iField) override; 77 : virtual OGRErr ReorderFields(int *panMap) override; 78 : virtual OGRErr AlterFieldDefn(int iField, OGRFieldDefn *poNewFieldDefn, 79 : int nFlags) override; 80 : virtual OGRErr 81 : AlterGeomFieldDefn(int iGeomField, 82 : const OGRGeomFieldDefn *poNewGeomFieldDefn, 83 : int nFlags) override; 84 : 85 : virtual OGRErr CreateGeomField(const OGRGeomFieldDefn *poField, 86 : int bApproxOK = TRUE) override; 87 : 88 : virtual OGRErr SyncToDisk() override; 89 : 90 : virtual OGRStyleTable *GetStyleTable() override; 91 : virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable) override; 92 : 93 : virtual void SetStyleTable(OGRStyleTable *poStyleTable) override; 94 : 95 : virtual OGRErr StartTransaction() override; 96 : virtual OGRErr CommitTransaction() override; 97 : virtual OGRErr RollbackTransaction() override; 98 : 99 : virtual const char *GetFIDColumn() override; 100 : virtual const char *GetGeometryColumn() override; 101 : 102 : virtual OGRErr SetIgnoredFields(CSLConstList papszFields) override; 103 : 104 : virtual char **GetMetadata(const char *pszDomain = "") override; 105 : virtual CPLErr SetMetadata(char **papszMetadata, 106 : const char *pszDomain = "") override; 107 : virtual const char *GetMetadataItem(const char *pszName, 108 : const char *pszDomain = "") override; 109 : virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, 110 : const char *pszDomain = "") override; 111 : virtual OGRErr Rename(const char *pszNewName) override; 112 : 113 347 : OGRLayer *GetBaseLayer() const 114 : { 115 347 : return m_poDecoratedLayer; 116 : } 117 : }; 118 : 119 : #endif /* #ifndef DOXYGEN_SKIP */ 120 : 121 : #endif // OGRLAYERDECORATOR_H_INCLUDED