OGR
ogrmutexeddatasource.h
1 /******************************************************************************
2  * $Id: ogrmutexeddatasource.h 27044 2014-03-16 23:41:27Z rouault $
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 
42 class CPL_DLL OGRMutexedDataSource : public OGRDataSource
43 {
44  protected:
45  OGRDataSource *m_poBaseDataSource;
46  int m_bHasOwnership;
47  void *m_hGlobalMutex;
48 
49  public:
50 
51  /* The construction of the object isn't protected by the mutex */
52  OGRMutexedDataSource(OGRDataSource* poBaseDataSource,
53  int bTakeOwnership,
54  void* hMutexIn);
55 
56  /* The destruction of the object isn't protected by the mutex */
57  virtual ~OGRMutexedDataSource();
58 
59  virtual const char *GetName();
60 
61  virtual int GetLayerCount() ;
62  virtual OGRLayer *GetLayer(int);
63  virtual OGRLayer *GetLayerByName(const char *);
64  virtual OGRErr DeleteLayer(int);
65 
66  virtual int TestCapability( const char * );
67 
68  virtual OGRLayer *CreateLayer( const char *pszName,
69  OGRSpatialReference *poSpatialRef = NULL,
71  char ** papszOptions = NULL );
72  virtual OGRLayer *CopyLayer( OGRLayer *poSrcLayer,
73  const char *pszNewName,
74  char **papszOptions = NULL );
75 
76  virtual OGRStyleTable *GetStyleTable();
77  virtual void SetStyleTableDirectly( OGRStyleTable *poStyleTable );
78 
79  virtual void SetStyleTable(OGRStyleTable *poStyleTable);
80 
81  virtual OGRLayer * ExecuteSQL( const char *pszStatement,
82  OGRGeometry *poSpatialFilter,
83  const char *pszDialect );
84  virtual void ReleaseResultSet( OGRLayer * poResultsSet );
85 
86  virtual OGRErr SyncToDisk();
87 };
88 
89 #endif // _OGRMUTEXEDDATASOURCELAYER_H_INCLUDED
Definition: ogrsf_frmts.h:217
virtual void SetStyleTableDirectly(OGRStyleTable *poStyleTable)
Set data source style table.
Definition: ogrdatasource.cpp:1872
virtual OGRLayer * GetLayer(int)=0
Fetch a layer by index.
Definition: ogrmutexeddatasource.h:42
virtual OGRLayer * CreateLayer(const char *pszName, OGRSpatialReference *poSpatialRef=NULL, OGRwkbGeometryType eGType=wkbUnknown, char **papszOptions=NULL)
This method attempts to create a new layer on the data source with the indicated name, coordinate system, geometry type.
Definition: ogrdatasource.cpp:207
virtual int TestCapability(const char *)=0
Test if capability is available.
virtual OGRLayer * CopyLayer(OGRLayer *poSrcLayer, const char *pszNewName, char **papszOptions=NULL)
Duplicate an existing layer.
Definition: ogrdatasource.cpp:250
virtual OGRLayer * ExecuteSQL(const char *pszStatement, OGRGeometry *poSpatialFilter, const char *pszDialect)
Execute an SQL statement against the data store.
Definition: ogrdatasource.cpp:1325
Definition: ogr_core.h:310
virtual OGRLayer * GetLayerByName(const char *)
Fetch a layer by name.
Definition: ogrdatasource.cpp:527
virtual void ReleaseResultSet(OGRLayer *poResultsSet)
Release results of ExecuteSQL().
Definition: ogrdatasource.cpp:1722
OGRwkbGeometryType
Definition: ogr_core.h:308
Definition: ogr_geometry.h:79
Definition: ogr_spatialref.h:129
virtual int GetLayerCount()=0
Get the number of layers in this data source.
virtual OGRErr DeleteLayer(int)
Delete the indicated layer from the datasource.
Definition: ogrdatasource.cpp:501
Definition: ogrsf_frmts.h:59
virtual const char * GetName()=0
Returns the name of the data source.
Definition: ogr_featurestyle.h:81
virtual OGRErr SyncToDisk()
Flush pending changes to disk.
Definition: ogrdatasource.cpp:1793
virtual OGRStyleTable * GetStyleTable()
Returns data source style table.
Definition: ogrdatasource.cpp:1863
virtual void SetStyleTable(OGRStyleTable *poStyleTable)
Set data source style table.
Definition: ogrdatasource.cpp:1883

Generated for GDAL by doxygen 1.8.11.