00001 // This file is part of ff3d - http://www.freefem.org/ff3d 00002 // Copyright (C) 2001, 2002, 2003 Stéphane Del Pino 00003 00004 // This program is free software; you can redistribute it and/or modify 00005 // it under the terms of the GNU General Public License as published by 00006 // the Free Software Foundation; either version 2, or (at your option) 00007 // any later version. 00008 00009 // This program is distributed in the hope that it will be useful, 00010 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00012 // GNU General Public License for more details. 00013 00014 // You should have received a copy of the GNU General Public License 00015 // along with this program; if not, write to the Free Software Foundation, 00016 // Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00017 00018 // $Id: RunningOptions.hpp,v 1.4 2007/11/20 22:00:04 delpinux Exp $ 00019 00020 #ifndef RUNNING_OPTIONS_HPP 00021 #define RUNNING_OPTIONS_HPP 00022 00023 #include <StaticBase.hpp> 00024 00035 class RunningOptions 00036 : public StaticBase<RunningOptions> 00037 { 00038 private: 00039 bool __haveDisplay; 00040 bool __useGUI; 00041 bool __pauseOnError; 00043 size_t __verbosity; 00045 public: 00051 void setVerbosity(const size_t& verbosity) 00052 { 00053 __verbosity = verbosity; 00054 } 00055 00061 const size_t& getVerbosity() 00062 { 00063 return __verbosity; 00064 } 00065 00071 const bool& haveDisplay() const 00072 { 00073 return __haveDisplay; 00074 } 00075 00081 const bool& useGUI() const 00082 { 00083 return __useGUI; 00084 } 00085 00091 const bool& pauseOnError() const 00092 { 00093 return __pauseOnError; 00094 } 00095 00102 void setDisplay(const bool& b) 00103 { 00104 __haveDisplay = b; 00105 __useGUI = b; 00106 } 00107 00113 void setGUI(const bool& b) 00114 { 00115 if (__haveDisplay) { 00116 __useGUI = b; 00117 } else { 00118 __useGUI = false; 00119 } 00120 } 00121 00127 void setNoPauseOnError() 00128 { 00129 __pauseOnError = false; 00130 } 00131 00136 RunningOptions() 00137 : __haveDisplay(false), 00138 __useGUI(false), 00139 __pauseOnError(true) 00140 { 00141 ; 00142 } 00143 00148 ~RunningOptions() 00149 { 00150 ; 00151 } 00152 }; 00153 00154 #endif // RUNNING_OPTIONS_HPP
1.5.6