13#ifndef OGRMUTEXEDDATASOURCELAYER_H_INCLUDED
14#define OGRMUTEXEDDATASOURCELAYER_H_INCLUDED
19#include "cpl_multiproc.h"
20#include "ogrmutexedlayer.h"
30class CPL_DLL OGRMutexedDataSource final :
public GDALDataset
35 GDALDataset *m_poBaseDataSource =
nullptr;
36 int m_bHasOwnership =
false;
37 CPLMutex *m_hGlobalMutex =
nullptr;
38 int m_bWrapLayersInMutexedLayer =
false;
39 std::map<OGRLayer *, OGRMutexedLayer *> m_oMapLayers{};
40 std::map<OGRMutexedLayer *, OGRLayer *> m_oReverseMapLayers{};
42 OGRLayer *WrapLayerIfNecessary(OGRLayer *poLayer);
46 OGRMutexedDataSource(GDALDataset *poBaseDataSource,
int bTakeOwnership,
47 CPLMutex *hMutexIn,
int bWrapLayersInMutexedLayer);
50 ~OGRMutexedDataSource()
override;
52 GDALDataset *GetBaseDataSource()
54 return m_poBaseDataSource;
59 const OGRLayer *
GetLayer(
int)
const override;
67 const OGRGeomFieldDefn *poGeomFieldDefn,
69 virtual OGRLayer *
CopyLayer(OGRLayer *poSrcLayer,
const char *pszNewName,
70 char **papszOptions =
nullptr)
override;
77 OGRLayer *
ExecuteSQL(
const char *pszStatement, OGRGeometry *poSpatialFilter,
78 const char *pszDialect)
override;
87 char **
GetMetadata(
const char *pszDomain =
"")
override;
89 const char *pszDomain =
"")
override;
91 const char *pszDomain =
"")
override;
93 const char *pszDomain =
"")
override;
95 virtual std::vector<std::string>
97 virtual const OGRFieldDomain *
100 virtual bool AddFieldDomain(std::unique_ptr<OGRFieldDomain> &&domain,
101 std::string &failureReason)
override;
103 std::string &failureReason)
override;
105 std::string &failureReason)
override;
107 std::vector<std::string>
110 const GDALRelationship *
113 std::shared_ptr<GDALGroup>
GetRootGroup()
const override;
A set of associated raster bands, usually from one file.
Definition gdal_dataset.h:76
virtual bool IsLayerPrivate(int iLayer) const
Returns true if the layer at the specified index is deemed a private or system table,...
Definition gdaldataset.cpp:7906
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set dataset style table.
Definition gdaldataset.cpp:7770
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain) override
Set single metadata item.
virtual bool UpdateFieldDomain(std::unique_ptr< OGRFieldDomain > &&domain, std::string &failureReason)
Updates an existing field domain by replacing its definition.
Definition gdaldataset.cpp:10075
virtual const OGRLayer * GetLayer(int iLayer) const
Fetch a layer by index.
Definition gdaldataset.cpp:7864
virtual OGRStyleTable * GetStyleTable()
Returns dataset style table.
Definition gdaldataset.cpp:7749
virtual const GDALRelationship * GetRelationship(const std::string &name) const
Get a relationship from its name.
Definition gdaldataset.cpp:10187
virtual OGRLayer * GetLayerByName(const char *)
Fetch a layer by name.
Definition gdaldataset.cpp:6382
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set dataset style table.
Definition gdaldataset.cpp:7794
virtual OGRLayer * ExecuteSQL(const char *pszStatement, OGRGeometry *poSpatialFilter, const char *pszDialect)
Execute an SQL statement against the data store.
Definition gdaldataset.cpp:7139
virtual const OGRFieldDomain * GetFieldDomain(const std::string &name) const
Get a field domain from its name.
Definition gdaldataset.cpp:9870
virtual OGRErr RollbackTransaction()
For datasources which support transactions, RollbackTransaction will roll back a datasource to its st...
Definition gdaldataset.cpp:8503
virtual OGRLayer * ICreateLayer(const char *pszName, const OGRGeomFieldDefn *poGeomFieldDefn, CSLConstList papszOptions)
This method attempts to create a new layer on the dataset with the indicated name,...
Definition gdaldataset.cpp:5978
virtual CPLErr FlushCache(bool bAtClosing=false)
Flush all write cached data to disk.
Definition gdaldataset.cpp:600
virtual void ReleaseResultSet(OGRLayer *poResultsSet)
Release results of ExecuteSQL().
Definition gdaldataset.cpp:7729
virtual bool AddFieldDomain(std::unique_ptr< OGRFieldDomain > &&domain, std::string &failureReason)
Add a field domain to the dataset.
Definition gdaldataset.cpp:9926
CPLErr SetMetadata(char **papszMetadata, const char *pszDomain) override
Set metadata.
void static void char ** GetMetadata(const char *pszDomain="") override
Fetch metadata.
Definition gdaldataset.cpp:4951
virtual int TestCapability(const char *) const
Test if capability is available.
Definition gdaldataset.cpp:8241
virtual int GetLayerCount() const
Get the number of layers in this dataset.
Definition gdaldataset.cpp:7831
virtual std::shared_ptr< GDALGroup > GetRootGroup() const
Return the root GDALGroup of this dataset.
Definition gdaldataset.cpp:9736
virtual std::vector< std::string > GetRelationshipNames(CSLConstList papszOptions=nullptr) const
Returns a list of the names of all relationships stored in the dataset.
Definition gdaldataset.cpp:10143
virtual OGRErr DeleteLayer(int iLayer)
Delete the indicated layer from the datasource.
Definition gdaldataset.cpp:6355
virtual OGRErr CommitTransaction()
For datasources which support transactions, CommitTransaction commits a transaction.
Definition gdaldataset.cpp:8450
virtual OGRErr StartTransaction(int bForce=FALSE)
For datasources which support transactions, StartTransaction creates a `transaction.
virtual std::vector< std::string > GetFieldDomainNames(CSLConstList papszOptions=nullptr) const
Returns a list of the names of all field domains stored in the dataset.
Definition gdaldataset.cpp:9820
virtual bool DeleteFieldDomain(const std::string &name, std::string &failureReason)
Removes a field domain from the dataset.
Definition gdaldataset.cpp:10005
virtual OGRLayer * CopyLayer(OGRLayer *poSrcLayer, const char *pszNewName, char **papszOptions=nullptr)
Duplicate an existing layer.
Definition gdaldataset.cpp:6018
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition gdalmajorobject.cpp:322
CPLErr
Error category.
Definition cpl_error.h:37
#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
char ** CSLConstList
Type of a constant null-terminated list of nul terminated strings.
Definition cpl_port.h:1087
int OGRErr
Type for a OGR error.
Definition ogr_core.h:370
Classes related to registration of format support, and opening datasets.