00001 /*************************************************************************** 00002 * File: ./ParamWrapper.h 00003 * Author: Ronni Grapenthin, Geophysical Institute, UAF 00004 * Created: 2008-02-27 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 param_wrapper_h 00029 #define param_wrapper_h 00030 00031 #include <iostream> 00032 #include <string> 00033 00034 #include <string.h> 00035 00036 using namespace std; 00037 00042 class ParamWrapper 00043 { 00044 00045 private: 00046 string *string_param; 00047 double *double_param; 00048 00049 bool optional; 00050 char* cStr; 00051 00052 public: 00053 ParamWrapper(); /* Constructor */ 00054 00055 ~ParamWrapper(); /* Destructor */ 00056 00057 bool isString(); 00058 bool isDouble(); 00059 00060 void setValue(string); 00061 void setValue(double); 00062 00063 char** newString(char* = NULL); 00064 double* newDouble(double = 0.0); 00065 00066 char** stringValue(); 00067 double* doubleValue(); 00068 00069 bool isOptional(); 00070 void setOptional(bool); 00071 00072 }; 00073 00074 00075 #endif // param_wrapper_h