WORM 0.2
A C++ DAL/ORM code generation framework

src/sql/wsqldabatasemanager.h

Go to the documentation of this file.
00001 /*
00002     WORM - a DAL/ORM code generation framework
00003     Copyright (C) 2011  Erik Winn <erikwinnmail@yahoo.com>
00004 
00005     This program is free software: you can redistribute it and/or modify
00006     it under the terms of the GNU General Public License as published by
00007     the Free Software Foundation, either version 3 of the License, or
00008     (at your option) any later version.
00009 
00010     This program is distributed in the hope that it will be useful,
00011     but WITHOUT ANY WARRANTY; without even the implied warranty of
00012     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013     GNU General Public License for more details.
00014 
00015     You should have received a copy of the GNU General Public License
00016     along with this program.  If not, see <http://www.gnu.org/licenses/>.
00017 */
00018 
00019 
00020 #ifndef WSQLDABATASEMANAGER_H
00021 #define WSQLDABATASEMANAGER_H
00022 
00023 #include <string>
00024 #include <vector>
00025 #include "wsqldatabase.h"
00026 namespace WSql
00027 {
00028 
00029 class WSqlDabataseManager
00030 {
00031 
00032     public:
00033         WSqlDabataseManager();
00034         WSqlDabataseManager( const WSqlDabataseManager& other );
00035         virtual ~WSqlDabataseManager();
00036         virtual WSqlDabataseManager& operator=( const WSqlDabataseManager& other );
00037         virtual bool operator==( const WSqlDabataseManager& other ) const;
00038 
00039         void add( WSqlDabatase &db );
00040         void remove( WSqlDabatase &db );
00041         void remove( int index );
00042         void remove( std::string db_name );
00043 
00044         WSqlDabatase& get( int index );
00045         WSqlDabatase& get( std::string db_name );
00046 
00047         static WSqlDatabase addDatabase( WSqlDriver* driver,
00048                                          const std::string& connectionName = defaultConnection );
00049         static WSqlDatabase cloneDatabase( const WSqlDatabase &other, const std::string& connectionName );
00050         static WSqlDatabase database( const std::string& connectionName = defaultConnection,
00051                                       bool open = true );
00052         static void removeDatabase( const std::string& connectionName );
00053         static bool contains( const std::string& connectionName = defaultConnection );
00054         static std::vector<std::string> drivers();
00055         static std::vector <std::string> connectionNames();
00056 
00057 
00058     private:
00059 
00060 };
00061 
00062 }//namespace WSql
00063 
00064 #endif // WSQLDABATASEMANAGER_H
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Defines