dataproviderfactory.cpp

Go to the documentation of this file.
00001 /*
00002  *  The Mana World Server
00003  *  Copyright 2004 The Mana World Development Team
00004  *
00005  *  This file is part of The Mana World.
00006  *
00007  *  The Mana World  is free software; you can redistribute  it and/or modify it
00008  *  under the terms of the GNU General  Public License as published by the Free
00009  *  Software Foundation; either version 2 of the License, or any later version.
00010  *
00011  *  The Mana  World is  distributed in  the hope  that it  will be  useful, but
00012  *  WITHOUT ANY WARRANTY; without even  the implied warranty of MERCHANTABILITY
00013  *  or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
00014  *  more details.
00015  *
00016  *  You should  have received a  copy of the  GNU General Public  License along
00017  *  with The Mana  World; if not, write to the  Free Software Foundation, Inc.,
00018  *  59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00019  *
00020  *  $Id: dataproviderfactory.cpp 2475 2006-07-27 17:20:22Z gmelquio $
00021  */
00022 
00023 
00024 #include "dataproviderfactory.h"
00025 
00026 #if defined (MYSQL_SUPPORT)
00027 #include "mysqldataprovider.h"
00028 #elif defined (POSTGRESQL_SUPPORT)
00029 #include "pqdataprovider.h"
00030 #elif defined (SQLITE_SUPPORT)
00031 #include "sqlitedataprovider.h"
00032 #else
00033 #error "no database backend defined"
00034 #endif
00035 
00036 namespace dal
00037 {
00038 
00039 
00043 DataProviderFactory::DataProviderFactory(void)
00044     throw()
00045 {
00046     // NOOP
00047 }
00048 
00049 
00053 DataProviderFactory::~DataProviderFactory(void)
00054     throw()
00055 {
00056     // NOOP
00057 }
00058 
00059 
00063 DataProvider*
00064 DataProviderFactory::createDataProvider(void)
00065 {
00066 #if defined (MYSQL_SUPPORT)
00067     MySqlDataProvider* provider = new MySqlDataProvider;
00068     return provider;
00069 #elif defined (POSTGRESQL_SUPPORT)
00070     PqDataProvider *provider = new PqDataProvider;
00071     return provider;
00072 #else // SQLITE_SUPPORT
00073     SqLiteDataProvider* provider = new SqLiteDataProvider;
00074     return provider;
00075 #endif
00076 }
00077 
00078 
00079 } // namespace dal

Generated on Fri Mar 30 15:39:16 2007 for TMW Server by  doxygen 1.3.9.1