#include <retinalobjs.h>
Collaboration diagram for RetinalObjectStringArgs:
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 ¶ms) |
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::Variable & | parse (const string &s, Retinal_Object::Variable &x) const |
Simple numeric parsing. | |
Friends | |
class | RetinalObjectFactory |
|
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(). |
|
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(). |