- Main Page
- Namespaces
- Classes
- Files

# RdbmsOvClassDefinition.h

Go to the documentation of this file.

    00001 #ifndef FDO_RDBMSOVCLASSDEFINITION_H
    00002 #define FDO_RDBMSOVCLASSDEFINITION_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 /// FdoRdbms.lib
    00023
    00024 #include <Fdo/Commands/Schema/PhysicalClassMapping.h>
    00025 #include <Utilities/SchemaMgr/Overrides/TableMappingType.h>
    00026 #include <Rdbms/Override/RdbmsOv.h>
    00027 #include <Rdbms/Override/RdbmsOvPropertyDefinitionCollection.h>
    00028 #include <Rdbms/Override/RdbmsOvDataPropertyDefinition.h>
    00029 #include <Rdbms/Override/RdbmsOvGeometricPropertyDefinition.h>
    00030 #include <Rdbms/Override/RdbmsOvObjectPropertyDefinition.h>
    00031 #include <Rdbms/Override/RdbmsOvTable.h>
    00032
    00033 ///<summary>Abstract class defining physical schema overrides for a class definition.</summary>
    00034 class FdoRdbmsOvClassDefinition: public FdoPhysicalClassMapping
    00035 {
    00036
    00037 public:
    00038     ///<summary>Gets the collection of property overrides for this class
    00039     ///override.</summary>
    00040     /// <returns>Returns FdoRdbmsOvReadOnlyPropertyDefinitionCollection</returns>
    00041     FDORDBMS_OV_API FdoRdbmsOvReadOnlyPropertyDefinitionCollection* GetProperties();
    00042
    00043     ///<summary>Gets the table overrides for this class override</summary>
    00044     /// <returns>Returns FdoRdbmsOvTable</returns>
    00045     FDORDBMS_OV_API FdoRdbmsOvTable* GetTable();
    00046
    00047     ///<summary>Gets the table mapping</summary>
    00048     ///<returns>Returns FdoSmOvTableMappingType</returns>
    00049     FDORDBMS_OV_API FdoSmOvTableMappingType GetTableMapping();
    00050
    00051     ///<summary>Sets the table mapping</summary>
    00052     /// <param name="mappingType">Input the mapping type</param>
    00053     ///<returns>Returns nothing</returns>
    00054     FDORDBMS_OV_API void SetTableMapping(FdoSmOvTableMappingType mappingType);
    00055
    00056 /// \cond DOXYGEN-IGNORE
    00057     FDORDBMS_OV_API void SetParent(FdoPhysicalElementMapping* value);
    00058
    00059     // XML Serialization functions.
    00060
    00061     FDORDBMS_OV_API virtual void _writeXml(FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags);
    00062
    00063     FDORDBMS_OV_API virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs);
    00064
    00065     // Serialize the XML attributes of this class:
    00066     FDORDBMS_OV_API virtual void _writeXmlAttributes(FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags);
    00067
    00068     FDORDBMS_OV_API virtual FdoXmlSaxHandler* XmlStartElement(
    00069         FdoXmlSaxContext* context,
    00070         FdoString* uri,
    00071         FdoString* name,
    00072         FdoString* qname,
    00073         FdoXmlAttributeCollection* atts
    00074     );
    00075
    00076     FDORDBMS_OV_API virtual FdoBoolean XmlEndElement(
    00077         FdoXmlSaxContext* context,
    00078         FdoString* uri,
    00079         FdoString* name,
    00080         FdoString* qname
    00081     );
    00082
    00083 /// \endcond
    00084
    00085 protected:
    00086     //<summary>Constructs a default instance of an FdoRdbmsOvClassDefinition.</summary>
    00087     FDORDBMS_OV_API FdoRdbmsOvClassDefinition();
    00088
    00089     //<summary>Constructs an instance of an FdoRdbmsOvClassDefinition using the specified arguments.</summary>
    00090     // <param name="name">Input the element name</param>
    00091     FDORDBMS_OV_API FdoRdbmsOvClassDefinition(FdoString *name);
    00092
    00093     FDORDBMS_OV_API virtual ~FdoRdbmsOvClassDefinition();
    00094
    00095     //<summary>Gets the property overrides in writable form.</summary>
    00096     // <returns>Returns FdoRdbmsOvPropertyDefinitionCollection</returns>
    00097     FDORDBMS_OV_API FdoRdbmsOvPropertyDefinitionCollection* GetRdbmsProperties();
    00098
    00099     //<summary>Sets the table override<summary>
    00100     // <param name="table">Input table override</param>
    00101     FDORDBMS_OV_API void SetTable(FdoRdbmsOvTable* table);
    00102
    00103     //<summary>Sets the table override from XML attributes</summary>
    00104     // <param name="context">Input context contain information about the current deserialization operation</param>
    00105     // <param name="attrs">Input the XML attributes.</param>
    00106     FDORDBMS_OV_API virtual void SetTable(
    00107         FdoXmlSaxContext* context,
    00108         FdoXmlAttributeCollection* atts
    00109     )
    00110     {
    00111         //TODO: exception
    00112     }
    00113
    00114     //<summary>
    00115     //Creates a data property override for this class override.
    00116     //Must be overridden by all providers that support
    00117     //data property overrides.
    00118     //</summary>
    00119     // <param name="context">Input context contain information about the current deserialization operation</param>
    00120     // <param name="propAttrs">Input the XML attributes for the property override.</param>
    00121     // <param name="colAttrs">Input the XML attributes for the property's column override.</param>
    00122     // <returns>Returns FdoRdbmsOvDataPropertyDefinition</returns>
    00123     FDORDBMS_OV_API virtual FdoRdbmsOvDataPropertyDefinition* CreateDataProperty(
    00124         FdoXmlSaxContext* context,
    00125         FdoXmlAttributeCollection* propAtts,
    00126         FdoXmlAttributeCollection* colAtts
    00127     )
    00128     {
    00129         //TODO: exception
    00130         return NULL;
    00131     }
    00132
    00133     //<summary>
    00134     //Creates a geometric property override for this class override.
    00135     //Must be overridden by all providers that support
    00136     //geometric property overrides.
    00137     //</summary>
    00138     // <param name="context">Input context contain information about the current deserialization operation</param>
    00139     // <param name="propAttrs">Input the XML attributes for the property override.</param>
    00140     // <param name="colAttrs">Input the XML attributes for the property's column override.</param>
    00141     // <returns>Returns FdoRdbmsOvDataPropertyDefinition</returns>
    00142     FDORDBMS_OV_API virtual FdoRdbmsOvGeometricPropertyDefinition* CreateGeometricProperty(
    00143         FdoXmlSaxContext* context,
    00144         FdoXmlAttributeCollection* propAtts,
    00145         FdoXmlAttributeCollection* colAtts
    00146     )
    00147     {
    00148         //TODO: exception
    00149         return NULL;
    00150     }
    00151
    00152     //<summary>
    00153     //Creates a object property override for this class override.
    00154     //Must be overridden by all providers that support
    00155     //object property overrides.
    00156     //</summary>
    00157     // <param name="context">Input context contain information about the current deserialization operation</param>
    00158     // <param name="propAttrs">Input the XML attributes for the property override.</param>
    00159     // <param name="mappingAttrs">Input the XML attributes for the
    00160     // object property table mapping override.</param>
    00161     // <returns>Returns FdoRdbmsOvDataPropertyDefinition</returns>
    00162     FDORDBMS_OV_API virtual FdoRdbmsOvObjectPropertyDefinition* CreateObjectProperty(
    00163         FdoXmlSaxContext* context,
    00164         FdoXmlAttributeCollection* propAtts,
    00165         FdoString* mappingType,
    00166         FdoXmlAttributeCollection* mappingAtts
    00167     )
    00168     {
    00169         //TODO: exception
    00170         return NULL;
    00171     }
    00172
    00173     //<summary>
    00174     //Checks if the given property is already in this class overrides's
    00175     //property list. If it is then an error is logged and a SAX handler
    00176     //for skipping the rest of the property's XML elements is returned.
    00177     ///summary>
    00178     // <param name="context">Input context contain information about the current deserialization operation</param>
    00179     // <param name="pProp">Input the property to check</param>
    00180     // <returns>Returns FdoXmlSaxHandler</returns>
    00181     FDORDBMS_OV_API FdoXmlSaxHandler* CheckDuplicateProperty(
    00182         FdoXmlSaxContext* context,
    00183         FdoRdbmsOvPropertyDefinition* pProp
    00184     );
    00185
    00186     //<summary>
    00187     //Adds a property to this class definition.
    00188     //<summary>
    00189     FDORDBMS_OV_API virtual void AddProperty(
    00190         FdoRdbmsOvPropertyDefinition* pProp
    00191     ) = 0;
    00192
    00193 /// \cond DOXYGEN-IGNORE
    00194     // Initializes this class override.
    00195     void Init();
    00196 /// \endcond
    00197
    00198 private:
    00199     FdoSmOvTableMappingType mMappingType;
    00200     FdoRdbmsOvPropertiesP mProperties;
    00201     FdoRdbmsOvTableP                         mTable;
    00202
    00203     FdoXmlAttributesP                        mCurrAtts;
    00204     FdoRdbmsOvPropertyDefinition*            mCurrProp;
    00205     FdoRdbmsOvDataPropertyP                  mCurrDataProp;
    00206     FdoRdbmsOvGeometricPropertyP             mCurrGeomProp;
    00207     FdoRdbmsOvObjectPropertyP                mCurrObjProp;
    00208
    00209     // Lists the allowable sub-elements for class definition's XML element
    00210     FdoStringsP                        mElementSubElements;
    00211     // List of Object Property Mapping element.
    00212     FdoStringsP                        mOpSubElements;
    00213 };
    00214
    00215 ///<summary>FdoRdbmsOvClassP is a FdoPtr on FdoRdbmsOvClassDefinition, provided for convenience.</summary>
    00216 typedef FdoPtr<FdoRdbmsOvClassDefinition> FdoRdbmsOvClassP;
    00217
    00218 #endif
    00219
    00220

Please send us your comment about this page