Psi4
liboptions.h
Go to the documentation of this file.
1 /*
2  * @BEGIN LICENSE
3  *
4  * Psi4: an open-source quantum chemistry software package
5  *
6  * Copyright (c) 2007-2017 The Psi4 Developers.
7  *
8  * The copyrights for code used from other parties are included in
9  * the corresponding files.
10  *
11  * This file is part of Psi4.
12  *
13  * Psi4 is free software; you can redistribute it and/or modify
14  * it under the terms of the GNU Lesser General Public License as published by
15  * the Free Software Foundation, version 3.
16  *
17  * Psi4 is distributed in the hope that it will be useful,
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  * GNU Lesser General Public License for more details.
21  *
22  * You should have received a copy of the GNU Lesser General Public License along
23  * with Psi4; if not, write to the Free Software Foundation, Inc.,
24  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25  *
26  * @END LICENSE
27  */
28 
29 #ifndef _psi_src_lib_liboptions_liboptions_hpp
30 #define _psi_src_lib_liboptions_liboptions_hpp
31 
32 #ifdef _POSIX_C_SOURCE
33 #undef _POSIX_C_SOURCE
34 #endif
35 #ifdef _XOPEN_SOURCE
36 #undef _XOPEN_SOURCE
37 #endif
38 
40 #include "psi4/libpsi4util/libpsi4util.h" // Needed for Ref counting, string splitting, and conversions
41 
42 #include <memory>
43 #include <string>
44 #include <vector>
45 #include <map>
46 
47 namespace psi {
48 
50  public:
51  DataTypeException(const std::string& message) : PSIEXCEPTION(message) {}
52 };
53 
54 class IndexException : public PsiException {
55  public:
56  IndexException(const std::string& message)
57  : PSIEXCEPTION(message + " is not a valid option.") {}
58  IndexException(const std::string& message, const std::string& module)
59  : PSIEXCEPTION(message + " is not a valid option for module " + module) {}
60 };
61 
63  public:
64  DuplicateKeyException(const std::string& key, const std::string& type1,
65  const std::string& type2, const char* lfile, int lline)
66  : PsiException("Option " + key + " has been declared as a " + type1 + " and a " + type2,
67  lfile, lline) {}
68 };
69 
71  public:
72  OptionsException(const std::string& message) : PSIEXCEPTION("Options Exception: " + message) {}
73 };
74 
75 class Data;
76 class DataType {
77  bool changed_;
78 
79  public:
80  DataType();
81  virtual ~DataType();
82 
83  bool has_changed() const;
84  void changed();
85  void dechanged();
86 
87  void to_upper(std::string& str);
88 
89  virtual void add_choices(std::string str);
90  virtual std::string type() const;
91 
92  virtual bool is_array() const;
93  virtual size_t size() const;
94  virtual void add(DataType*);
95  virtual void add(std::string, DataType*);
96  virtual void add(bool);
97  virtual void add(int);
98  virtual void add(double);
99  virtual void add(std::string, bool);
100  virtual void add(std::string, std::string);
101  virtual void add(std::string, int);
102  virtual void add(std::string, double);
103  virtual void add(std::string, std::string, std::string);
104 
105  virtual bool exists(std::string);
106 
107  virtual std::string to_string() const;
108  virtual int to_integer() const;
109  virtual double to_double() const;
110 
111  virtual void assign(DataType*);
112  virtual void assign(bool);
113  virtual void assign(int);
114  virtual void assign(double);
115  virtual void assign(std::string);
116 
117  virtual void reset();
118 
119  virtual Data& operator[](std::string);
120  virtual Data& operator[](size_t);
121 };
122 
123 #ifdef __INTEL_COMPILER
124 #pragma warning disable 654
125 #endif
126 class BooleanDataType : public DataType {
127  bool boolean_;
128 
129  public:
130  BooleanDataType();
131  BooleanDataType(bool b);
132  virtual ~BooleanDataType();
133 
134  virtual std::string type() const;
135 
136  virtual std::string to_string() const;
137  virtual int to_integer() const;
138  virtual double to_double() const;
139 
140  virtual void assign(bool b);
141  virtual void assign(int i);
142  virtual void assign(double d);
143  virtual void assign(std::string s);
144 };
145 
146 #ifdef __INTEL_COMPILER
147 #pragma warning disable 654
148 #endif
149 class IntDataType : public DataType {
150  int integer_;
151 
152  public:
153  IntDataType();
154  IntDataType(int i);
155  virtual ~IntDataType();
156 
157  virtual std::string type() const;
158 
159  virtual std::string to_string() const;
160  virtual int to_integer() const;
161  virtual double to_double() const;
162 
163  virtual void assign(bool b);
164  virtual void assign(int i);
165  virtual void assign(double d);
166  virtual void assign(std::string s);
167 };
168 
169 #ifdef __INTEL_COMPILER
170 #pragma warning disable 654
171 #endif
172 class DoubleDataType : public DataType {
173  double double_;
174 
175  public:
176  DoubleDataType();
177  DoubleDataType(double d);
178  virtual ~DoubleDataType();
179 
180  virtual std::string type() const;
181 
182  virtual std::string to_string() const;
183  virtual int to_integer() const;
184  virtual double to_double() const;
185 
186  virtual void assign(bool b);
187  virtual void assign(int i);
188  virtual void assign(double d);
189  virtual void assign(std::string s);
190 };
191 
192 #ifdef __INTEL_COMPILER
193 #pragma warning disable 654
194 #endif
195 class StringDataType : public DataType {
196  std::string str_;
197  std::vector<std::string> choices_;
198 
199  public:
200  StringDataType();
201  StringDataType(std::string s);
202  StringDataType(std::string s, std::string c);
203 
204  virtual ~StringDataType();
205 
206  virtual void add_choices(std::string str);
207 
208  virtual std::string type() const;
209 
210  virtual std::string to_string() const;
211  virtual int to_integer() const;
212  virtual double to_double() const;
213 
214  virtual void assign(bool b);
215  virtual void assign(int i);
216  virtual void assign(double d);
217  virtual void assign(std::string s);
218 };
219 
220 #ifdef __INTEL_COMPILER
221 #pragma warning disable 654
222 #endif
223 class IStringDataType : public DataType {
224  std::string str_;
225  std::vector<std::string> choices_;
226 
227  public:
228  IStringDataType();
229  IStringDataType(std::string s);
230  IStringDataType(std::string s, std::string c);
231  virtual ~IStringDataType();
232 
233  virtual void add_choices(std::string str);
234 
235  virtual std::string type() const;
236 
237  virtual std::string to_string() const;
238  virtual int to_integer() const;
239  virtual double to_double() const;
240 
241  virtual void assign(bool b);
242  virtual void assign(int i);
243  virtual void assign(double d);
244  virtual void assign(std::string s);
245 };
246 
247 class Data {
248  std::shared_ptr<DataType> ptr_;
249 
250  public:
251  Data();
252  Data(DataType* t);
253  Data(const Data& copy);
254 
255  std::string to_string() const;
256  int to_integer() const;
257  double to_double() const;
258 
259  bool is_array() const;
260  size_t size() const;
261 
262  bool has_changed() const;
263 
264  void changed();
265  void dechanged();
266 
267  void add_choices(std::string str);
268 
269  std::string type() const;
270 
271  void add(DataType* data);
272  void add(std::string s, DataType* data);
273  void add(bool b);
274  void add(int i);
275  void add(double d);
276  void add(std::string s, std::string c);
277  void add(std::string key, bool b);
278  void add(std::string key, int i);
279  void add(std::string key, double d);
280  void add(std::string key, std::string s, std::string c);
281 
282  void assign(DataType* data);
283  void assign(bool b);
284  void assign(int i);
285  void assign(double d);
286  void assign(std::string s);
287 
288  void reset();
289 
290  DataType* get() const;
291 
292  Data& operator[](int i);
293  Data& operator[](std::string s);
294 };
295 
296 #ifdef __INTEL_COMPILER
297 #pragma warning disable 654
298 #endif
299 class ArrayType : public DataType {
300  std::vector<Data> array_;
301 
302  public:
303  ArrayType();
304 
305  virtual std::string type() const;
306 
307  virtual void add(DataType* data);
308  virtual void add(bool b);
309  virtual void add(int i);
310  virtual void add(double d);
311  virtual void add(std::string s, std::string c = "");
312  virtual void assign(DataType* data);
313 
314  virtual Data& operator[](size_t i);
315  virtual Data& operator[](std::string s);
316  virtual bool is_array() const;
317 
318  virtual size_t size() const;
319 
320  virtual std::string to_string() const;
321 
322  virtual void reset();
323  std::vector<Data> data() { return array_; }
324 };
325 
326 #ifdef __INTEL_COMPILER
327 #pragma warning disable 654
328 #endif
329 class MapType : public DataType {
330  std::map<std::string, Data> keyvals_;
331  typedef std::map<std::string, Data>::iterator iterator;
332  typedef std::map<std::string, Data>::const_iterator const_iterator;
333 
334  public:
335  MapType();
336 
337  virtual std::string type() const;
338 
339  virtual void add(std::string key, DataType* data);
340  virtual void add(std::string key, bool b);
341  virtual void add(std::string key, int i);
342  virtual void add(std::string key, double d);
343  virtual void add(std::string key, std::string s, std::string c = "");
344 
345  virtual bool exists(std::string key);
346 
347  virtual Data& operator[](std::string s);
348  virtual bool is_array() const;
349 
350  virtual size_t size() const;
351 
352  virtual std::string to_string() const;
353 };
354 
355 class Options {
357 
359  std::map<std::string, Data> all_local_options_;
361  std::string current_module_;
362 
364  std::map<std::string, std::map<std::string, Data> > locals_;
365 
367  std::map<std::string, Data> globals_;
368 
369  typedef std::map<std::string, Data>::iterator iterator;
370  typedef std::map<std::string, Data>::const_iterator const_iterator;
371  typedef std::map<std::string, std::map<std::string, Data> >::const_iterator const_mod_iterator;
372 
373  public:
374  Options();
375 
376  Options& operator=(const Options& rhs);
377  bool read_globals() const;
378  void set_read_globals(bool _b);
379  void set_current_module(const std::string s);
380  std::string get_current_module() const { return current_module_; }
381 
382  void to_upper(std::string& str);
383 
384  void validate_options();
385 
386  void add(std::string key, DataType* data);
387  void add(std::string key, bool b);
388  void add(std::string key, int i);
389  void add(std::string key, double d);
390  void add(std::string key, std::string s, std::string c = "");
391  void add_i(std::string key, std::string s, std::string c = "");
392 
393  void add_bool(std::string key, bool b);
394  void add_int(std::string key, int i);
395  void add_double(std::string key, double d);
396  void add_str(std::string key, std::string s, std::string c = "");
397  void add_str_i(std::string key, std::string s, std::string c = "");
398  void add_array(std::string key);
399  void set_bool(const std::string& module, const std::string& key, bool b);
400  void set_int(const std::string& module, const std::string& key, int i);
401  void set_double(const std::string& module, const std::string& key, double d);
402  void set_str(const std::string& module, const std::string& key, std::string s);
403  void set_str_i(const std::string& module, const std::string& key, std::string s);
404  void set_array(const std::string& module, const std::string& key);
405 
406  void set_global_bool(const std::string& key, bool b);
407  void set_global_int(const std::string& key, int i);
408  void set_global_double(const std::string& key, double d);
409  void set_global_str(const std::string& key, const std::string& s);
410  void set_global_array(const std::string& key);
411 
412  DataType* set_global_array_entry(const std::string& key, DataType* entry, DataType* loc);
413  void set_global_array_double(std::string key, double val, DataType* entry);
414  void set_global_array_string(std::string key, std::string val, DataType* entry);
415  void set_global_array_int(std::string key, int val, DataType* entry);
416  DataType* set_global_array_array(std::string key, DataType* entry);
417  DataType* set_local_array_entry(const std::string& module, const std::string& key,
418  DataType* entry, DataType* loc);
419  void set_local_array_double(const std::string& module, const std::string& key, double val,
420  DataType* entry);
421  void set_local_array_string(const std::string& module, const std::string& key, std::string val,
422  DataType* entry);
423  void set_local_array_int(const std::string& module, const std::string& key, int val,
424  DataType* entry);
425  DataType* set_local_array_array(const std::string& module, const std::string& key,
426  DataType* entry);
427 
428  void clear(void);
429 
430  bool exists_in_active(std::string key);
431 
432  bool exists_in_global(std::string key);
433  bool exists(std::string key);
434 
435  Data& get(std::string key);
436 
437  Data& get(std::map<std::string, Data>& m, std::string& key);
438 
439  Data& get_global(std::string key);
440 
441  Data& get_local(std::string& key);
442 
443  Data& use(std::string& key);
444 
445  Data& use_local(std::string& key);
446 
447  bool get_bool(std::string key);
448  int get_int(std::string key);
449  double get_double(std::string key);
450  std::string get_str(std::string key);
451  int* get_int_array(std::string key);
452  void fill_int_array(std::string key, int* empty_array);
453  std::vector<int> get_int_vector(std::string key);
454  double* get_double_array(std::string key);
455 
456  std::vector<double> get_double_vector(std::string key);
457 
458  const char* get_cstr(std::string key);
459 
460  Data& operator[](std::string key);
461 
462  std::string to_string() const;
463  std::string globals_to_string() const;
464 
465  void print();
466  void print_globals();
467  std::vector<std::string> list_globals();
468 };
469 }
470 #endif
virtual void add(std::string key, DataType *data)
Definition: liboptions.cc:812
bool read_globals() const
Definition: liboptions.cc:895
std::map< std::string, Data >::iterator iterator
Definition: liboptions.h:369
virtual void assign(bool b)
Definition: liboptions.cc:254
std::vector< Data > array_
Definition: liboptions.h:300
bool exists_in_global(std::string key)
Definition: liboptions.cc:1160
virtual int to_integer() const
Definition: liboptions.cc:354
void set_local_array_string(const std::string &module, const std::string &key, std::string val, DataType *entry)
Definition: liboptions.cc:1131
virtual ~IStringDataType()
Definition: liboptions.cc:491
Data & use_local(std::string &key)
Definition: liboptions.cc:1213
std::map< std::string, Data > keyvals_
Definition: liboptions.h:330
IndexException(const std::string &message, const std::string &module)
Definition: liboptions.h:58
void set_global_array(const std::string &key)
Definition: liboptions.cc:1071
double get_double(std::string key)
Definition: liboptions.cc:1332
std::string type() const
Definition: liboptions.cc:620
virtual void assign(bool b)
Definition: liboptions.cc:364
std::vector< Data > data()
Definition: liboptions.h:323
void set_array(const std::string &module, const std::string &key)
Definition: liboptions.cc:1045
Data()
Definition: liboptions.cc:562
void set_str_i(const std::string &module, const std::string &key, std::string s)
Definition: liboptions.cc:1039
std::map< std::string, Data > globals_
&quot;Global&quot; set of options
Definition: liboptions.h:367
virtual void assign(DataType *data)
Definition: liboptions.cc:754
virtual std::string to_string() const
Definition: liboptions.cc:162
void set_global_array_double(std::string key, double val, DataType *entry)
Definition: liboptions.cc:1092
virtual Data & operator[](std::string)
Definition: liboptions.cc:207
virtual std::string type() const
Definition: liboptions.cc:287
std::shared_ptr< DataType > ptr_
Definition: liboptions.h:248
Definition: liboptions.h:247
std::vector< std::string > choices_
Definition: liboptions.h:225
void set_str(const std::string &module, const std::string &key, std::string s)
Definition: liboptions.cc:1033
OptionsException(const std::string &message)
Definition: liboptions.h:72
virtual bool is_array() const
Definition: liboptions.cc:97
std::map< std::string, Data >::const_iterator const_iterator
Definition: liboptions.h:332
virtual int to_integer() const
Definition: liboptions.cc:511
bool has_changed() const
Definition: liboptions.cc:600
void set_global_array_int(std::string key, int val, DataType *entry)
Definition: liboptions.cc:1102
Definition: liboptions.h:62
void set_global_double(const std::string &key, double d)
Definition: liboptions.cc:1061
virtual void add_choices(std::string str)
Definition: liboptions.cc:494
Definition: liboptions.h:172
void set_int(const std::string &module, const std::string &key, int i)
Definition: liboptions.cc:1021
std::string str_
Definition: liboptions.h:196
virtual std::string type() const
Definition: liboptions.cc:807
virtual ~IntDataType()
Definition: liboptions.cc:284
Definition: liboptions.h:149
std::map< std::string, Data > all_local_options_
A temporary map used for validation of local options.
Definition: liboptions.h:359
Definition: liboptions.h:223
virtual Data & operator[](size_t i)
Definition: liboptions.cc:760
Definition: pointgrp.h:106
void dechanged()
Definition: liboptions.cc:76
virtual size_t size() const
Definition: liboptions.cc:782
double * get_double_array(std::string key)
Definition: liboptions.cc:1366
void add_choices(std::string str)
Definition: liboptions.cc:615
void set_global_bool(const std::string &key, bool b)
Definition: liboptions.cc:1051
DataTypeException(const std::string &message)
Definition: liboptions.h:51
void set_local_array_int(const std::string &module, const std::string &key, int val, DataType *entry)
Definition: liboptions.cc:1136
std::map< std::string, Data >::iterator iterator
Definition: liboptions.h:331
std::string globals_to_string() const
Definition: liboptions/print.cc:118
virtual std::string type() const
Definition: liboptions.cc:92
bool changed_
Definition: liboptions.h:77
virtual void add(DataType *)
Definition: liboptions.cc:107
virtual double to_double() const
Definition: liboptions.cc:249
virtual size_t size() const
Definition: liboptions.cc:102
Data & get_local(std::string &key)
Definition: liboptions.cc:1186
Data & operator[](int i)
Definition: liboptions.cc:710
Data & use(std::string &key)
Definition: liboptions.cc:1247
void fill_int_array(std::string key, int *empty_array)
Definition: liboptions.cc:1350
bool exists_in_active(std::string key)
Definition: liboptions.cc:1152
virtual std::string to_string() const
Definition: liboptions.cc:869
void add_bool(std::string key, bool b)
Definition: liboptions.cc:985
StringDataType()
Definition: liboptions.cc:386
virtual void assign(bool b)
Definition: liboptions.cc:435
virtual ~DoubleDataType()
Definition: liboptions.cc:339
virtual void add(DataType *data)
Definition: liboptions.cc:729
virtual double to_double() const
Definition: liboptions.cc:430
DataType * set_global_array_entry(const std::string &key, DataType *entry, DataType *loc)
Definition: liboptions.cc:1077
void set_read_globals(bool _b)
Definition: liboptions.cc:900
std::vector< double > get_double_vector(std::string key)
Definition: liboptions.cc:1375
virtual void assign(bool b)
Definition: liboptions.cc:309
Definition: exception.h:54
void to_upper(std::string &str)
Definition: liboptions.cc:911
void add_i(std::string key, std::string s, std::string c="")
Definition: liboptions.cc:975
int to_integer() const
Definition: liboptions.cc:580
bool has_changed() const
Definition: liboptions.cc:66
bool boolean_
Definition: liboptions.h:127
DoubleDataType()
Definition: liboptions.cc:331
BooleanDataType()
Definition: liboptions.cc:218
IStringDataType()
Definition: liboptions.cc:477
std::map< std::string, Data >::const_iterator const_iterator
Definition: liboptions.h:370
virtual std::string type() const
Definition: liboptions.cc:415
std::vector< int > get_int_vector(std::string key)
Definition: liboptions.cc:1357
void set_local_array_double(const std::string &module, const std::string &key, double val, DataType *entry)
Definition: liboptions.cc:1126
Options()
Definition: liboptions.cc:879
void clear(void)
Definition: liboptions.cc:1146
void reset()
Definition: liboptions.cc:700
int get_int(std::string key)
Definition: liboptions.cc:1327
Options & operator=(const Options &rhs)
Definition: liboptions.cc:883
void dechanged()
Definition: liboptions.cc:610
void set_bool(const std::string &module, const std::string &key, bool b)
Definition: liboptions.cc:1015
virtual std::string to_string() const
Definition: liboptions.cc:292
void add_array(std::string key)
Definition: liboptions.cc:1010
virtual void reset()
Definition: liboptions.cc:202
void to_upper(std::string &str)
Definition: liboptions.cc:81
bool is_array() const
Definition: liboptions.cc:590
void assign(DataType *data)
Definition: liboptions.cc:675
MapType()
Definition: liboptions.cc:804
virtual std::string type() const
Definition: liboptions.cc:724
bool exists(std::string key)
Definition: liboptions.cc:1170
virtual bool is_array() const
Definition: liboptions.cc:859
virtual std::string to_string() const
Definition: liboptions.cc:234
const char * get_cstr(std::string key)
Definition: liboptions.cc:1384
Definition: liboptions.h:126
DataType * set_local_array_array(const std::string &module, const std::string &key, DataType *entry)
Definition: liboptions.cc:1141
Definition: liboptions.h:70
void add_str(std::string key, std::string s, std::string c="")
Definition: liboptions.cc:1000
Definition: liboptions.h:355
virtual double to_double() const
Definition: liboptions.cc:304
virtual std::string type() const
Definition: liboptions.cc:342
void add_double(std::string key, double d)
Definition: liboptions.cc:995
Definition: liboptions.h:329
Definition: liboptions.h:49
void add_int(std::string key, int i)
Definition: liboptions.cc:990
void set_global_str(const std::string &key, const std::string &s)
Definition: liboptions.cc:1066
void add_str_i(std::string key, std::string s, std::string c="")
Definition: liboptions.cc:1005
virtual void reset()
Definition: liboptions.cc:799
virtual void assign(bool b)
Definition: liboptions.cc:521
std::string to_string() const
Definition: liboptions/print.cc:56
void add(DataType *data)
Definition: liboptions.cc:625
virtual void add_choices(std::string str)
Definition: liboptions.cc:407
Data & get_global(std::string key)
Definition: liboptions.cc:1203
std::vector< std::string > list_globals()
Definition: liboptions/print.cc:160
void add(std::string key, DataType *data)
Definition: liboptions.cc:931
Definition: liboptions.h:299
std::string get_current_module() const
Definition: liboptions.h:380
virtual int to_integer() const
Definition: liboptions.cc:299
bool edit_globals_
Definition: liboptions.h:356
Definition: liboptions.h:54
void set_double(const std::string &module, const std::string &key, double d)
Definition: liboptions.cc:1027
virtual std::string to_string() const
Definition: liboptions.cc:347
virtual int to_integer() const
Definition: liboptions.cc:167
std::string to_string() const
Definition: liboptions.cc:575
Definition: liboptions.h:76
std::string current_module_
The module that&#39;s active right now.
Definition: liboptions.h:361
virtual bool exists(std::string)
Definition: liboptions.cc:157
double to_double() const
Definition: liboptions.cc:585
virtual ~StringDataType()
Definition: liboptions.cc:404
virtual double to_double() const
Definition: liboptions.cc:359
virtual ~BooleanDataType()
Definition: liboptions.cc:226
virtual std::string to_string() const
Definition: liboptions.cc:506
void validate_options()
Definition: liboptions.cc:916
DuplicateKeyException(const std::string &key, const std::string &type1, const std::string &type2, const char *lfile, int lline)
Definition: liboptions.h:64
DataType * set_global_array_array(std::string key, DataType *entry)
Definition: liboptions.cc:1107
void print_globals()
Definition: liboptions/print.cc:153
std::string str_
Definition: liboptions.h:224
virtual std::string type() const
Definition: liboptions.cc:229
bool get_bool(std::string key)
Definition: liboptions.cc:1322
virtual std::string to_string() const
Definition: liboptions.cc:420
virtual Data & operator[](std::string s)
Definition: liboptions.cc:851
ArrayType()
Definition: liboptions.cc:721
void changed()
Definition: liboptions.cc:605
void print()
Definition: liboptions/print.cc:110
void set_global_int(const std::string &key, int i)
Definition: liboptions.cc:1056
std::map< std::string, std::map< std::string, Data > >::const_iterator const_mod_iterator
Definition: liboptions.h:371
int * get_int_array(std::string key)
Definition: liboptions.cc:1341
virtual double to_double() const
Definition: liboptions.cc:172
virtual bool exists(std::string key)
Definition: liboptions.cc:842
virtual std::string type() const
Definition: liboptions.cc:501
size_t size() const
Definition: liboptions.cc:595
IntDataType()
Definition: liboptions.cc:276
void set_global_array_string(std::string key, std::string val, DataType *entry)
Definition: liboptions.cc:1097
virtual double to_double() const
Definition: liboptions.cc:516
DataType * set_local_array_entry(const std::string &module, const std::string &key, DataType *entry, DataType *loc)
Definition: liboptions.cc:1112
virtual void add_choices(std::string str)
Definition: liboptions.cc:86
IndexException(const std::string &message)
Definition: liboptions.h:56
virtual ~DataType()
Definition: liboptions.cc:63
#define PSIEXCEPTION(message)
Definition: exception.h:48
virtual void assign(DataType *)
Definition: liboptions.cc:177
std::map< std::string, std::map< std::string, Data > > locals_
&quot;Active&quot; set of options
Definition: liboptions.h:364
int integer_
Definition: liboptions.h:150
std::vector< std::string > choices_
Definition: liboptions.h:197
virtual int to_integer() const
Definition: liboptions.cc:244
Data & operator[](std::string key)
Definition: liboptions.cc:1389
virtual size_t size() const
Definition: liboptions.cc:864
void changed()
Definition: liboptions.cc:71
virtual bool is_array() const
Definition: liboptions.cc:777
DataType()
Definition: liboptions.cc:59
void set_current_module(const std::string s)
Definition: liboptions.cc:905
virtual int to_integer() const
Definition: liboptions.cc:425
double double_
Definition: liboptions.h:173
std::string get_str(std::string key)
Definition: liboptions.cc:1337
virtual std::string to_string() const
Definition: liboptions.cc:787
Definition: liboptions.h:195