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 #include <string>
33 #include <vector>
34 #include <map>
35 // Forward boost python object
36 #ifdef _POSIX_C_SOURCE
37 #undef _POSIX_C_SOURCE
38 #endif
39 #ifdef _XOPEN_SOURCE
40 #undef _XOPEN_SOURCE
41 #endif
42 
44 #include "psi4/libpsi4util/libpsi4util.h" // Needed for Ref counting, string splitting, and conversions
45 #include "psi4/libpsi4util/ref.h" // Needed for Ref counting, string splitting, and conversions
46 #include "psi4/pybind11.h"
47 
48 namespace psi {
49 
51 {
52 public:
53  DataTypeException(const std::string& message) : PSIEXCEPTION(message) { }
54 };
55 
57 {
58 public:
59  IndexException(const std::string& message) : PSIEXCEPTION(message + " is not a valid option.") { }
60  IndexException(const std::string& message, const std::string &module) :
61  PSIEXCEPTION(message + " is not a valid option for module " + module) { }
62 };
63 
65 {
66 public:
67  DuplicateKeyException(const std::string &key, const std::string &type1, const std::string &type2,
68  const char *lfile, int lline):
69  PsiException("Option " + key + " has been declared as a " + type1 + " and a " + type2, lfile, lline) { }
70 };
71 
73 {
74 public:
75  OptionsException(const std::string& message) : PSIEXCEPTION("Options Exception: " + message) { }
76 };
77 
78 class Data;
79 class DataType
80 {
81  bool changed_;
82 public:
83  DataType();
84  virtual ~DataType();
85 
86  bool has_changed() const;
87  void changed();
88  void dechanged();
89 
90  void to_upper(std::string& str);
91 
92  virtual void add_choices(std::string str);
93  virtual std::string type() const;
94 
95  virtual bool is_array() const;
96  virtual unsigned int size() const;
97  virtual void add(DataType *);
98  virtual void add(std::string, DataType*);
99  virtual void add(bool);
100  virtual void add(int);
101  virtual void add(double);
102  virtual void add(std::string, bool);
103  virtual void add(std::string, std::string);
104  virtual void add(std::string, int);
105  virtual void add(std::string, double);
106  virtual void add(std::string, std::string, std::string);
107 
108  virtual bool exists(std::string);
109 
110  virtual std::string to_string() const;
111  virtual int to_integer() const;
112  virtual double to_double() const;
113  virtual py::list to_list() const;
114 
115  virtual void assign(DataType*);
116  virtual void assign(bool);
117  virtual void assign(int);
118  virtual void assign(double);
119  virtual void assign(std::string);
120 
121  virtual void reset();
122 
123  virtual Data& operator[](std::string);
124  virtual Data& operator[](unsigned int);
125 };
126 
127 #ifdef __INTEL_COMPILER
128 #pragma warning disable 654
129 #endif
130 class BooleanDataType : public DataType
131 {
132  bool boolean_;
133 public:
134  BooleanDataType();
135  BooleanDataType(bool b);
136  virtual ~BooleanDataType();
137 
138  virtual std::string type() const;
139 
140  virtual std::string to_string() const;
141  virtual int to_integer() const;
142  virtual double to_double() const;
143 
144  virtual void assign(bool b);
145  virtual void assign(int i);
146  virtual void assign(double d);
147  virtual void assign(std::string s);
148 };
149 
150 #ifdef __INTEL_COMPILER
151 #pragma warning disable 654
152 #endif
153 class IntDataType : public DataType
154 {
155  int integer_;
156 public:
157  IntDataType();
158  IntDataType(int i);
159  virtual ~IntDataType();
160 
161  virtual std::string type() const;
162 
163  virtual std::string to_string() const;
164  virtual int to_integer() const;
165  virtual double to_double() const;
166 
167  virtual void assign(bool b);
168  virtual void assign(int i);
169  virtual void assign(double d);
170  virtual void assign(std::string s);
171 };
172 
173 #ifdef __INTEL_COMPILER
174 #pragma warning disable 654
175 #endif
176 class DoubleDataType : public DataType
177 {
178  double double_;
179 public:
180  DoubleDataType();
181  DoubleDataType(double d);
182  virtual ~DoubleDataType();
183 
184  virtual std::string type() const;
185 
186  virtual std::string to_string() const;
187  virtual int to_integer() const;
188  virtual double to_double() const;
189 
190  virtual void assign(bool b);
191  virtual void assign(int i);
192  virtual void assign(double d);
193  virtual void assign(std::string s);
194 };
195 
196 #ifdef __INTEL_COMPILER
197 #pragma warning disable 654
198 #endif
199 class StringDataType : public DataType
200 {
201  std::string str_;
202  std::vector<std::string> choices_;
203 public:
204  StringDataType();
205  StringDataType(std::string s);
206  StringDataType(std::string s, std::string c);
207 
208  virtual ~StringDataType();
209 
210  virtual void add_choices(std::string str);
211 
212  virtual std::string type() const;
213 
214  virtual std::string to_string() const;
215  virtual int to_integer() const;
216  virtual double to_double() const;
217 
218  virtual void assign(bool b);
219  virtual void assign(int i);
220  virtual void assign(double d);
221  virtual void assign(std::string s);
222 };
223 
224 #ifdef __INTEL_COMPILER
225 #pragma warning disable 654
226 #endif
227 class IStringDataType : public DataType
228 {
229  std::string str_;
230  std::vector<std::string> choices_;
231 public:
232  IStringDataType();
233  IStringDataType(std::string s);
234  IStringDataType(std::string s, std::string c);
235  virtual ~IStringDataType();
236 
237  virtual void add_choices(std::string str);
238 
239  virtual std::string type() const;
240 
241  virtual std::string to_string() const;
242  virtual int to_integer() const;
243  virtual double to_double() const;
244 
245  virtual void assign(bool b);
246  virtual void assign(int i);
247  virtual void assign(double d);
248  virtual void assign(std::string s);
249 };
250 
251 class Data
252 {
254 public:
255  Data();
256  Data(DataType *t);
257  Data(const Data& copy);
258 
259  std::string to_string() const;
260  int to_integer() const;
261  double to_double() const;
262  py::list to_list() const;
263 
264  bool is_array() const;
265  unsigned int size() const;
266 
267  bool has_changed() const;
268 
269  void changed();
270  void dechanged();
271 
272  void add_choices(std::string str);
273 
274  std::string type() const;
275 
276  void add(DataType *data);
277  void add(std::string s, DataType *data);
278  void add(bool b);
279  void add(int i);
280  void add(double d);
281  void add(std::string s, std::string c);
282  void add(std::string key, bool b);
283  void add(std::string key, int i);
284  void add(std::string key, double d);
285  void add(std::string key, std::string s, std::string c);
286 
287  void assign(DataType *data);
288  void assign(bool b);
289  void assign(int i);
290  void assign(double d);
291  void assign(std::string s);
292 
293  void reset();
294 
295  DataType* get() const;
296 
297  Data& operator[](int i);
298  Data& operator[](std::string s);
299 };
300 
301 #ifdef __INTEL_COMPILER
302 #pragma warning disable 654
303 #endif
304 class ArrayType : public DataType
305 {
306  std::vector<Data> array_;
307 public:
308  ArrayType();
309 
310  virtual std::string type() const;
311 
312  virtual void add(DataType *data);
313  virtual void add(bool b);
314  virtual void add(int i);
315  virtual void add(double d);
316  virtual void add(std::string s, std::string c = "");
317  virtual void assign(DataType* data);
318 
319  virtual Data& operator[](unsigned int i);
320  virtual Data& operator[](std::string s);
321  virtual bool is_array() const;
322 
323  virtual unsigned int size() const;
324 
325  virtual std::string to_string() const;
326  virtual py::list to_list() const;
327 
328  virtual void reset();
329 };
330 
331 #ifdef __INTEL_COMPILER
332 #pragma warning disable 654
333 #endif
334 class MapType : public DataType
335 {
336  std::map<std::string, Data> keyvals_;
337  typedef std::map<std::string, Data>::iterator iterator;
338  typedef std::map<std::string, Data>::const_iterator const_iterator;
339 public:
340  MapType();
341 
342  virtual std::string type() const;
343 
344  virtual void add(std::string key, DataType *data);
345  virtual void add(std::string key, bool b);
346  virtual void add(std::string key, int i);
347  virtual void add(std::string key, double d);
348  virtual void add(std::string key, std::string s, std::string c = "");
349 
350  virtual bool exists(std::string key);
351 
352  virtual Data& operator[](std::string s);
353  virtual bool is_array() const;
354 
355  virtual unsigned int size() const;
356 
357  virtual std::string to_string() const;
358 };
359 
360 class Options
361 {
363 
365  std::map<std::string, Data> all_local_options_;
367  std::string current_module_;
368 
370  std::map<std::string, std::map<std::string, Data> > locals_;
371 
373  std::map<std::string, Data> globals_;
374 
375  typedef std::map<std::string, Data>::iterator iterator;
376  typedef std::map<std::string, Data>::const_iterator const_iterator;
377  typedef std::map<std::string, std::map<std::string, Data> >::const_iterator const_mod_iterator;
378 
379 public:
380  Options();
381 
382  Options & operator=(const Options& rhs);
383  bool read_globals() const;
384  void set_read_globals(bool _b);
385  void set_current_module(const std::string s);
386  std::string get_current_module() const {return current_module_;}
387 
388  void to_upper(std::string& str);
389 
390  void validate_options();
391 
392  void add(std::string key, DataType *data);
393  void add(std::string key, bool b);
394  void add(std::string key, int i);
395  void add(std::string key, double d);
396  void add(std::string key, std::string s, std::string c = "");
397  void add_i(std::string key, std::string s, std::string c = "");
398 
399  void add_bool(std::string key, bool b);
400  void add_int(std::string key, int i);
401  void add_double(std::string key, double d);
402  void add_str(std::string key, std::string s, std::string c = "");
403  void add_str_i(std::string key, std::string s, std::string c = "");
404  void add_array(std::string key);
405  void set_bool(const std::string &module, const std::string &key, bool b);
406  void set_int(const std::string &module, const std::string &key, int i);
407  void set_double(const std::string & module, const std::string &key, double d);
408  void set_str(const std::string & module, const std::string &key, std::string s);
409  void set_str_i(const std::string & module, const std::string &key, std::string s);
410  void set_python(const std::string &module, const std::string& key, const py::object &p);
411  void set_array(const std::string &module, const std::string& key);
412 
413  void set_global_bool(const std::string &key, bool b);
414  void set_global_int(const std::string &key, int i);
415  void set_global_double(const std::string &key, double d);
416  void set_global_str(const std::string &key, const std::string &s);
417  void set_global_python(const std::string& key, const py::object &p);
418  void set_global_array(const std::string& key);
419 
420  DataType* set_global_array_entry(const std::string& key, DataType* entry, DataType* loc);
421  void set_global_array_double(std::string key, double val, DataType *entry);
422  void set_global_array_string(std::string key, std::string val, DataType *entry);
423  void set_global_array_int(std::string key, int val, DataType *entry);
424  DataType* set_global_array_array(std::string key, DataType *entry);
425  DataType* set_local_array_entry(const std::string &module, const std::string& key, DataType* entry, DataType* loc);
426  void set_local_array_double(const std::string &module, const std::string &key, double val, DataType *entry);
427  void set_local_array_string(const std::string &module, const std::string &key, std::string val, DataType *entry);
428  void set_local_array_int(const std::string &module, const std::string &key, int val, DataType *entry);
429  DataType* set_local_array_array(const std::string &module, const std::string &key, DataType *entry);
430 
431  void clear(void);
432 
433  bool exists_in_active(std::string key);
434 
435  bool exists_in_global(std::string key);
436  bool exists(std::string key);
437 
438  Data& get(std::string key);
439 
440  Data& get(std::map<std::string, Data>& m, std::string& key);
441 
442  Data& get_global(std::string key);
443 
444  Data& get_local(std::string& key);
445 
446  Data& use(std::string& key);
447 
448  Data& use_local(std::string& key);
449 
450  bool get_bool(std::string key);
451  int get_int(std::string key);
452  double get_double(std::string key);
453  std::string get_str(std::string key);
454  int* get_int_array(std::string key);
455  void fill_int_array(std::string key, int* empty_array);
456  std::vector<int> get_int_vector(std::string key);
457  double* get_double_array(std::string key);
458 
459  std::vector<double> get_double_vector(std::string key);
460 
461  const char* get_cstr(std::string key);
462 
463  Data& operator[](std::string key);
464 
465  std::string to_string() const;
466  std::string globals_to_string() const;
467 
468  void print();
469  void print_globals();
470  std::vector<std::string> list_globals();
471 };
472 
473 }
474 #endif
virtual void add(std::string key, DataType *data)
Definition: liboptions.cc:813
bool read_globals() const
Definition: liboptions.cc:896
std::map< std::string, Data >::iterator iterator
Definition: liboptions.h:375
virtual void assign(bool b)
Definition: liboptions.cc:256
Ref< DataType > ptr_
Definition: liboptions.h:253
std::vector< Data > array_
Definition: liboptions.h:306
bool exists_in_global(std::string key)
Definition: liboptions.cc:1173
virtual int to_integer() const
Definition: liboptions.cc:356
void set_local_array_string(const std::string &module, const std::string &key, std::string val, DataType *entry)
Definition: liboptions.cc:1144
virtual ~IStringDataType()
Definition: liboptions.cc:493
Data & use_local(std::string &key)
Definition: liboptions.cc:1226
std::map< std::string, Data > keyvals_
Definition: liboptions.h:336
IndexException(const std::string &message, const std::string &module)
Definition: liboptions.h:60
void set_global_array(const std::string &key)
Definition: liboptions.cc:1084
double get_double(std::string key)
Definition: liboptions.cc:1345
std::string type() const
Definition: liboptions.cc:621
virtual void assign(bool b)
Definition: liboptions.cc:366
void set_array(const std::string &module, const std::string &key)
Definition: liboptions.cc:1052
Data()
Definition: liboptions.cc:564
virtual Data & operator[](unsigned int i)
Definition: liboptions.cc:761
void set_str_i(const std::string &module, const std::string &key, std::string s)
Definition: liboptions.cc:1040
std::map< std::string, Data > globals_
&quot;Global&quot; set of options
Definition: liboptions.h:373
virtual void assign(DataType *data)
Definition: liboptions.cc:755
virtual std::string to_string() const
Definition: liboptions.cc:159
void set_global_array_double(std::string key, double val, DataType *entry)
Definition: liboptions.cc:1105
virtual Data & operator[](std::string)
Definition: liboptions.cc:209
virtual std::string type() const
Definition: liboptions.cc:289
Definition: liboptions.h:251
std::vector< std::string > choices_
Definition: liboptions.h:230
void set_str(const std::string &module, const std::string &key, std::string s)
Definition: liboptions.cc:1034
OptionsException(const std::string &message)
Definition: liboptions.h:75
virtual bool is_array() const
Definition: liboptions.cc:94
std::map< std::string, Data >::const_iterator const_iterator
Definition: liboptions.h:338
virtual int to_integer() const
Definition: liboptions.cc:513
bool has_changed() const
Definition: liboptions.cc:601
void set_global_array_int(std::string key, int val, DataType *entry)
Definition: liboptions.cc:1115
Definition: liboptions.h:64
void set_global_double(const std::string &key, double d)
Definition: liboptions.cc:1068
virtual void add_choices(std::string str)
Definition: liboptions.cc:496
Definition: liboptions.h:176
void set_int(const std::string &module, const std::string &key, int i)
Definition: liboptions.cc:1022
std::string str_
Definition: liboptions.h:201
virtual std::string type() const
Definition: liboptions.cc:808
virtual py::list to_list() const
Definition: python.cc:62
virtual ~IntDataType()
Definition: liboptions.cc:286
Definition: liboptions.h:153
std::map< std::string, Data > all_local_options_
A temporary map used for validation of local options.
Definition: liboptions.h:365
Definition: liboptions.h:227
Definition: pointgrp.h:106
void dechanged()
Definition: liboptions.cc:74
double * get_double_array(std::string key)
Definition: liboptions.cc:1379
void add_choices(std::string str)
Definition: liboptions.cc:616
void set_global_bool(const std::string &key, bool b)
Definition: liboptions.cc:1058
DataTypeException(const std::string &message)
Definition: liboptions.h:53
void set_local_array_int(const std::string &module, const std::string &key, int val, DataType *entry)
Definition: liboptions.cc:1149
std::map< std::string, Data >::iterator iterator
Definition: liboptions.h:337
std::string globals_to_string() const
Definition: liboptions/print.cc:117
virtual std::string type() const
Definition: liboptions.cc:89
bool changed_
Definition: liboptions.h:81
virtual void add(DataType *)
Definition: liboptions.cc:104
virtual double to_double() const
Definition: liboptions.cc:251
void set_python(const std::string &module, const std::string &key, const py::object &p)
Definition: liboptions.cc:1046
Data & get_local(std::string &key)
Definition: liboptions.cc:1199
Data & operator[](int i)
Definition: liboptions.cc:711
Data & use(std::string &key)
Definition: liboptions.cc:1260
void fill_int_array(std::string key, int *empty_array)
Definition: liboptions.cc:1363
bool exists_in_active(std::string key)
Definition: liboptions.cc:1165
void set_global_python(const std::string &key, const py::object &p)
Definition: liboptions.cc:1078
virtual std::string to_string() const
Definition: liboptions.cc:870
void add_bool(std::string key, bool b)
Definition: liboptions.cc:986
StringDataType()
Definition: liboptions.cc:388
py::list to_list() const
Definition: python.cc:57
virtual void assign(bool b)
Definition: liboptions.cc:437
virtual ~DoubleDataType()
Definition: liboptions.cc:341
virtual void add(DataType *data)
Definition: liboptions.cc:730
virtual double to_double() const
Definition: liboptions.cc:432
DataType * set_global_array_entry(const std::string &key, DataType *entry, DataType *loc)
Definition: liboptions.cc:1090
void set_read_globals(bool _b)
Definition: liboptions.cc:901
std::vector< double > get_double_vector(std::string key)
Definition: liboptions.cc:1388
virtual void assign(bool b)
Definition: liboptions.cc:311
Definition: exception.h:54
void to_upper(std::string &str)
Definition: liboptions.cc:912
void add_i(std::string key, std::string s, std::string c="")
Definition: liboptions.cc:976
virtual unsigned int size() const
Definition: liboptions.cc:865
int to_integer() const
Definition: liboptions.cc:581
bool has_changed() const
Definition: liboptions.cc:64
bool boolean_
Definition: liboptions.h:132
DoubleDataType()
Definition: liboptions.cc:333
BooleanDataType()
Definition: liboptions.cc:220
IStringDataType()
Definition: liboptions.cc:479
std::map< std::string, Data >::const_iterator const_iterator
Definition: liboptions.h:376
Definition: ref.h:126
virtual std::string type() const
Definition: liboptions.cc:417
std::vector< int > get_int_vector(std::string key)
Definition: liboptions.cc:1370
void set_local_array_double(const std::string &module, const std::string &key, double val, DataType *entry)
Definition: liboptions.cc:1139
Options()
Definition: liboptions.cc:880
void clear(void)
Definition: liboptions.cc:1159
void reset()
Definition: liboptions.cc:701
int get_int(std::string key)
Definition: liboptions.cc:1340
Options & operator=(const Options &rhs)
Definition: liboptions.cc:884
void dechanged()
Definition: liboptions.cc:611
void set_bool(const std::string &module, const std::string &key, bool b)
Definition: liboptions.cc:1016
virtual std::string to_string() const
Definition: liboptions.cc:294
void add_array(std::string key)
Definition: liboptions.cc:1011
virtual void reset()
Definition: liboptions.cc:204
void to_upper(std::string &str)
Definition: liboptions.cc:79
bool is_array() const
Definition: liboptions.cc:591
void assign(DataType *data)
Definition: liboptions.cc:676
virtual py::list to_list() const
Definition: liboptions.cc:174
MapType()
Definition: liboptions.cc:805
virtual std::string type() const
Definition: liboptions.cc:725
bool exists(std::string key)
Definition: liboptions.cc:1183
virtual bool is_array() const
Definition: liboptions.cc:860
virtual std::string to_string() const
Definition: liboptions.cc:236
const char * get_cstr(std::string key)
Definition: liboptions.cc:1397
Definition: liboptions.h:130
DataType * set_local_array_array(const std::string &module, const std::string &key, DataType *entry)
Definition: liboptions.cc:1154
Definition: liboptions.h:72
void add_str(std::string key, std::string s, std::string c="")
Definition: liboptions.cc:1001
Definition: liboptions.h:360
virtual double to_double() const
Definition: liboptions.cc:306
virtual std::string type() const
Definition: liboptions.cc:344
void add_double(std::string key, double d)
Definition: liboptions.cc:996
virtual unsigned int size() const
Definition: liboptions.cc:99
Definition: liboptions.h:334
Definition: liboptions.h:50
void add_int(std::string key, int i)
Definition: liboptions.cc:991
unsigned int size() const
Definition: liboptions.cc:596
void set_global_str(const std::string &key, const std::string &s)
Definition: liboptions.cc:1073
void add_str_i(std::string key, std::string s, std::string c="")
Definition: liboptions.cc:1006
virtual void reset()
Definition: liboptions.cc:800
virtual void assign(bool b)
Definition: liboptions.cc:523
std::string to_string() const
Definition: liboptions/print.cc:55
void add(DataType *data)
Definition: liboptions.cc:626
virtual void add_choices(std::string str)
Definition: liboptions.cc:409
Data & get_global(std::string key)
Definition: liboptions.cc:1216
std::vector< std::string > list_globals()
Definition: liboptions/print.cc:159
void add(std::string key, DataType *data)
Definition: liboptions.cc:932
Definition: liboptions.h:304
std::string get_current_module() const
Definition: liboptions.h:386
virtual int to_integer() const
Definition: liboptions.cc:301
bool edit_globals_
Definition: liboptions.h:362
Definition: liboptions.h:56
void set_double(const std::string &module, const std::string &key, double d)
Definition: liboptions.cc:1028
virtual std::string to_string() const
Definition: liboptions.cc:349
virtual int to_integer() const
Definition: liboptions.cc:164
std::string to_string() const
Definition: liboptions.cc:576
Definition: liboptions.h:79
std::string current_module_
The module that&#39;s active right now.
Definition: liboptions.h:367
virtual bool exists(std::string)
Definition: liboptions.cc:154
double to_double() const
Definition: liboptions.cc:586
virtual ~StringDataType()
Definition: liboptions.cc:406
virtual double to_double() const
Definition: liboptions.cc:361
virtual ~BooleanDataType()
Definition: liboptions.cc:228
virtual std::string to_string() const
Definition: liboptions.cc:508
void validate_options()
Definition: liboptions.cc:917
DuplicateKeyException(const std::string &key, const std::string &type1, const std::string &type2, const char *lfile, int lline)
Definition: liboptions.h:67
DataType * set_global_array_array(std::string key, DataType *entry)
Definition: liboptions.cc:1120
void print_globals()
Definition: liboptions/print.cc:152
std::string str_
Definition: liboptions.h:229
virtual std::string type() const
Definition: liboptions.cc:231
bool get_bool(std::string key)
Definition: liboptions.cc:1335
virtual std::string to_string() const
Definition: liboptions.cc:422
virtual Data & operator[](std::string s)
Definition: liboptions.cc:852
ArrayType()
Definition: liboptions.cc:722
void changed()
Definition: liboptions.cc:606
void print()
Definition: liboptions/print.cc:109
void set_global_int(const std::string &key, int i)
Definition: liboptions.cc:1063
std::map< std::string, std::map< std::string, Data > >::const_iterator const_mod_iterator
Definition: liboptions.h:377
int * get_int_array(std::string key)
Definition: liboptions.cc:1354
virtual double to_double() const
Definition: liboptions.cc:169
virtual bool exists(std::string key)
Definition: liboptions.cc:843
virtual std::string type() const
Definition: liboptions.cc:503
IntDataType()
Definition: liboptions.cc:278
void set_global_array_string(std::string key, std::string val, DataType *entry)
Definition: liboptions.cc:1110
virtual double to_double() const
Definition: liboptions.cc:518
DataType * set_local_array_entry(const std::string &module, const std::string &key, DataType *entry, DataType *loc)
Definition: liboptions.cc:1125
virtual void add_choices(std::string str)
Definition: liboptions.cc:84
IndexException(const std::string &message)
Definition: liboptions.h:59
virtual unsigned int size() const
Definition: liboptions.cc:783
virtual ~DataType()
Definition: liboptions.cc:61
#define PSIEXCEPTION(message)
Definition: exception.h:48
virtual void assign(DataType *)
Definition: liboptions.cc:179
std::map< std::string, std::map< std::string, Data > > locals_
&quot;Active&quot; set of options
Definition: liboptions.h:370
int integer_
Definition: liboptions.h:155
std::vector< std::string > choices_
Definition: liboptions.h:202
virtual int to_integer() const
Definition: liboptions.cc:246
Data & operator[](std::string key)
Definition: liboptions.cc:1402
void changed()
Definition: liboptions.cc:69
virtual bool is_array() const
Definition: liboptions.cc:778
DataType()
Definition: liboptions.cc:57
void set_current_module(const std::string s)
Definition: liboptions.cc:906
virtual int to_integer() const
Definition: liboptions.cc:427
double double_
Definition: liboptions.h:178
std::string get_str(std::string key)
Definition: liboptions.cc:1350
virtual std::string to_string() const
Definition: liboptions.cc:788
Definition: liboptions.h:199