9 #ifndef __IPOPTLIST_HPP__
10 #define __IPOPTLIST_HPP__
48 OptionValue(std::string value,
bool allow_clobber,
bool dont_print)
191 bool allow_clobber =
true,
bool dont_print =
false);
193 bool allow_clobber =
true,
bool dont_print =
false);
195 bool allow_clobber =
true,
bool dont_print =
false);
202 bool allow_clobber =
true,
bool dont_print =
false);
204 bool allow_clobber =
true,
bool dont_print =
false);
206 bool allow_clobber =
true,
bool dont_print =
false);
214 const std::string& prefix)
const;
216 const std::string& prefix)
const;
218 const std::string& prefix)
const;
220 const std::string& prefix)
const;
222 const std::string& prefix)
const;
262 const std::string&
lowercase(
const std::string tag)
const;
270 bool find_tag(
const std::string& tag,
const std::string& prefix,
271 std::string& value)
const;
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.
std::string value_
Value for this option.
OptionValue(const OptionValue ©)
Copy Constructor.
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 (needed for the map)
~OptionValue()
Default Destructor.
void operator=(const OptionValue ©)
Equals operator.
bool initialized_
for debugging
OptionValue(std::string value, bool allow_clobber, bool dont_print)
Constructor given the value.
This class stores a list of user set options.
const std::string & lowercase(const std::string tag) const
auxilliary method for converting sting to all lower-case letters
std::string lowercase_buffer_
auxilliary 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()
Default destructor.
std::map< std::string, OptionValue > options_
Default Constructor.
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, use/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.
virtual void SetJournalist(const SmartPtr< Journalist > jnlst)
bool find_tag(const std::string &tag, const std::string &prefix, std::string &value) const
auxilliary 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 void operator=(const OptionsList &source)
Overloaded Equals Operator.
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 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 void PrintList(std::string &list) const
Get a string with the list of all options (tag, value, counter)
virtual bool ReadFromStream(const Journalist &jnlst, std::istream &is)
Read options from the stream is.
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.
OptionsList(const OptionsList ©)
Copy Constructor.
Template class for Smart Pointers.
int Index
Type of all indices of vectors, matrices etc.
DECLARE_STD_EXCEPTION(SUFFIX_EMPTY)
double Number
Type of all numbers.