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 bool guiMode; 00051 00052 protected: 00053 bool is_initialized; 00054 int last_id; 00055 00056 public: 00057 DatabaseManager(const char* path); /* Constructor */ 00058 virtual ~DatabaseManager(){}; /* Destructor */ 00059 00060 //abstract member functions 00062 virtual void run() = 0; 00064 virtual void addEntry(string ident, DOMNode* parent=0) = 0; 00066 virtual string getEntryDetails(int) = 0; 00068 virtual multimap<string, map<int, string> > getEntryMap()=0; 00070 virtual bool deleteEntry(int) = 0; 00071 00072 //implemented member functions 00074 virtual void init(); 00076 string getDBName(); 00078 int getLastAddedID(); 00080 void runDialogWindow(string, bool); 00082 bool inGuiMode(); 00083 }; 00084 00085 #endif // _database_manager_h