ConvFactorPlugin.h

Go to the documentation of this file.
00001 /*************************************************************************** 00002 * File: ./ConvFactorPlugin.h 00003 * Author: Ronni Grapenthin, NORVULK & HU-BERLIN 00004 * Created: 09.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 _conv_factor_plugin_h 00029 #define _conv_factor_plugin_h 00030 00031 #include "Plugin.h" 00032 #include "constants.h" 00033 #include "config.h" 00034 #include <iostream> 00035 #include <cassert> 00036 #include <dlfcn.h> 00037 00038 using namespace std; 00039 00040 typedef double (*value_t)(int, int, int); 00041 typedef int (*value_array_t)(double**, int, int, int); 00042 00046 class LoadPlugin : public Plugin 00047 { 00048 00049 private: 00050 value_t func_value; /* Pointer to loaded routine */ 00051 00053 LoadPlugin(const LoadPlugin& x); 00054 00055 public: 00056 LoadPlugin(const string=NULL); /* Constructor */ 00057 virtual ~LoadPlugin(); /* Destructor */ 00058 00059 virtual void load(const string) throw (FileNotFound, LibHandleError); 00060 // virtual void selftest(); 00061 00062 /*plug - in interface*/ 00063 double getValueAt(int, int, int=NO_TIME); 00064 00065 /*get pointers to exec functions*/ 00066 load_exec_function getValueFunction(); 00067 }; 00068 00069 class GreenPlugin : public Plugin 00070 { 00071 00072 private: 00073 value_array_t func_value_array; /* Pointer to loaded routine */ 00074 00076 GreenPlugin(const GreenPlugin& x); 00077 00078 public: 00079 GreenPlugin(const string=NULL); /* Constructor */ 00080 virtual ~GreenPlugin(); /* Destructor */ 00081 00082 virtual void load(const string) throw (FileNotFound, LibHandleError); 00083 // virtual void selftest(); 00084 00085 /*plug - in interface*/ 00086 int getValueArrayAt(double**, int, int, int=NO_TIME); 00087 00088 /*get pointers to exec function*/ 00089 green_exec_function getArrayFunction(); 00090 }; 00091 00092 #endif // _conv_factor_plugin_h

Generated on Sun Jul 29 08:17:23 2007 for CrusDe by doxygen 1.3.8