00001 /* -*- c++ -*- 00002 * __BEGIN_COPYRIGHT 00003 * SimpleDB API 00004 * 00005 * Copyright (C) 2005 Eminence Technology Pty Ltd 00006 * 00007 * This library is free software; you can redistribute it and/or 00008 * modify it under the terms of the GNU Lesser General Public 00009 * License as published by the Free Software Foundation; either 00010 * version 2.1 of the License, or (at your option) any later version. 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 can view the GNU Lesser General Public Licence at 00018 * http://www.gnu.org/licenses/lgpl.html or you can write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * Eminence Technology Pty Ltd can be contacted by writing to 00022 * Eminence Technology, PO Box 118, Moorooka QLD 4105, Australia. 00023 * Alternatively, you may email opensource [at] eminence [dot] com [dot] au 00024 * __END_COPYRIGHT 00025 */ 00026 00027 #ifndef __SIMPLEDB_FACTORY_H_ 00028 #define __SIMPLEDB_FACTORY_H_ 00029 00030 #include "Database.h" 00031 #include <memory> 00032 00033 namespace SimpleDB { 00034 00046 class SimpleDBFactory { 00047 public: 00050 static SimpleDBFactory* Instance() ; 00051 00056 static std::auto_ptr<Database> getDBHandle(const std::string dsn); 00057 00060 static void Kill () ; 00061 protected: 00062 00065 SimpleDBFactory() {}; 00066 00070 static SimpleDBFactory* _instance ; 00071 }; 00072 }; 00073 #endif