OptionsList Class Reference

#include <IpOptionsList.hpp>

Inheritance diagram for OptionsList:

ReferencedObject

List of all members.


Detailed Description

This class stores a list of user set options.

Each options is identified by a case-insensitive keyword (tag). Its value is stored internally as a string (always lower case), but for convenience set and get methods are provided to obtain Index and Number type values. For each keyword we also keep track of how often the value of an option has been requested by a get method.

Public Member Functions

void PrintList (std::string &list) const
 Get a string with the list of all options (tag, value, counter).
void PrintUserOptions (std::string &list) const
 Get a string with the list of all options set by the user (tag, value, use/notused).
bool ReadFromStream (const Journalist &jnlst, std::istream &is)
 Read options from the stream is.
Constructors/Destructors
 OptionsList (SmartPtr< RegisteredOptions > reg_options, SmartPtr< Journalist > jnlst)
 Copy Constructor.
 OptionsList ()
 Copy Constructor.
 OptionsList (const OptionsList &copy)
 Copy Constructor.
virtual ~OptionsList ()
 Default destructor.
void operator= (const OptionsList &source)
 Overloaded Equals Operator.
Get / Set Methods
void SetRegisteredOptions (const SmartPtr< RegisteredOptions > reg_options)
void SetJournalist (const SmartPtr< Journalist > jnlst)
Methods for setting options
bool SetStringValue (const std::string &tag, const std::string &value, bool allow_clobber=true, bool dont_print=false)
bool SetNumericValue (const std::string &tag, Number value, bool allow_clobber=true, bool dont_print=false)
bool SetIntegerValue (const std::string &tag, Index value, bool allow_clobber=true, bool dont_print=false)
Methods for retrieving values from the options list. If
a tag is not found, the methods return false, and value is set to the default value defined in the registered options.

bool GetStringValue (const std::string &tag, std::string &value, const std::string &prefix) const
bool GetEnumValue (const std::string &tag, Index &value, const std::string &prefix) const
bool GetBoolValue (const std::string &tag, bool &value, const std::string &prefix) const
bool GetNumericValue (const std::string &tag, Number &value, const std::string &prefix) const
bool GetIntegerValue (const std::string &tag, Index &value, const std::string &prefix) const

Classes

class  OptionValue
 Class for storing the value and counter for each option in OptionsList.


Constructor & Destructor Documentation

OptionsList ( SmartPtr< RegisteredOptions reg_options,
SmartPtr< Journalist jnlst 
) [inline]

Copy Constructor.

OptionsList (  )  [inline]

Copy Constructor.

OptionsList ( const OptionsList copy  )  [inline]

Copy Constructor.

References OptionsList::options_, and OptionsList::reg_options_.

virtual ~OptionsList (  )  [inline, virtual]

Default destructor.


Member Function Documentation

void operator= ( const OptionsList source  )  [inline]

Overloaded Equals Operator.

References OptionsList::options_.

void SetRegisteredOptions ( const SmartPtr< RegisteredOptions reg_options  )  [inline]

void SetJournalist ( const SmartPtr< Journalist jnlst  )  [inline]

bool SetStringValue ( const std::string &  tag,
const std::string &  value,
bool  allow_clobber = true,
bool  dont_print = false 
)

bool SetNumericValue ( const std::string &  tag,
Number  value,
bool  allow_clobber = true,
bool  dont_print = false 
)

bool SetIntegerValue ( const std::string &  tag,
Index  value,
bool  allow_clobber = true,
bool  dont_print = false 
)

bool GetStringValue ( const std::string &  tag,
std::string &  value,
const std::string &  prefix 
) const

bool GetEnumValue ( const std::string &  tag,
Index value,
const std::string &  prefix 
) const

bool GetBoolValue ( const std::string &  tag,
bool &  value,
const std::string &  prefix 
) const

bool GetNumericValue ( const std::string &  tag,
Number value,
const std::string &  prefix 
) const

bool GetIntegerValue ( const std::string &  tag,
Index value,
const std::string &  prefix 
) const

void PrintList ( std::string &  list  )  const

Get a string with the list of all options (tag, value, counter).

void PrintUserOptions ( std::string &  list  )  const

Get a string with the list of all options set by the user (tag, value, use/notused).

Here, options with dont_print flag set to true are not printed.

bool ReadFromStream ( const Journalist jnlst,
std::istream &  is 
)


The documentation for this class was generated from the following files:

Generated on Fri Sep 26 07:44:26 2008 for SimTKcore by  doxygen 1.5.6