ogrlayerdecorator.h

00001 /******************************************************************************
00002  * $Id: ogrlayerdecorator.h 24633 2012-07-01 14:37:25Z rouault $
00003  *
00004  * Project:  OpenGIS Simple Features Reference Implementation
00005  * Purpose:  Defines OGRLayerDecorator class
00006  * Author:   Even Rouault, even dot rouault at mines dash paris dot org
00007  *
00008  ******************************************************************************
00009  * Copyright (c) 2012, Even Rouault <even dot rouault at mines dash paris dot org>
00010  *
00011  * Permission is hereby granted, free of charge, to any person obtaining a
00012  * copy of this software and associated documentation files (the "Software"),
00013  * to deal in the Software without restriction, including without limitation
00014  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
00015  * and/or sell copies of the Software, and to permit persons to whom the
00016  * Software is furnished to do so, subject to the following conditions:
00017  *
00018  * The above copyright notice and this permission notice shall be included
00019  * in all copies or substantial portions of the Software.
00020  *
00021  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00022  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00023  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
00024  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00025  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
00026  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
00027  * DEALINGS IN THE SOFTWARE.
00028  ****************************************************************************/
00029 
00030 #ifndef _OGRLAYERDECORATOR_H_INCLUDED
00031 #define _OGRLAYERDECORATOR_H_INCLUDED
00032 
00033 #include "ogrsf_frmts.h"
00034 
00035 class OGRLayerDecorator : public OGRLayer
00036 {
00037   protected:
00038     OGRLayer *m_poDecoratedLayer;
00039     int       m_bHasOwnership;
00040 
00041   public:
00042 
00043                        OGRLayerDecorator(OGRLayer* poDecoratedLayer,
00044                                          int bTakeOwnership);
00045     virtual           ~OGRLayerDecorator();
00046 
00047     virtual OGRGeometry *GetSpatialFilter();
00048     virtual void        SetSpatialFilter( OGRGeometry * );
00049     virtual void        SetSpatialFilterRect( double dfMinX, double dfMinY,
00050                                               double dfMaxX, double dfMaxY );
00051 
00052     virtual OGRErr      SetAttributeFilter( const char * );
00053 
00054     virtual void        ResetReading();
00055     virtual OGRFeature *GetNextFeature();
00056     virtual OGRErr      SetNextByIndex( long nIndex );
00057     virtual OGRFeature *GetFeature( long nFID );
00058     virtual OGRErr      SetFeature( OGRFeature *poFeature );
00059     virtual OGRErr      CreateFeature( OGRFeature *poFeature );
00060     virtual OGRErr      DeleteFeature( long nFID );
00061 
00062     virtual const char *GetName();
00063     virtual OGRwkbGeometryType GetGeomType();
00064     virtual OGRFeatureDefn *GetLayerDefn();
00065 
00066     virtual OGRSpatialReference *GetSpatialRef();
00067 
00068     virtual int         GetFeatureCount( int bForce = TRUE );
00069     virtual OGRErr      GetExtent(OGREnvelope *psExtent, int bForce = TRUE);
00070 
00071     virtual int         TestCapability( const char * );
00072 
00073     /* Deprecated (and un-implemented method) --> we won't decorate it ! */
00074     /* virtual const char *GetInfo( const char * ); */
00075 
00076     virtual OGRErr      CreateField( OGRFieldDefn *poField,
00077                                      int bApproxOK = TRUE );
00078     virtual OGRErr      DeleteField( int iField );
00079     virtual OGRErr      ReorderFields( int* panMap );
00080     virtual OGRErr      AlterFieldDefn( int iField, OGRFieldDefn* poNewFieldDefn, int nFlags );
00081 
00082     virtual OGRErr      SyncToDisk();
00083 
00084     virtual OGRStyleTable *GetStyleTable();
00085     virtual void        SetStyleTableDirectly( OGRStyleTable *poStyleTable );
00086 
00087     virtual void        SetStyleTable(OGRStyleTable *poStyleTable);
00088 
00089     virtual OGRErr      StartTransaction();
00090     virtual OGRErr      CommitTransaction();
00091     virtual OGRErr      RollbackTransaction();
00092 
00093     virtual const char *GetFIDColumn();
00094     virtual const char *GetGeometryColumn();
00095 
00096     virtual OGRErr      SetIgnoredFields( const char **papszFields );
00097 };
00098 
00099 #endif // _OGRLAYERDECORATOR_H_INCLUDED

Generated for GDAL by doxygen 1.6.1.