FDO API Reference | Feature Data Objects |
00001 #ifndef FDO_PHYSICALELEMENTMAPPING_H 00002 #define FDO_PHYSICALELEMENTMAPPING_H 00003 // 00004 00005 // 00006 // Copyright (C) 2004-2006 Autodesk, Inc. 00007 // 00008 // This library is free software; you can redistribute it and/or 00009 // modify it under the terms of version 2.1 of the GNU Lesser 00010 // General Public License as published by the Free Software Foundation. 00011 // 00012 // This library is distributed in the hope that it will be useful, 00013 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00015 // Lesser General Public License for more details. 00016 // 00017 // You should have received a copy of the GNU Lesser General Public 00018 // License along with this library; if not, write to the Free Software 00019 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00020 // 00021 00022 #ifdef _WIN32 00023 #pragma once 00024 #endif 00025 00026 #include <FdoStd.h> 00027 #include <Fdo/Xml/Context.h> 00028 #include <Fdo/Commands/CommandException.h> 00029 00030 class FdoPhysicalSchemaMapping; 00031 class FdoXmlFlags; 00032 00033 /// \brief 00034 /// FdoPhysicalElementMapping is an abstract class that acts as a base class for all 00035 /// Physical Schema Mapping Override classes. FDO also provides a number of sub-classes 00036 /// for particular types of Provider-specific override classes: 00037 /// \remarks 00038 /// <ul> 00039 /// <li>FdoPhysicalClassMapping: All classes corresponding to Feature Classes 00040 /// must be based on FdoPhysicalClassMapping. 00041 /// <li>FdoPhysicalPropertyMapping: Must be the base for all classes corresponding to 00042 /// Properties. 00043 /// <li>FdoPhysicalSchemaMapping: Must be the base for all types of schema override sets. 00044 /// </ul> 00045 /// Other types of schema override classes can be based directly on FdoPhysicalElementMapping. 00046 class FdoPhysicalElementMapping : 00047 public FdoIDisposable, 00048 public virtual FdoXmlSaxHandler 00049 { 00050 template <class OBJ> friend class FdoPhysicalElementMappingCollection; 00051 00052 public: 00053 /// \brief 00054 /// Gets the parent of this FdoPhysicalElementMapping or null if this object has not 00055 /// been added to a parent object. 00056 /// 00057 /// \return 00058 /// Returns FdoPhysicalElementMapping of parent 00059 /// 00060 FDO_API virtual FdoPhysicalElementMapping* GetParent(); 00061 00062 /// \brief 00063 /// Gets the FdoPhysicalSchemaMapping that this element is a part of. Returns null if this 00064 /// object has not been added to a feature schema. 00065 /// 00066 /// \return 00067 /// Returns FdoPhysicalSchemaMapping this object is a part of 00068 /// 00069 FDO_API virtual FdoPhysicalSchemaMapping* GetSchemaMapping(); 00070 00071 /// \brief 00072 /// Gets the name of this element. 00073 /// 00074 /// \return 00075 /// Returns the name of this element. 00076 /// 00077 FDO_API virtual FdoString* GetName(); 00078 00079 /// \brief 00080 /// Gets the fully qualified name of this element 00081 /// 00082 /// \return 00083 /// default implementation simply returns the element name 00084 /// 00085 FDO_API virtual FdoStringP GetQualifiedName(); 00086 00087 /// \brief 00088 /// Sets the name of this element. 00089 /// 00090 /// \param value 00091 /// Input the name of this element. 00092 /// 00093 /// \return 00094 /// Returns nothing 00095 /// 00096 FDO_API virtual void SetName(FdoString* value); 00097 00098 /// \cond DOXYGEN-IGNORE 00099 //Indicates that this object allows its name 00100 //to change. This function is defined so that this class can 00101 //be a FdoNamedCollection element. 00102 FDO_API virtual FdoBoolean CanSetName() 00103 { 00104 return true; 00105 } 00106 /// \endcond 00107 00108 /// Functions for XML support 00109 00110 /// \brief 00111 /// Initializes this Physical Element Mapping from its XML attributes. Called when 00112 /// the element is deserialized from XML. Can be extended to handle 00113 /// particular XML attributes for derived classes. 00114 /// 00115 /// \param pContext 00116 /// Input context contain information about the current deserialization operation 00117 /// \param attrs 00118 /// Input the XML attributes. 00119 /// 00120 /// \return 00121 /// Returns nothing 00122 /// 00123 FDO_API virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs); 00124 00125 /// \brief 00126 /// Writes this Physical Mapping Element to XML. Called when 00127 /// the element is serialized to XML. Can be extended to handle 00128 /// particular XML attributes and sub-elements for derived classes. 00129 /// 00130 /// \param xmlWriter 00131 /// Input write the element to this XML writer 00132 /// \param flags 00133 /// Input flags that control the writing of the element. 00134 /// 00135 /// \return 00136 /// Returns nothing 00137 /// 00138 FDO_API virtual void _writeXml( 00139 FdoXmlWriter* xmlWriter, 00140 const FdoXmlFlags* flags 00141 ); 00142 00143 /// \cond DOXYGEN-IGNORE 00144 00145 /// Various error reporting functions that are not yet part of the supported 00146 /// FDO API. 00147 /// All of them return a FdoXmlSkipElementHandler, which can be used to skip 00148 /// over the element in error. 00149 00150 FDO_API FdoXmlSaxHandler* SubElementError( 00151 FdoXmlSaxContext* pContext, 00152 FdoString* parentElement, 00153 FdoString* subElement 00154 ); 00155 00156 FDO_API FdoXmlSaxHandler* MultiSubElementError( 00157 FdoXmlSaxContext* pContext, 00158 FdoString* parentElement, 00159 FdoString* subElement 00160 ); 00161 00162 FDO_API FdoXmlSaxHandler* ChoiceSubElementError( 00163 FdoXmlSaxContext* pContext, 00164 FdoString* parentElement, 00165 FdoStringsP subElements 00166 ); 00167 00168 FDO_API FdoXmlSaxHandler* DuplicateSubElementError( 00169 FdoXmlSaxContext* pContext, 00170 FdoString* parentElement, 00171 FdoString* subElement, 00172 FdoString* subElementName 00173 ); 00174 /// \endcond 00175 00176 00177 protected: 00178 /// \brief 00179 /// Constructs a default instance of an FdoPhysicalElementMapping. 00180 /// 00181 FDO_API FdoPhysicalElementMapping(); 00182 00183 /// \brief 00184 /// Constructs an instance of an FdoPhysicalElementMapping using the specified arguments. 00185 /// 00186 /// \param name 00187 /// Input the element name 00188 /// 00189 FDO_API FdoPhysicalElementMapping(FdoString* name /*, FdoString* description = L"" */); 00190 00191 /// \brief 00192 /// FdoPhysicalElementMapping destructor. 00193 /// 00194 FDO_API virtual ~FdoPhysicalElementMapping(); 00195 00196 /// \brief 00197 /// Sets the parent of this Physical Element Mapping. 00198 /// 00199 /// \param value 00200 /// Input the parent 00201 /// 00202 FDO_API void SetParent(FdoPhysicalElementMapping* value); 00203 00204 /// \cond DOXYGEN-IGNORE 00205 00206 /// retrieves a FdoXmlSkipElementHandler for skipping an entire XML element 00207 FDO_API FdoXmlSaxHandler* GetSkipper(); 00208 00209 /// Get the second token from the provider name for this 00210 /// elements schema mapping set. 00211 FdoStringP GetProviderLocalName(); 00212 00213 /// SAX Handler for reading simple sub-element contents 00214 FdoXmlCharDataHandlerP m_XmlContentHandler; 00215 00216 /// SAX Handler for skipping elements 00217 FdoXmlSkipElementHandlerP m_XmlSkipper; 00218 /// \endcond 00219 00220 private: 00221 /// m_parent is a non-refcounted reference, to avoid circular references that prevent 00222 /// elements from being freed. 00223 FdoPhysicalElementMapping* m_parent; 00224 00225 /// The name of this element 00226 FdoStringP m_name; 00227 00228 /// Optional description of this element. 00229 FdoStringP m_description; 00230 }; 00231 00232 /// \ingroup (typedefs) 00233 /// \brief 00234 /// FdoPhysicalElementMappingP is a FdoPtr on FdoPhysicalElementMapping, provided for convenience. 00235 typedef FdoPtr<FdoPhysicalElementMapping> FdoPhysicalElementMappingP; 00236 00237 #endif 00238 00239
Comments or suggestions? Send us feedback. |