00001 //
00002 // Copyright (C) 2006 Refractions Research, Inc.
00003 //
00004 // This library is free software; you can redistribute it and/or
00005 // modify it under the terms of version 2.1 of the GNU Lesser
00006 // General Public License as published by the Free Software Foundation.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
00016 //
00017 #ifndef FDOPOSTGISOVCLASSDEFINITION_H
00018 #define FDOPOSTGISOVCLASSDEFINITION_H
00019
00020 #include <Rdbms/Override/RdbmsOvClassDefinition.h>
00021 #include <Rdbms/Override/PostGIS/PostGisOv.h>
00022 #include <Rdbms/Override/PostGIS/PostGisOvDataPropertyDefinition.h>
00023 #include <Rdbms/Override/PostGIS/PostGisOvGeometricPropertyDefinition.h>
00024 #include <Rdbms/Override/PostGIS/PostGisOvObjectPropertyDefinition.h>
00025 #include <Rdbms/Override/PostGIS/PostGisOvPropertyDefinitionCollection.h>
00026 #include <Rdbms/Override/PostGIS/PostGisOvTable.h>
00027 #include <Rdbms/Override/PostGIS/PostGisOvGeometricColumn.h>
00028
00029 /// \brief
00030 /// Concrete class defining physical schema overrides for a class definition.
00031 ///
00032 class FdoPostGISOvClassDefinition : public FdoRdbmsOvClassDefinition
00033 {
00034 public:
00035
00036 /// Named constructor for FdoPostGISOvClassDefinition.
00037 ///
00038 /// \return
00039 /// Pointer to new instance of FdoPostGISOvClassDefinition.
00040 ///
00041 FDOPOSTGIS_OV_API static FdoPostGISOvClassDefinition* Create();
00042
00043 /// Named constructor for FdoPostGISOvClassDefinition.
00044 ///
00045 /// \param
00046 /// name [in] - name of class definition.
00047 ///
00048 /// \return
00049 /// Pointer to new instance of FdoPostGISOvClassDefinition.
00050 ///
00051 FDOPOSTGIS_OV_API static FdoPostGISOvClassDefinition* Create(FdoString* name);
00052
00053 /// Gets collection of overrides properties.
00054 ///
00055 /// \return
00056 /// Collection of PostGIS property overrides
00057 ///
00058 FDOPOSTGIS_OV_API FdoPostGISOvPropertyDefinitionCollection* GetProperties();
00059
00060 /// Gets table override for this class definition.
00061 ///
00062 /// \return
00063 /// PostGIS table override for class definition.
00064 ///
00065 FDOPOSTGIS_OV_API FdoPostGISOvTable* GetTable();
00066
00067 /// Sets the PostGIS table override for this class override.
00068 ///
00069 /// \param
00070 /// name [in] - input PostGIS table override.
00071 ///
00072 FDOPOSTGIS_OV_API void SetTable(FdoPostGISOvTable* table);
00073
00074 /// Sets the parent of this object. Not part of the API.
00075 ///
00076 /// \param
00077 /// parent [in] -
00078 ///
00079 void SetParent(FdoPhysicalElementMapping* parent);
00080
00081 /// \cond DOXYGEN-IGNORE
00082
00083 /// XML serialization functions, not part of the API.
00084
00085 /// Initialize this element from its XML attributes
00086 ///
00087 /// \param
00088 /// saxContext [in] -
00089 ///
00090 /// \param
00091 /// attrs [in] -
00092 ///
00093 virtual void InitFromXml(FdoXmlSaxContext* saxContext,
00094 FdoXmlAttributeCollection* attrs);
00095
00096 /// Serialize the XML attributes of this class.
00097 ///
00098 /// \param
00099 /// xmlWriter [in] -
00100 ///
00101 /// \param
00102 /// flags [in] -
00103 ///
00104 virtual void _writeXmlAttributes(FdoXmlWriter* xmlWriter,
00105 const FdoXmlFlags* flags);
00106
00107 /// \endcond
00108
00109 protected:
00110
00111 /// Default constructor.
00112 FdoPostGISOvClassDefinition();
00113
00114 /// Alternative constructor.
00115 /// \param name [in] - name of class definition.
00116 FdoPostGISOvClassDefinition(FdoString *name);
00117
00118 /// Destructor
00119 virtual ~FdoPostGISOvClassDefinition();
00120
00121 /// Named constructor.
00122 /// Called from class constructors.
00123 void Init();
00124
00125 /// Named destructor.
00126 virtual void Dispose();
00127
00128 /// Create table override from XML attributes
00129 virtual void SetTable(
00130 FdoXmlSaxContext* saxContext,
00131 FdoXmlAttributeCollection* atts);
00132
00133 /// Create data property override from XML attributes
00134 virtual FdoRdbmsOvDataPropertyDefinition* CreateDataProperty(
00135 FdoXmlSaxContext* saxContext,
00136 FdoXmlAttributeCollection* propAtts,
00137 FdoXmlAttributeCollection* colAtts);
00138
00139 /// Create geometric property override from XML attributes
00140 virtual FdoRdbmsOvGeometricPropertyDefinition* CreateGeometricProperty(
00141 FdoXmlSaxContext* saxContext,
00142 FdoXmlAttributeCollection* propAtts,
00143 FdoXmlAttributeCollection* colAtts
00144 );
00145
00146 /// Create object property override from XML attributes
00147 virtual FdoRdbmsOvObjectPropertyDefinition* CreateObjectProperty(
00148 FdoXmlSaxContext* saxContext,
00149 FdoXmlAttributeCollection* propAtts,
00150 FdoString* mappingType,
00151 FdoXmlAttributeCollection* mappingAtts
00152 );
00153
00154 /// Add the given property override to this class override
00155 virtual void AddProperty(FdoRdbmsOvPropertyDefinition* propDef);
00156
00157 private:
00158
00159 /// Collection with properties definition.
00160 FdoPostGISOvPropertiesP mPropertyDefinitions;
00161 };
00162
00163 /// \brief
00164 /// Declaration of smart-pointer type for FdoPostGISOvClassDefinition.
00165 /// Provided for convenience.
00166 typedef FdoPtr<FdoPostGISOvClassDefinition> FdoPostGISOvClassP;
00167
00168 #endif // FDOPOSTGISOVCLASSDEFINITION_H