Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

RetinalObjectStringArgs Class Reference

#include <retinalobjs.h>

Collaboration diagram for RetinalObjectStringArgs:

Collaboration graph
[legend]
List of all members.

Detailed Description

Helper class to handle string constructors for Retinal_Objects.

Definition at line 269 of file retinalobjs.h.

Public Types

typedef std::map< string,
string > 
DefaultsMap
 Map for default values.

typedef std::vector< string > ParamList
 Allows object to declare the parameters it expects.


Public Methods

 RetinalObjectStringArgs (StringArgs arglist, VGenFactory< Retinal_Object::Variable > &vgf, DefaultsMap dm=DefaultsMap(), Retinal_Object *m=0)
 The constructor requires the actual string arguments, a ValueGeneratorFactory to be used to construct the variables, a map (possibly empty) of default values, and a pointer to the object to whose values we should link, if any.

Retinal_Object::VarMap vars (const ParamList &params)
 Returns a set of ValueGenerators constructed by parsing the list of string arguments using the list of expected parameters and the map of defaults.

Extended interface
Not all applications need these functions.

string get_default (const string &name) const
 Safe lookup function for DefaultsMap.

void set_default (const string &name, const string &value)
 Overrides defaults in the map passed in at construction.

void error (const string &s) const
 Signals an error using the StringParser's error facility.

const string parsed_get_default (const string &name) const
 Looks up and returns a parse of the default with the given name.

const string parsed_next (const string &name)
 Consumes the next argument using the given name to find the default.

Retinal_Object::Variableparse (const string &s, Retinal_Object::Variable &x) const
 Simple numeric parsing.


Friends

class RetinalObjectFactory


Member Function Documentation

string RetinalObjectStringArgs::get_default const string &    name const [inline]
 

Safe lookup function for DefaultsMap.

Defaults to empty string when not found; this usually evaluates to zero and/or a warning when parsed.

Definition at line 306 of file retinalobjs.h.

Referenced by parsed_get_default(), and vars().

Retinal_Object::VarMap RetinalObjectStringArgs::vars const ParamList   params
 

Returns a set of ValueGenerators constructed by parsing the list of string arguments using the list of expected parameters and the map of defaults.

This should be all that is needed for simple argument lists consisting only of ValueGenerators.

Definition at line 68 of file retinalobjs.c.

References StringArgs::empty(), error(), get_default(), StringArgs::next(), String::strip_quotes(), StringArgs::top(), and vars().

Referenced by vars().


The documentation for this class was generated from the following files:
Generated on Mon Jan 20 02:37:23 2003 for RF-LISSOM by doxygen1.3-rc2