OGR
ogremulatedtransaction.h
1 /******************************************************************************
2  * $Id: ogremulatedtransaction.h 40ea9cecccbfbe063a1b22181b0b9cd8e2788744 2016-10-24 14:08:24Z Kurt Schwehr $
3  *
4  * Project: OpenGIS Simple Features Reference Implementation
5  * Purpose: Defines OGRDataSourceWithTransaction class
6  * Author: Even Rouault, even dot rouault at spatialys dot com
7  *
8  ******************************************************************************
9  * Copyright (c) 2015, Even Rouault <even dot rouault at spatialys dot com>
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 OGREMULATEDTRANSACTION_H_INCLUDED
31 #define OGREMULATEDTRANSACTION_H_INCLUDED
32 
33 #include "ogrsf_frmts.h"
34 
41 {
42  public:
43  virtual ~IOGRTransactionBehaviour();
44 
58  virtual OGRErr StartTransaction(OGRDataSource*& poDSInOut,
59  int& bOutHasReopenedDS) = 0;
60 
74  virtual OGRErr CommitTransaction(OGRDataSource*& poDSInOut,
75  int& bOutHasReopenedDS) = 0;
76 
90  virtual OGRErr RollbackTransaction(OGRDataSource*& poDSInOut,
91  int& bOutHasReopenedDS) = 0;
92 };
93 
121 OGRDataSource CPL_DLL* OGRCreateEmulatedTransactionDataSourceWrapper(
122  OGRDataSource* poBaseDataSource,
123  IOGRTransactionBehaviour* poTransactionBehaviour,
124  int bTakeOwnershipDataSource,
125  int bTakeOwnershipTransactionBehaviour);
126 
127 #endif // OGREMULATEDTRANSACTION_H_INCLUDED
OGRLayer::GetName
virtual const char * GetName()
Return the layer name.
Definition: ogrlayer.cpp:1727
OGRFeature::SetFID
virtual OGRErr SetFID(GIntBig nFIDIn)
Set the feature identifier.
Definition: ogrfeature.cpp:5436
OGRFeatureDefn::Release
void Release()
Drop a reference to this object, and destroy if no longer referenced.
Definition: ogrfeaturedefn.cpp:161
OGRFeatureDefn::AddFieldDefn
virtual void AddFieldDefn(OGRFieldDefn *)
Add a new field definition.
Definition: ogrfeaturedefn.cpp:432
OGRFieldDefn::SetSubType
void SetSubType(OGRFieldSubType eSubTypeIn)
Set the subtype of this field. This should never be done to an OGRFieldDefn that is already part of a...
Definition: ogrfielddefn.cpp:363
OGRFieldDefn::SetName
void SetName(const char *)
Reset the name of this field.
Definition: ogrfielddefn.cpp:157
OGRStyleTable
Definition: ogr_featurestyle.h:84
OGRFieldDefn::SetType
void SetType(OGRFieldType eTypeIn)
Set the type of this field. This should never be done to an OGRFieldDefn that is already part of an O...
Definition: ogrfielddefn.cpp:277
OGRFieldDefn::GetWidth
int GetWidth() const
Get the formatting width for this field.
Definition: ogr_feature.h:127
OGRSpatialReference
Definition: ogr_spatialref.h:145
OGRLayerWithTransaction
Definition: ogremulatedtransaction.cpp:38
OGRGeometry
Definition: ogr_geometry.h:286
OGRLayer
Definition: ogrsf_frmts.h:70
CPLString
Convenient string class based on std::string.
Definition: cpl_string.h:336
OGRFeatureDefn::ReorderFieldDefns
virtual OGRErr ReorderFieldDefns(int *panMap)
Reorder the field definitions in the array of the feature definition.
Definition: ogrfeaturedefn.cpp:562
OGRFieldDefn::GetPrecision
int GetPrecision() const
Get the formatting precision for this field. This should normally be zero for fields of types other t...
Definition: ogr_feature.h:130
OGRFeatureDefn::DeleteFieldDefn
virtual OGRErr DeleteFieldDefn(int iField)
Delete an existing field definition.
Definition: ogrfeaturedefn.cpp:491
EQUAL
#define EQUAL(a, b)
Definition: cpl_port.h:559
OGRFieldDefn::GetNameRef
const char * GetNameRef() const
Fetch name of this field.
Definition: ogr_feature.h:113
OGRFieldDefn::SetPrecision
void SetPrecision(int nPrecisionIn)
Set the formatting precision for this field in characters.
Definition: ogr_feature.h:131
OGRFeatureDefn::GetFieldDefn
virtual OGRFieldDefn * GetFieldDefn(int i)
Fetch field definition.
Definition: ogrfeaturedefn.cpp:329
ODsCEmulatedTransactions
#define ODsCEmulatedTransactions
Definition: ogr_core.h:772
OGRDataSourceWithTransaction
Definition: ogremulatedtransaction.cpp:70
OGRFeature::SetFrom
OGRErr SetFrom(const OGRFeature *, int=TRUE)
Set one feature from another.
Definition: ogrfeature.cpp:5733
OGRFieldDefn::GetDefault
const char * GetDefault() const
Get default field value.
Definition: ogrfielddefn.cpp:518
IOGRTransactionBehaviour::RollbackTransaction
virtual OGRErr RollbackTransaction(OGRDataSource *&poDSInOut, int &bOutHasReopenedDS)=0
OGRERR_UNSUPPORTED_OPERATION
#define OGRERR_UNSUPPORTED_OPERATION
Definition: ogr_core.h:296
OGRERR_FAILURE
#define OGRERR_FAILURE
Definition: ogr_core.h:298
OGRFeatureDefn::Clone
virtual OGRFeatureDefn * Clone() const
Create a copy of this feature definition.
Definition: ogrfeaturedefn.cpp:200
IOGRTransactionBehaviour::StartTransaction
virtual OGRErr StartTransaction(OGRDataSource *&poDSInOut, int &bOutHasReopenedDS)=0
ogrsf_frmts.h
OGRFieldDefn
Definition: ogr_feature.h:92
OGRDataSource
Definition: ogrsf_frmts.h:315
OGRFieldDefn::SetDefault
void SetDefault(const char *)
Set default field value.
Definition: ogrfielddefn.cpp:431
CPLError
void CPLError(CPLErr eErrClass, CPLErrorNum err_no, const char *fmt,...)
Definition: cpl_error.cpp:232
OGRGeomFieldDefn
Definition: ogr_feature.h:182
IOGRTransactionBehaviour
Definition: ogremulatedtransaction.h:40
CPLE_NotSupported
#define CPLE_NotSupported
Definition: cpl_error.h:109
OGRFieldDefn::GetType
OGRFieldType GetType() const
Fetch type of this field.
Definition: ogr_feature.h:115
OGRErr
int OGRErr
Definition: ogr_core.h:290
IOGRTransactionBehaviour::CommitTransaction
virtual OGRErr CommitTransaction(OGRDataSource *&poDSInOut, int &bOutHasReopenedDS)=0
GIntBig
long long GIntBig
Definition: cpl_port.h:246
OGRwkbGeometryType
OGRwkbGeometryType
Definition: ogr_core.h:317
OGRFeatureDefn::Reference
int Reference()
Increments the reference count by one.
Definition: ogr_feature.h:306
OGRFeature
Definition: ogr_feature.h:353
OGRFieldDefn::SetNullable
void SetNullable(int bNullableIn)
Set whether this field can receive null values.
Definition: ogr_feature.h:145
OGRFieldDefn::IsNullable
int IsNullable() const
Return whether this field can receive null values.
Definition: ogr_feature.h:144
CPLErr
CPLErr
Definition: cpl_error.h:52
OGRFeatureDefn::AddGeomFieldDefn
virtual void AddGeomFieldDefn(OGRGeomFieldDefn *, int bCopy=TRUE)
Add a new geometry field definition.
Definition: ogrfeaturedefn.cpp:781
OGRFieldDefn::SetWidth
void SetWidth(int nWidthIn)
Set the formatting width for this field in characters.
Definition: ogr_feature.h:128
OGRERR_NONE
#define OGRERR_NONE
Definition: ogr_core.h:292
OGRFeatureDefn
Definition: ogr_feature.h:259
OGRFieldDefn::GetSubType
OGRFieldSubType GetSubType() const
Fetch subtype of this field.
Definition: ogr_feature.h:119
wkbUnknown
@ wkbUnknown
Definition: ogr_core.h:319
OGRFeature::GetFID
GIntBig GetFID() const
Get feature identifier.
Definition: ogr_feature.h:711
CPLE_AppDefined
#define CPLE_AppDefined
Definition: cpl_error.h:99

Generated for GDAL by doxygen 1.8.17.