00001 /*************************************************************************** 00002 * File: ./PluginManager.h 00003 * Author: Ronni Grapenthin, NORVULK & HU-BERLIN 00004 * Created: 28.03.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 _plugin_manager_h 00029 #define _plugin_manager_h 00030 00031 #include "DatabaseManager.h" 00032 #include "XMLHandler.h" 00033 #include "exceptions.h" 00034 #include "Plugin.h" 00035 00036 #include <string> 00037 #include <iostream> 00038 #include <cassert> 00039 #include <dlfcn.h> 00040 #include <map> 00041 00042 using namespace std; 00043 00047 class PluginManager : public DatabaseManager 00048 { 00049 00050 private: 00051 Plugin plugin; 00054 PluginManager(const PluginManager& x); 00055 00056 DOMNode* isInDB(string, string); 00057 void addToDB(string filename, string dst); 00058 DOMNode* getEntryById(int id); 00059 DOMNode* getEntryById(int id, const XMLCh* tag); 00060 list<DOMNode*> getDependents(DOMNode *entry); 00061 list<string> getDependencies(DOMNode *entry); 00062 list<string> getParameters(DOMNode *entry); 00063 00064 public: 00065 PluginManager(const char* path); /* Constructor */ 00066 virtual ~PluginManager(){}; /* Destructor */ 00067 00069 virtual bool deleteEntry(int id) throw (DatabaseError, PluginError); 00071 virtual void run(); 00073 virtual multimap<string, map<int, string> > getEntryMap(); 00075 virtual string getEntryDetails(int id); 00077 virtual void addEntry(string absolutepath, DOMNode *parent=0) throw (PluginExistsException); /* ... */ 00078 00079 string getFilename(string, string) throw (DatabaseError); 00080 00081 }; 00082 00083 #endif // _plugin_manager_h