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

RetinalObjectStringArgs Class Reference

Helper class to handle string constructors for Retinal_Objects. More...

#include <retinalobjs.h>

Collaboration diagram for RetinalObjectStringArgs:

Collaboration graph

[legend]
List of all members.

Public Types

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

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


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. More...

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. More...

Extended interface
Not all applications need these functions.

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

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

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

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

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

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


Friends

class  RetinalObjectFactory

Detailed Description

Helper class to handle string constructors for Retinal_Objects.

Definition at line 213 of file retinalobjs.h.


Member Typedef Documentation

typedef std::map<string,string> RetinalObjectStringArgs::DefaultsMap
 

Map for default values.

Definition at line 216 of file retinalobjs.h.

typedef std::vector<string> RetinalObjectStringArgs::ParamList
 

Allows object to declare the parameters it expects.

Definition at line 218 of file retinalobjs.h.


Constructor & Destructor Documentation

RetinalObjectStringArgs::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.

Definition at line 226 of file retinalobjs.h.


Member Function Documentation

void RetinalObjectStringArgs::error ( const string & s ) const [inline]
 

Signals an error using the StringParser's error facility.

Definition at line 260 of file retinalobjs.h.

Referenced by RetinalObjectFactory::create(), and vars().

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 250 of file retinalobjs.h.

Referenced by parsed_get_default(), parsed_next(), and vars().

Retinal_Object::Variable & RetinalObjectStringArgs::parse ( const string & s,
Retinal_Object::Variable & x ) const [inline]
 

Simple numeric parsing.

Definition at line 271 of file retinalobjs.h.

const string RetinalObjectStringArgs::parsed_get_default ( const string & name ) const [inline]
 

Looks up and returns a parse of the default with the given name.

Definition at line 263 of file retinalobjs.h.

const string RetinalObjectStringArgs::parsed_next ( const string & name ) [inline]
 

Consumes the next argument using the given name to find the default.

Definition at line 267 of file retinalobjs.h.

Referenced by RetinalObjectFactory::create().

void RetinalObjectStringArgs::set_default ( const string & name,
const string & value ) [inline]
 

Overrides defaults in the map passed in at construction.

Definition at line 256 of file retinalobjs.h.

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 87 of file retinalobjs.c.


Friends And Related Function Documentation

class RetinalObjectFactory [friend]
 

Definition at line 284 of file retinalobjs.h.


The documentation for this class was generated from the following files:
Generated at Mon Aug 21 00:31:25 2000 for RF-LISSOM by doxygen1.2.1 written by Dimitri van Heesch, © 1997-2000