7#ifndef __IPOPTLIST_HPP__
8#define __IPOPTLIST_HPP__
47 const std::string& value,
212 const std::string& tag,
213 const std::string& value,
214 bool allow_clobber =
true,
215 bool dont_print =
false
219 const std::string& tag,
221 bool allow_clobber =
true,
222 bool dont_print =
false
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);
248 const std::string& tag
255 const std::string& tag,
256 const std::string& value,
257 bool allow_clobber =
true,
258 bool dont_print =
false
262 const std::string& tag,
264 bool allow_clobber =
true,
265 bool dont_print =
false
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
293 const std::string& tag,
295 const std::string& prefix
299 const std::string& tag,
301 const std::string& prefix
305 const std::string& tag,
307 const std::string& prefix
311 const std::string& tag,
313 const std::string& prefix
317 const std::string& tag,
319 const std::string& prefix
344 bool allow_clobber =
false
372 const std::string& tag
384 const std::string& tag,
385 const std::string& prefix,
394 const std::string& tag
#define DECLARE_STD_EXCEPTION(__except_type)
Class responsible for all message output.
std::string GetValue() const
Method for retrieving the value of an option.
bool dont_print_
True if this option is not to show up in the print_user_options output.
bool DontPrint() const
True if this option is not to show up in the print_user_options output.
bool AllowClobber() const
True if the option can be overwritten.
Index counter_
Counter for requests.
OptionValue & operator=(const OptionValue ©)
Equals operator.
std::string value_
Value for this option.
OptionValue(const OptionValue ©)
Copy Constructor.
OptionValue(const std::string &value, bool allow_clobber, bool dont_print)
Constructor given the value.
std::string Value() const
Method for retrieving the value without increasing the counter.
Index Counter() const
Method for accessing current value of the request counter.
bool allow_clobber_
True if the option can be overwritten.
OptionValue()
Default constructor.
~OptionValue()
Default Destructor.
bool initialized_
for debugging
std::string lowercase_buffer_
auxiliary string set by lowercase method
virtual bool GetBoolValue(const std::string &tag, bool &value, const std::string &prefix) const
virtual bool SetNumericValueIfUnset(const std::string &tag, Number value, bool allow_clobber=true, bool dont_print=false)
virtual ~OptionsList()
Destructor.
virtual bool UnsetValue(const std::string &tag)
Resets an option to its default value, if clobber is allowed.
virtual bool GetStringValue(const std::string &tag, std::string &value, const std::string &prefix) const
virtual bool GetNumericValue(const std::string &tag, Number &value, const std::string &prefix) const
virtual void PrintUserOptions(std::string &list) const
Get a string with the list of all options set by the user (tag, value, used/notused).
virtual bool GetIntegerValue(const std::string &tag, Index &value, const std::string &prefix) const
bool readnexttoken(std::istream &is, std::string &token)
read the next token from stream is
std::map< std::string, OptionValue > options_
Default Constructor.
virtual void SetJournalist(const SmartPtr< Journalist > jnlst)
bool find_tag(const std::string &tag, const std::string &prefix, std::string &value) const
auxiliary method for finding the value for a tag in the options list
virtual bool SetIntegerValue(const std::string &tag, Index value, bool allow_clobber=true, bool dont_print=false)
virtual void SetRegisteredOptions(const SmartPtr< RegisteredOptions > reg_options)
virtual bool SetBoolValue(const std::string &tag, bool value, bool allow_clobber=true, bool dont_print=false)
virtual bool GetEnumValue(const std::string &tag, Index &value, const std::string &prefix) const
bool will_allow_clobber(const std::string &tag) const
tells whether or not we can clobber a particular option
virtual bool ReadFromStream(const Journalist &jnlst, std::istream &is, bool allow_clobber=false)
Read options from the stream is.
virtual bool SetIntegerValueIfUnset(const std::string &tag, Index value, bool allow_clobber=true, bool dont_print=false)
virtual bool SetStringValue(const std::string &tag, const std::string &value, bool allow_clobber=true, bool dont_print=false)
virtual bool SetBoolValueIfUnset(const std::string &tag, bool value, bool allow_clobber=true, bool dont_print=false)
virtual void PrintList(std::string &list) const
Get a string with the list of all options (tag, value, counter)
const std::string & lowercase(const std::string &tag) const
auxiliary method for converting sting to all lower-case letters
OptionsList(SmartPtr< RegisteredOptions > reg_options, SmartPtr< Journalist > jnlst)
SmartPtr< RegisteredOptions > reg_options_
list of all the registered options to validate against
virtual bool SetNumericValue(const std::string &tag, Number value, bool allow_clobber=true, bool dont_print=false)
virtual void clear()
Method for clearing all previously set options.
virtual bool SetStringValueIfUnset(const std::string &tag, const std::string &value, bool allow_clobber=true, bool dont_print=false)
SmartPtr< Journalist > jnlst_
Journalist for writing error messages, etc.
virtual OptionsList & operator=(const OptionsList &source)
Default Assignment Operator.
OptionsList(const OptionsList ©)
Copy Constructor.
Template class for Smart Pointers.
This file contains a base class for all exceptions and a set of macros to help with exceptions.
ipindex Index
Type of all indices of vectors, matrices etc.
ipnumber Number
Type of all numbers.