FDO API Reference Feature Data Objects

PhysicalClassMapping.h

Go to the documentation of this file.
00001 #ifndef FDO_PHYSICALCLASSMAPPING_H
00002 #define FDO_PHYSICALCLASSMAPPING_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 #include <Fdo/Commands/Schema/PhysicalElementMapping.h>
00030 
00031 class FdoPhysicalSchemaMapping;
00032 class FdoXmlFlags;
00033 
00034 /// \brief
00035 /// FdoPhysicalClassMapping is an abstract class that acts as a base class for all 
00036 /// Physical Schema Mapping class overrides.
00037 class FdoPhysicalClassMapping : 
00038     public FdoPhysicalElementMapping
00039 {
00040 public:
00041     /// \brief
00042     /// Initializes this class from its XML attributes. Called when
00043     /// the class is deserialized from XML. This function decodes any
00044     /// encoded class names (See _writeXml) and strips off the "Type" suffix if present.
00045     /// Can be extended to handle 
00046     /// particular XML attributes for derived classes.
00047     /// 
00048     /// \param pContext 
00049     /// Input context contain information about the current deserialization operation
00050     /// \param attrs 
00051     /// Input the XML attributes.
00052     /// 
00053     /// \return
00054     /// Returns nothing
00055     /// 
00056     FDO_API virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs);
00057 
00058     /// \brief
00059     /// Writes this class to XML. Called when
00060     /// the class is serialized to XML. This function converts (encodes) 
00061     /// class names to be valid XML element names and appends the "Type"
00062     /// suffix to the name. Can be extended to handle 
00063     /// particular XML attributes for derived classes.
00064     /// \note
00065     /// Schema Override elements that do not require name encoding
00066     /// should be based on FdoPhysicalElementMapping instead of this class.
00067     /// 
00068     /// \param xmlWriter 
00069     /// Input write the class to this XML writer
00070     /// \param flags 
00071     /// Input flags that control the writing of the class.
00072     /// 
00073     /// \return
00074     /// Returns nothing
00075     /// 
00076     /// Write this element to XML.
00077     FDO_API virtual void _writeXml(
00078         FdoXmlWriter* xmlWriter, 
00079         const FdoXmlFlags* flags
00080     );
00081 
00082 protected:
00083     /// \brief
00084     /// Constructs a default instance of a class mapping.
00085     /// 
00086     FDO_API FdoPhysicalClassMapping(); 
00087 
00088     /// \brief
00089     /// Constructs a named instance of a class mapping.
00090     /// 
00091     /// \param name 
00092     /// Input the class name
00093     /// 
00094     FDO_API FdoPhysicalClassMapping( FdoString* name );
00095 
00096     /// \brief
00097     /// Class mapping destructor.
00098     /// 
00099     FDO_API virtual ~FdoPhysicalClassMapping();
00100 
00101 };
00102 
00103 /// \brief
00104 /// FdoPhysicalClassMappingP is a FdoPtr on FdoPhysicalClassMapping, provided for convenience.
00105 typedef FdoPtr<FdoPhysicalClassMapping> FdoPhysicalClassMappingP;
00106 
00107 #endif
00108 
00109 

Comments or suggestions? Send us feedback.