|new(@args)||Creates and initializes an empty Class::MethodMapper. Calls set() with its arguments.|
set_map(%map) Sets the complete map for this object. See FestVox::InitMap for a good example of a method map; it is the big one that FestVox::PointyClicky itself uses. This should be generalized to let you set <B>whichB> map, as get_map() below. get_map($type) Get the map of a particular type, e.g. parameter. Note that the object itself is the top-level (complete) map, since Class::MethodMapper writes into variables in the object of the same name; the map itself is just the variables of that type. delete_map(@mapnames) Delete the mapping for each variable in @mapnames. get_meta(type, var) Get the meta data of a given type for a named variable in th method map.
set_meta(type, var, value) Just what you would think. Sets the meta variable type of var to value. set(var => value) Set the variable var to the value value. Checks if var is in the method map, and complains if it is not. Does basic type checking if the meta variable domain is defined. get(var) Return the value of var if it is defined and in the method map. save(type, \&callback, @args) loops over all the keys that have type type and calls
&$callback ($self, $key, $value, @args);
for each of them, where $key is the value of each key and $value is the hashref for its value.
save_config (filename) saves all parameter type key/value pairs to filename (\&callback, @args) loads earlier saved values of the object keys back by calling
&$callback ($self, @args);
it expects the callback to return a ($key, $value) list. keeps looping till the callback function returns an undefined key.
restore_config (filename) loads values from the file filename, which is in the format that save_config writes out. var() var itself is promoted to method status; if given no argument, it is considered a get(), and if given argument(s), it is considered a set(). Thus, if you had a parameter called active in the method map, Class::MethodMapper would use AutoLoader to create a active() method (if ever called), so that $self-active> would return the current value, and $self-active(1)> would set it to 1.
Copyright (c) 2000 Kevin A. Lenzo and Alan W Black, Carnegie Mellon Unversity.
|perl v5.20.3||CLASS::METHODMAPPER (3)||2001-03-19|