FDO API Reference | Feature Data Objects |
00001 #ifndef FDO_XMLCLASSMAPPING_H 00002 #define FDO_XMLCLASSMAPPING_H 00003 00004 // 00005 // Copyright (C) 2004-2006 Autodesk, Inc. 00006 // 00007 // This library is free software; you can redistribute it and/or 00008 // modify it under the terms of version 2.1 of the GNU Lesser 00009 // General Public License as published by the Free Software Foundation. 00010 // 00011 // This library is distributed in the hope that it will be useful, 00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00014 // Lesser General Public License for more details. 00015 // 00016 // You should have received a copy of the GNU Lesser General Public 00017 // License along with this library; if not, write to the Free Software 00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00019 // 00020 00021 #ifdef _WIN32 00022 #pragma once 00023 #endif 00024 00025 #include <FdoStd.h> 00026 #include <Fdo/Commands/Schema/PhysicalClassMapping.h> 00027 #include <Fdo/Xml/ElementMappingCollection.h> 00028 00029 /// \brief 00030 /// FdoXmlClassMapping describes GML to FDO mappings for a particular FDO class 00031 /// Only mappings that cannot be represented in FDO are described. 00032 class FdoXmlClassMapping : public FdoPhysicalClassMapping 00033 { 00034 public: 00035 /// \brief 00036 /// Constructs an object describing the GML-FDO mappings for an FDO class. 00037 /// 00038 /// \param name 00039 /// Input class name 00040 /// \param GmlName 00041 /// Input corresponding type name in GML version of the 00042 /// class's schema. 00043 /// \param wkBaseName 00044 /// Input name of the most specialized well-known type. This is 00045 /// set when the type represents geometries and indicates what kind of geometries the type 00046 /// represents. wkBaseName must be L"" or one of the constants defined in 00047 /// commonGml212Gml212.h. 00048 /// 00049 /// \return 00050 /// Returns FdoXmlClassMapping 00051 /// 00052 FDO_API static FdoXmlClassMapping* Create( 00053 FdoString* name, 00054 FdoString* gmlName, 00055 FdoString* wkBaseName, 00056 FdoString* wkSchemaName = L"" 00057 ); 00058 00059 /// \brief 00060 /// Gets the name of the class's corresponding GML complexType. 00061 /// 00062 /// \return 00063 /// Returns FdoString. 00064 /// 00065 FDO_API FdoString* GetGmlName(); 00066 00067 /// \brief 00068 /// Gets the most specialized well-known base type 00069 /// 00070 /// \return 00071 /// Returns FdoString. 00072 /// 00073 FDO_API FdoString* GetWkBaseName(); 00074 00075 /// \brief 00076 /// Gets the schema containing most specialized well-known base type 00077 /// 00078 /// \return 00079 /// Returns FdoString. 00080 /// 00081 FDO_API FdoString* GetWkSchemaName(); 00082 00083 /// \brief 00084 /// Gets the mappings between GML elements for this class's properties and their 00085 /// Fdo Classes. 00086 /// 00087 /// \return 00088 /// Returns FdoXmlElementMappingCollection* 00089 /// 00090 FDO_API FdoXmlElementMappingCollection* GetElementMappings(); 00091 00092 /// \cond DOXYGEN-IGNORE 00093 /// \brief 00094 /// Writes this XML Class Mapping to XML. Called when 00095 /// the element is serialized to XML. 00096 /// 00097 /// \param xmlWriter 00098 /// Input write the element to this XML writer 00099 /// \param flags 00100 /// Input flags that control the writing of the element. 00101 /// 00102 /// \return 00103 /// Returns nothing 00104 /// 00105 virtual void _writeXml( 00106 FdoXmlWriter* xmlWriter, 00107 const FdoXmlFlags* flags 00108 ); 00109 /// \endcond 00110 00111 protected: 00112 /// \cond DOXYGEN-IGNORE 00113 FdoXmlClassMapping() {} 00114 00115 FdoXmlClassMapping( 00116 FdoString* name, 00117 FdoString* gmlName, 00118 FdoString* wkBaseName, 00119 FdoString* wkSchemaName 00120 ); 00121 00122 virtual ~FdoXmlClassMapping(); 00123 00124 virtual void Dispose(); 00125 00126 /// Functions for XML support 00127 00128 /// \brief 00129 /// Initializes this Xml Class Mapping from its XML attributes. Called when 00130 /// the element is deserialized from XML. 00131 /// 00132 /// \param pContext 00133 /// Input context contain information about the current deserialization operation 00134 /// \param attrs 00135 /// Input the XML attributes. 00136 /// 00137 /// \return 00138 /// Returns nothing 00139 /// 00140 virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs); 00141 00142 /// \endcond 00143 00144 private: 00145 FdoStringP mGmlName; 00146 FdoStringP mWkBaseName; 00147 FdoStringP mWkSchemaName; 00148 FdoXmlElementMappingsP mElementMappings; 00149 }; 00150 00151 /// \brief 00152 /// FdoXmlClassMappingP is a FdoPtr on FdoXmlClassMapping, provided for convenience. 00153 typedef FdoPtr<FdoXmlClassMapping> FdoXmlClassMappingP; 00154 00155 #endif 00156 00157
Comments or suggestions? Send us feedback. |