00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef argList_H
00034 #define argList_H
00035
00036 #include "stringList.H"
00037 #include "SLList.H"
00038 #include "HashTable.H"
00039 #include "word.H"
00040 #include "fileName.H"
00041 #include "parRun.H"
00042 #include "sigFpe.H"
00043 #include "sigInt.H"
00044 #include "sigQuit.H"
00045 #include "sigSegv.H"
00046
00047
00048
00049 namespace Foam
00050 {
00051
00052
00053
00054 class argList
00055 {
00056
00057
00058 stringList args_;
00059 HashTable<string> options_;
00060
00061 word executable_;
00062 fileName rootPath_;
00063 fileName globalCase_;
00064 fileName case_;
00065 bool parRun_;
00066
00067 ParRunControl parRunControl_;
00068
00069
00070 sigFpe sigFpe_;
00071 sigInt sigInt_;
00072 sigQuit sigQuit_;
00073 sigSegv sigSegv_;
00074
00075
00076
00077
00078 int findArg(const string& arg);
00079
00080
00081 public:
00082
00083
00084
00085 static SLList<string> validArgs;
00086 static HashTable<string> validOptions;
00087 static HashTable<string> validParOptions;
00088
00089 class initValidTables
00090 {
00091 public:
00092
00093 initValidTables();
00094 };
00095
00096
00097
00098
00099
00100 argList(int& argc, char**& argv);
00101
00102
00103
00104
00105 virtual ~argList();
00106
00107
00108
00109
00110
00111
00112
00113 const stringList& args() const
00114 {
00115 return args_;
00116 }
00117
00118
00119 const HashTable<string>& options() const
00120 {
00121 return options_;
00122 }
00123
00124
00125 const word& executable() const
00126 {
00127 return executable_;
00128 }
00129
00130
00131 const fileName& rootPath() const
00132 {
00133 return rootPath_;
00134 }
00135
00136
00137 const fileName& globalCaseName() const
00138 {
00139 return globalCase_;
00140 }
00141
00142
00143
00144 const fileName& caseName() const
00145 {
00146 return case_;
00147 }
00148
00149
00150 fileName path() const
00151 {
00152 return rootPath()/caseName();
00153 }
00154
00155
00156 bool parRun() const
00157 {
00158 return parRun_;
00159 }
00160
00161
00162
00163
00164
00165 static void noParallel();
00166
00167
00168
00169
00170
00171 void printUsage() const;
00172
00173
00174
00175
00176
00177 bool check() const;
00178
00179
00180 bool checkRootCase() const;
00181 };
00182
00183
00184
00185
00186 }
00187
00188
00189
00190 #endif
00191
00192