DatabaseManager.h

Go to the documentation of this file.
00001  /***************************************************************************
00002  * File:        ./DatabaseManager.h
00003  * Author:      Ronni Grapenthin, NORVULK & HU-BERLIN
00004  * Created:     24.04.2007
00005  * Licence:     GPLv2
00006  *
00007  * #########################################################################
00008  *
00009  * CrusDe, simulation framework for crustal deformation studies
00010  * Copyright (C) 2007 Ronni Grapenthin
00011  *
00012  * This program is free software; you can redistribute it and/or
00013  * modify it under the terms of the GNU General Public License
00014  * as published by the Free Software Foundation; version 2
00015  * of the License.
00016  *
00017  * This program is distributed in the hope that it will be useful,
00018  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00019  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00020  * GNU General Public License for more details.
00021  *
00022  * You should have received a copy of the GNU General Public License
00023  * along with this program; if not, write to the Free Software
00024  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
00025  *
00026  ****************************************************************************/
00027 
00028 #ifndef _database_manager_h
00029 #define _database_manager_h
00030 
00031 #include <string>
00032 #include <iostream>
00033 #include <map>
00034 
00035 #include "exceptions.h"
00036 #include "XMLHandler.h"
00037 
00038 using namespace std;
00039 
00043 class DatabaseManager : public XMLHandler
00044 {
00045 
00046         private:
00048                 DatabaseManager(const DatabaseManager& x); 
00049 
00050         protected:
00051                 bool is_initialized;            
00052                 int last_id;            
00053 
00054                                 
00055         public:         
00056                 DatabaseManager(const char* path);      /* Constructor */
00057                 virtual ~DatabaseManager(){};   /* Destructor */
00058 
00059         //abstract member functions
00061                 virtual void run() = 0;
00063                 virtual void addEntry(string ident, DOMNode* parent=0) = 0;
00065                 virtual string getEntryDetails(int) = 0;
00067                 virtual multimap<string, map<int, string> > getEntryMap()=0;
00069                 virtual bool deleteEntry(int) = 0;
00070 
00071         //implemented member functions          
00073                 virtual void init();
00075                 string getDBName();
00077                 int getLastAddedID();
00078 };
00079 
00080 #endif // _database_manager_h

Generated on Sun Aug 31 13:18:59 2008 for CrusDe by  doxygen 1.5.0