00001 #ifndef FDO_MySQLOVPHYSICALSCHEMAMAPPING_H
00002 #define FDO_MySQLOVPHYSICALSCHEMAMAPPING_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 #include <Rdbms/Override/RdbmsOvPhysicalSchemaMapping.h>
00021 #include <Rdbms/Override/MySQL/MySqlOv.h>
00022 #include <Rdbms/Override/MySQL/MySqlOvClassCollection.h>
00023 #include <Rdbms/Override/MySQL/MySqlOvStorageEngineType.h>
00024
00025 /// \brief
00026 /// Concrete class offering schema overrides for
00027 /// the MySQL Provider.
00028 class FdoMySQLOvPhysicalSchemaMapping : public FdoRdbmsOvPhysicalSchemaMapping
00029 {
00030
00031 public:
00032
00033 /// \brief
00034 /// Constructs a default of an FdoMySQLOvPhysicalSchemaMapping
00035 ///
00036 /// \return
00037 /// Returns FdoMySQLOvPhysicalSchemaMapping
00038 ///
00039 FDOMYSQL_OV_API static FdoMySQLOvPhysicalSchemaMapping* Create();
00040
00041 /// \brief
00042 /// Constructs an instance of an FdoMySQLOvPhysicalSchemaMapping using the specified arguments
00043 ///
00044 /// \param name
00045 /// Input name
00046 ///
00047 /// \return
00048 /// Returns FdoMySQLOvPhysicalSchemaMapping
00049 ///
00050 FDOMYSQL_OV_API static FdoMySQLOvPhysicalSchemaMapping* Create(FdoString* name);
00051
00052 /// \brief
00053 /// Gets the classes
00054 ///
00055 /// \return
00056 /// Returns the classes
00057 ///
00058 FDOMYSQL_OV_API FdoMySQLOvClassCollection* GetClasses();
00059
00060 /// \brief
00061 /// Gets the directory where table data is stored
00062 ///
00063 /// \return
00064 /// Returns the directory where table data is stored
00065 ///
00066 FDOMYSQL_OV_API FdoString *GetDataDirectory();
00067
00068 /// \brief
00069 /// Sets the directory where table data is stored
00070 ///
00071 /// \return
00072 /// Returns nothing
00073 ///
00074 FDOMYSQL_OV_API void SetDataDirectory(FdoString *dataDirectory);
00075
00076 /// \brief
00077 /// Gets the directory where indexes are stored
00078 ///
00079 /// \return
00080 /// Returns the directory where indexes are stored
00081 ///
00082 FDOMYSQL_OV_API FdoString *GetIndexDirectory();
00083
00084 /// \brief
00085 /// Sets the directory where indexes are stored
00086 ///
00087 /// \return
00088 /// Returns nothing
00089 ///
00090 FDOMYSQL_OV_API void SetIndexDirectory(FdoString *indexDirectory);
00091
00092 /// \brief
00093 /// Gets the storage engine type
00094 ///
00095 /// \return
00096 /// Returns the storage engine type
00097 ///
00098 FDOMYSQL_OV_API MySQLOvStorageEngineType GetStorageEngine();
00099
00100 /// \brief
00101 /// Sets the storage engine type
00102 ///
00103 /// \return
00104 /// Returns nothing
00105 ///
00106 FDOMYSQL_OV_API void SetStorageEngine(MySQLOvStorageEngineType storageEngine);
00107
00108 /// \brief
00109 /// Gets the database
00110 ///
00111 /// \return
00112 /// Returns the database
00113 ///
00114 FDOMYSQL_OV_API FdoString *GetDatabase();
00115
00116 /// \brief
00117 /// Sets the database
00118 ///
00119 /// \return
00120 /// Returns nothing
00121 ///
00122 FDOMYSQL_OV_API void SetDatabase(FdoString *database);
00123
00124 /// \brief
00125 /// Gets the provider name
00126 ///
00127 /// \return
00128 /// Returns the provider name
00129 ///
00130 FDOMYSQL_OV_API virtual FdoString *GetProvider(void);
00131
00132 /// \cond DOXYGEN-IGNORE
00133
00134 /// XML Serialization functions, not part of API.
00135
00136 /// Serialize this property to XML.
00137 virtual void _writeXmlAttributes(FdoXmlWriter* xmlWriter, const FdoXmlFlags* flags);
00138
00139 /// Initialize this element from its XML attributes
00140 virtual void InitFromXml(FdoXmlSaxContext* pContext, FdoXmlAttributeCollection* attrs);
00141
00142 /// \endcond
00143
00144 protected:
00145 FdoMySQLOvPhysicalSchemaMapping();
00146 FdoMySQLOvPhysicalSchemaMapping(FdoString* name);
00147 virtual ~FdoMySQLOvPhysicalSchemaMapping();
00148 virtual void Dispose();
00149
00150 /// Create a class override from XML attributes
00151 virtual FdoRdbmsOvClassDefinition* CreateClass(
00152 FdoXmlSaxContext* context,
00153 FdoXmlAttributeCollection* atts
00154 );
00155
00156 /// Add the given class override to this schema override set
00157 virtual void AddClass(
00158 FdoRdbmsOvClassDefinition* pClass
00159 );
00160
00161 /// common initializer for all constructors:
00162 void Init();
00163
00164 private:
00165 FdoMySQLOvClassesP mClasses;
00166 FdoStringP mDataDirectory;
00167 FdoStringP mIndexDirectory;
00168 MySQLOvStorageEngineType mStorageEngine;
00169 FdoStringP mDatabase;
00170 };
00171
00172 /// \brief
00173 /// FdoMySQLOvSchemaMappingP is a FdoPtr on FdoMySQLOvPhysicalSchemaMapping, provided for convenience.
00174 typedef FdoPtr<FdoMySQLOvPhysicalSchemaMapping> FdoMySQLOvSchemaMappingP;
00175
00176 #endif
00177
00178