Main Page | Modules | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

Arak::Util Namespace Reference


Classes

class  CommandLine
 This class parses the command line arguments of a C/C++ program. More...

class  CommandLine::Option
 An option that is either supplied or not. More...

class  CommandLine::Parameter
 A parameter that has a default value and may be overridden on the command line. More...

class  CommandLine::MultiParameter
 A parameter that has can be specified multiple times on the command line. More...

class  Random
 A simple wrapper around the GNU Scientific Library pseudorandom number generator. More...


Typedefs

typedef std::map< std::string,
std::string > 
PropertyMap
 A property map is a map from property names to values (both of which are represented by strings).


Functions

const std::string & getp (const PropertyMap &props, const std::string &name) throw (std::invalid_argument)
 Gets the value of the property.

bool hasp (const PropertyMap &props, const std::string &name)
 Determines if a property has been assigned a value.

template<typename charT, typename traits> std::basic_istream< charT,
traits > & 
operator>> (std::basic_istream< charT, traits > &in, PropertyMap &pm)
 Reads a property map from an input stream.

template<typename charT, typename traits> std::basic_ostream< charT,
traits > & 
operator<< (std::basic_ostream< charT, traits > &out, const PropertyMap &pm)
 Writes a property map to an output stream.

template<typename T> bool parse (const std::string &str, T &value)
 Parses a value from a string using its stream input operator.


Variables

Random default_random
 A default source of randomness, initialized using environment variables.


Typedef Documentation

typedef std::map<std::string, std::string> Arak::Util::PropertyMap
 

A property map is a map from property names to values (both of which are represented by strings).

Definition at line 20 of file properties.hpp.

Referenced by Arak::AnnealedMarkovChain< MarkovChainTraits >::AnnealedMarkovChain(), Arak::ArakPosteriorBernoulliObs::ArakPosteriorBernoulliObs(), Arak::ArakPosteriorGaussianObs::ArakPosteriorGaussianObs(), Arak::ArakPosteriorRangeObs::ArakPosteriorRangeObs(), Arak::ArakPosteriorSonarObs::ArakPosteriorSonarObs(), Arak::ArakPrior::ArakPrior(), Arak::CN94Proposal::CN94Proposal(), Arak::Coloring::Coloring(), getp(), Arak::GridColorEstimator::GridColorEstimator(), hasp(), main(), Arak::MarkovChain< ArakMarkovChainTraits >::MarkovChain(), Arak::ModifiedCN94Proposal::ModifiedCN94Proposal(), Arak::OccupancyGrid::OccupancyGrid(), operator<<(), operator>>(), Arak::PointSetColorEstimator::PointSetColorEstimator(), sampler(), sonar_viz(), and Arak::StochasticHillClimber< MarkovChainTraits >::StochasticHillClimber().


Function Documentation

const std::string& getp const PropertyMap &  props,
const std::string &  name
throw (std::invalid_argument) [inline]
 

Gets the value of the property.

Definition at line 25 of file properties.hpp.

References PropertyMap.

bool hasp const PropertyMap &  props,
const std::string &  name
[inline]
 

Determines if a property has been assigned a value.

Definition at line 40 of file properties.hpp.

References PropertyMap.

template<typename charT, typename traits>
std::basic_ostream<charT,traits>& operator<< std::basic_ostream< charT, traits > &  out,
const PropertyMap &  pm
 

Writes a property map to an output stream.

Parameters:
out the output stream
pm the property map to output
Returns:
the output stream after the write

Definition at line 113 of file properties.hpp.

References PropertyMap.

template<typename charT, typename traits>
std::basic_istream<charT,traits>& operator>> std::basic_istream< charT, traits > &  in,
PropertyMap &  pm
 

Reads a property map from an input stream.

If the read is not successful then the std::ios_base::failbit is set in the input stream. The input stream must consist of assignments of the form 'name = value' (whitespace unimportant), possibly with comments that start with '#' and continue to the next newline. If the same name is specified multiple times then the last value is stored. Properties in the supplied map are overwritten if they are specified in the stream.

Parameters:
in the input stream
pm the property map to populate
Returns:
the input stream after the read

Definition at line 61 of file properties.hpp.

References PropertyMap, and Arak::skipcomments().

template<typename T>
bool parse const std::string &  str,
T &  value
 

Parses a value from a string using its stream input operator.

Parameters:
str the string
value the place the parsed value is stored
Returns:
true if the parsing was successful

Definition at line 139 of file properties.hpp.


Variable Documentation

Random Arak::Util::default_random
 

A default source of randomness, initialized using environment variables.

Definition at line 5 of file random.cpp.


Generated on Wed May 25 14:41:37 2005 for Arak by doxygen 1.3.6