7 #ifndef __IPOPTLIST_HPP__ 8 #define __IPOPTLIST_HPP__ 47 const std::string& value,
54 allow_clobber_(allow_clobber),
55 dont_print_(dont_print)
63 : value_(copy.value_),
64 counter_(copy.counter_),
65 initialized_(copy.initialized_),
66 allow_clobber_(copy.allow_clobber_),
67 dont_print_(copy.dont_print_)
118 return allow_clobber_;
155 : reg_options_(reg_options),
166 : options_(copy.options_),
167 reg_options_(copy.reg_options_)
193 virtual void SetRegisteredOptions(
198 reg_options_ = reg_options;
210 virtual bool SetStringValue(
212 const std::string& tag,
213 const std::string& value,
214 bool allow_clobber =
true,
215 bool dont_print =
false 218 virtual bool SetNumericValue(
219 const std::string& tag,
221 bool allow_clobber =
true,
222 bool dont_print =
false 225 virtual bool SetIntegerValue(
226 const std::string& tag,
228 bool allow_clobber =
true,
229 bool dont_print =
false 234 const std::string& tag,
236 bool allow_clobber =
true,
237 bool dont_print =
false 240 return SetStringValue(tag, value ?
"yes" :
"no", allow_clobber, dont_print);
247 virtual bool UnsetValue(
248 const std::string& tag
253 virtual bool SetStringValueIfUnset(
255 const std::string& tag,
256 const std::string& value,
257 bool allow_clobber =
true,
258 bool dont_print =
false 261 virtual bool SetNumericValueIfUnset(
262 const std::string& tag,
264 bool allow_clobber =
true,
265 bool dont_print =
false 268 virtual bool SetIntegerValueIfUnset(
269 const std::string& tag,
271 bool allow_clobber =
true,
272 bool dont_print =
false 277 const std::string& tag,
279 bool allow_clobber =
true,
280 bool dont_print =
false 283 return SetStringValueIfUnset(tag, value ?
"yes" :
"no", allow_clobber, dont_print);
291 virtual bool GetStringValue(
293 const std::string& tag,
295 const std::string& prefix
298 virtual bool GetEnumValue(
299 const std::string& tag,
301 const std::string& prefix
304 virtual bool GetBoolValue(
305 const std::string& tag,
307 const std::string& prefix
310 virtual bool GetNumericValue(
311 const std::string& tag,
313 const std::string& prefix
316 virtual bool GetIntegerValue(
317 const std::string& tag,
319 const std::string& prefix
324 virtual void PrintList(
333 virtual void PrintUserOptions(
341 virtual bool ReadFromStream(
344 bool allow_clobber =
false 371 const std::string& lowercase(
372 const std::string& tag
384 const std::string& tag,
385 const std::string& prefix,
393 bool will_allow_clobber(
394 const std::string& tag
virtual void SetJournalist(const SmartPtr< Journalist > jnlst)
Index Counter() const
Method for accessing current value of the request counter.
OptionValue(const OptionValue ©)
Copy Constructor.
DECLARE_STD_EXCEPTION(FATAL_ERROR_IN_LINEAR_SOLVER)
OptionValue(const std::string &value, bool allow_clobber, bool dont_print)
Constructor given the value.
OptionValue & operator=(const OptionValue ©)
Equals operator.
~OptionValue()
Default Destructor.
bool AllowClobber() const
True if the option can be overwritten.
ipindex Index
Type of all indices of vectors, matrices etc.
bool DontPrint() const
True if this option is not to show up in the print_user_options output.
bool dont_print_
True if this option is not to show up in the print_user_options output.
This file contains a base class for all exceptions and a set of macros to help with exceptions...
OptionsList(const OptionsList ©)
Copy Constructor.
Template class for Smart Pointers.
Storing the reference count of all the smart pointers that currently reference it.
This class stores a list of user set options.
Index counter_
Counter for requests.
bool allow_clobber_
True if the option can be overwritten.
std::string GetValue() const
Method for retrieving the value of an option.
std::map< std::string, OptionValue > options_
Default Constructor.
ipnumber Number
Type of all numbers.
std::string lowercase_buffer_
auxiliary string set by lowercase method
bool initialized_
for debugging
Class for storing the value and counter for each option in OptionsList.
Class responsible for all message output.
virtual ~OptionsList()
Destructor.
SmartPtr< Journalist > jnlst_
Journalist for writing error messages, etc.
OptionValue()
Default constructor.
SmartPtr< RegisteredOptions > reg_options_
list of all the registered options to validate against
std::string value_
Value for this option.
virtual bool SetBoolValue(const std::string &tag, bool value, bool allow_clobber=true, bool dont_print=false)
virtual void clear()
Method for clearing all previously set options.
virtual bool SetBoolValueIfUnset(const std::string &tag, bool value, bool allow_clobber=true, bool dont_print=false)
std::string Value() const
Method for retrieving the value without increasing the counter.
virtual OptionsList & operator=(const OptionsList &source)
Default Assignment Operator.