GDAL

- Main Page
- Related Pages
- Classes
- Files

- File List
- File Members

ogrmutexeddatasource.h
1 /******************************************************************************
2 * $Id: ogrmutexeddatasource.h 33714 2016-03-13 05:42:13Z goatbar $
3 *
4 * Project: OpenGIS Simple Features Reference Implementation
5 * Purpose: Defines OGRLMutexedDataSource 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 OGRMUTEXEDDATASOURCELAYER_H_INCLUDED
31 #define OGRMUTEXEDDATASOURCELAYER_H_INCLUDED
32
33 #include "ogrsf_frmts.h"
34 #include "cpl_multiproc.h"
35 #include "ogrmutexedlayer.h"
36 #include <map>
37
45 class CPL_DLL OGRMutexedDataSource : public OGRDataSource
46 {
47 protected:
48 OGRDataSource *m_poBaseDataSource;
49 int m_bHasOwnership;
50 CPLMutex *m_hGlobalMutex;
51 int m_bWrapLayersInMutexedLayer;
52 std::map<OGRLayer*, OGRMutexedLayer* > m_oMapLayers;
53 std::map<OGRMutexedLayer*, OGRLayer* > m_oReverseMapLayers;
54
55 OGRLayer* WrapLayerIfNecessary(OGRLayer* poLayer);
56
57 public:
58
59 /* The construction of the object isn't protected by the mutex */
60 OGRMutexedDataSource(OGRDataSource* poBaseDataSource,
61 int bTakeOwnership,
62 CPLMutex* hMutexIn,
63 int bWrapLayersInMutexedLayer);
64
65 /* The destruction of the object isn't protected by the mutex */
66 virtual ~OGRMutexedDataSource();
67
68 OGRDataSource* GetBaseDataSource() { return m_poBaseDataSource; }
69
70 virtual const char *GetName();
71
72 virtual int GetLayerCount() ;
73 virtual OGRLayer *GetLayer(int);
74 virtual OGRLayer *GetLayerByName(const char *);
75 virtual OGRErr DeleteLayer(int);
76
77 virtual int TestCapability( const char * );
78
79 virtual OGRLayer *ICreateLayer( const char *pszName,
80 OGRSpatialReference *poSpatialRef = NULL,
81 OGRwkbGeometryType eGType = wkbUnknown,
82 char ** papszOptions = NULL );
83 virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
84 const char *pszNewName,
85 char **papszOptions = NULL );
86
87 virtual OGRStyleTable *GetStyleTable();
88 virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
89
90 virtual void SetStyleTable(OGRStyleTable *poStyleTable);
91
92 virtual OGRLayer * ExecuteSQL( const char *pszStatement,
93 OGRGeometry *poSpatialFilter,
94 const char *pszDialect );
95 virtual void ReleaseResultSet( OGRLayer * poResultsSet );
96
97 virtual void FlushCache();
98
99 virtual OGRErr StartTransaction(int bForce=FALSE);
100 virtual OGRErr CommitTransaction();
101 virtual OGRErr RollbackTransaction();
102
103 virtual char **GetMetadata( const char * pszDomain = "" );
104 virtual CPLErr SetMetadata( char ** papszMetadata,
105 const char * pszDomain = "" );
106 virtual const char *GetMetadataItem( const char * pszName,
107 const char * pszDomain = "" );
108 virtual CPLErr SetMetadataItem( const char * pszName,
109 const char * pszValue,
110 const char * pszDomain = "" );
111 };
112
113 #endif // OGRMUTEXEDDATASOURCELAYER_H_INCLUDED
OGRDataSource
LEGACY class.
Definition: ogrsf_frmts.h:238
GDALDataset::SetStyleTable
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set dataset style table.
Definition: gdaldataset.cpp:5746
GDALDataset::FlushCache
virtual void FlushCache(void)
Flush all write cached data to disk.
Definition: gdaldataset.cpp:374
OGRMutexedDataSource
OGRMutexedDataSource class protects all virtual methods of OGRDataSource with a mutex.
Definition: ogrmutexeddatasource.h:45
GDALMajorObject::GetMetadata
virtual char ** GetMetadata(const char *pszDomain="")
Fetch metadata.
Definition: gdalmajorobject.cpp:243
GDALDataset::CommitTransaction
virtual OGRErr CommitTransaction()
For datasources which support transactions, CommitTransaction commits a transaction.
Definition: gdaldataset.cpp:5978
wkbUnknown
unknown type, non-standard
Definition: ogr_core.h:335
GDALDataset::GetLayer
virtual OGRLayer * GetLayer(int)
Fetch a layer by index.
Definition: gdaldataset.cpp:5805
GDALDataset::DeleteLayer
virtual OGRErr DeleteLayer(int)
Delete the indicated layer from the datasource.
Definition: gdaldataset.cpp:4369
GDALDataset::CopyLayer
virtual OGRLayer * CopyLayer(OGRLayer *poSrcLayer, const char *pszNewName, char **papszOptions=NULL)
Duplicate an existing layer.
Definition: gdaldataset.cpp:4014
GDALDataset::ReleaseResultSet
virtual void ReleaseResultSet(OGRLayer *poResultsSet)
Release results of ExecuteSQL().
Definition: gdaldataset.cpp:5675
GDALDataset::GetStyleTable
virtual OGRStyleTable * GetStyleTable()
Returns dataset style table.
Definition: gdaldataset.cpp:5697
GDALMajorObject::GetMetadataItem
virtual const char * GetMetadataItem(const char *pszName, const char *pszDomain="")
Fetch single metadata item.
Definition: gdalmajorobject.cpp:331
OGRwkbGeometryType
OGRwkbGeometryType
List of well known binary geometry types.
Definition: ogr_core.h:333
OGRGeometry
Abstract base class for all geometry classes.
Definition: ogr_geometry.h:104
GDALDataset::ExecuteSQL
virtual OGRLayer * ExecuteSQL(const char *pszStatement, OGRGeometry *poSpatialFilter, const char *pszDialect)
Execute an SQL statement against the data store.
Definition: gdaldataset.cpp:5225
ogrsf_frmts.h
Classes related to registration of format support, and opening datasets.
GDALMajorObject::SetMetadata
virtual CPLErr SetMetadata(char **papszMetadata, const char *pszDomain="")
Set metadata.
Definition: gdalmajorobject.cpp:286
GDALDataset::GetLayerByName
virtual OGRLayer * GetLayerByName(const char *)
Fetch a layer by name.
Definition: gdaldataset.cpp:4399
OGRSpatialReference
This class represents an OpenGIS Spatial Reference System, and contains methods for converting betwee...
Definition: ogr_spatialref.h:129
GDALDataset::SetStyleTableDirectly
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set dataset style table.
Definition: gdaldataset.cpp:5720
GDALDataset::RollbackTransaction
virtual OGRErr RollbackTransaction()
For datasources which support transactions, RollbackTransaction will roll back a datasource to its st...
Definition: gdaldataset.cpp:6030
OGRLayer
This class represents a layer of simple features, with access methods.
Definition: ogrsf_frmts.h:66
OGRStyleTable
This class represents a style table.
Definition: ogr_featurestyle.h:82
GDALDataset::GetLayerCount
virtual int GetLayerCount()
Get the number of layers in this dataset.
Definition: gdaldataset.cpp:5780
GDALMajorObject::SetMetadataItem
virtual CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="")
Set single metadata item.
Definition: gdalmajorobject.cpp:374
GDALDataset::ICreateLayer
virtual OGRLayer * ICreateLayer(const char *pszName, OGRSpatialReference *poSpatialRef=NULL, OGRwkbGeometryType eGType=wkbUnknown, char **papszOptions=NULL)
This method attempts to create a new layer on the dataset with the indicated name, coordinate system, geometry type.
Definition: gdaldataset.cpp:3968
GDALDataset::TestCapability
virtual int TestCapability(const char *)
Test if capability is available.
Definition: gdaldataset.cpp:5844
GDALDataset::StartTransaction
virtual OGRErr StartTransaction(int bForce=FALSE)
For datasources which support transactions, StartTransaction creates a `transaction.
Definition: gdaldataset.cpp:5895

Generated for GDAL by 1.8.8.