7#ifndef __IPOPTLIST_HPP__
8#define __IPOPTLIST_HPP__
47 const std::string&
value,
63 : value_(
copy.value_),
64 counter_(
copy.counter_),
65 initialized_(
copy.initialized_),
66 allow_clobber_(
copy.allow_clobber_),
67 dont_print_(
copy.dont_print_)
77 counter_ =
copy.counter_;
78 initialized_ =
copy.initialized_;
79 allow_clobber_ =
copy.allow_clobber_;
80 dont_print_ =
copy.dont_print_;
118 return allow_clobber_;
166 : options_(
copy.options_),
167 reg_options_(
copy.reg_options_)
179 options_ =
source.options_;
180 reg_options_ =
source.reg_options_;
212 const std::string&
tag,
213 const std::string&
value,
219 const std::string&
tag,
226 const std::string&
tag,
234 const std::string&
tag,
248 const std::string&
tag
255 const std::string&
tag,
256 const std::string&
value,
262 const std::string&
tag,
269 const std::string&
tag,
277 const std::string&
tag,
293 const std::string&
tag,
299 const std::string&
tag,
305 const std::string&
tag,
311 const std::string&
tag,
317 const std::string&
tag,
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)
Templated class which stores one entry for the CachedResult class.
Class responsible for all message output.
Class for storing the value and counter for each option in OptionsList.
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
This class stores a list of user set options.
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.
Storing the reference count of all the smart pointers that currently reference it.
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.