#include <valuegenmap.h>
Inheritance diagram for ValueGeneratorMap


Public Types | |
| typedef K | key_type |
| Key type of our local map. More... | |
| typedef ValueGenerator<T>* | data_type |
| Data element type of our local map. More... | |
| typedef pair<const key_type, data_type> | value_type |
| Element type of our local map. More... | |
| typedef std::map< key_type, data_type > | map_type |
| Type of our local map. More... | |
| typedef map_type::iterator | iterator |
| Map's iterator. More... | |
| typedef map_type::const_iterator | const_iterator |
| Map's iterator. More... | |
Public Methods | |
| ValueGeneratorMap () | |
| ValueGeneratorMap (const ValueGeneratorMap& b) | |
| ~ValueGeneratorMap () | |
| iterator | begin () |
| Underlying map's begin(). More... | |
| const_iterator | begin () const |
| Underlying map's begin(). More... | |
| iterator | end () |
| Underlying map's end(). More... | |
| const_iterator | end () const |
| Underlying map's end(). More... | |
| pair<iterator,bool> | insert (const value_type& x) |
| Insert into underlying map. More... | |
| void | set (const key_type& k, const data_type d) |
| Instead of directly using the map's [], which has a tricky semantics, or find, which is cumbersome, map access is handled through named get and set member functions. More... | |
| void | set_default (const key_type& k, const T d) |
| Set only if not yet set. More... | |
| T | get (const key_type& k) const |
| Similar to map's [], but returns actual value (not pointer or ValueGenerator), has a default of zero if not found, and never adds a new entry. More... | |
| T* | getptr (const key_type& k) |
| Similar to [], but adds a new ValueGenerator if the key is not found rather than adding a null pointer. More... | |
| virtual bool | next () |
| Advance to the next state (whatever that means for this object). More... | |
| virtual void | reset () |
| Reset to the starting state. More... | |
| virtual void | relink (const ValueGeneratorMap<T,K>* b) |
| Relink all of the ValueGenerators in this map with those in the given map. More... | |
| virtual void | merge (const ValueGeneratorMap<T,K>& b) |
| Incorporate ValueGenerators from another map. More... | |
| virtual ValueGeneratorMap< T,K>* | clone () const |
| Construct and return an identical copy of self. More... | |
It uses an STL map to provide get and set operations on parameters, and also provides the ValueGen operations, (making it be a ValueGen itself). In fact, this should really be implemented as a ValueGenMap, since it does not really depend on the object types. Unfortunately, Cray's compiler won't currently support clone() for such a case, and thus currently this is restricted to items of a single arithmetic type.
Definition at line 40 of file valuegenmap.h.
|
|||
|
Map's iterator.
Definition at line 58 of file valuegenmap.h. |
|
|||
|
Data element type of our local map.
Definition at line 46 of file valuegenmap.h. |
|
|||
|
Map's iterator.
Definition at line 55 of file valuegenmap.h. |
|
|||
|
Key type of our local map.
Definition at line 43 of file valuegenmap.h. |
|
|||
|
Type of our local map.
Definition at line 52 of file valuegenmap.h. |
|
|||
|
Element type of our local map.
Definition at line 49 of file valuegenmap.h. |
|
||||
|
Definition at line 60 of file valuegenmap.h. |
|
||||
|
Definition at line 62 of file valuegenmap.h. |
|
||||
|
Definition at line 68 of file valuegenmap.h. |
|
||||
|
Underlying map's begin().
Definition at line 72 of file valuegenmap.h. |
|
||||
|
Underlying map's begin().
Definition at line 71 of file valuegenmap.h. Referenced by merge(). |
|
||||
|
Construct and return an identical copy of self.
Definition at line 114 of file valuegenmap.h. Referenced by merge(). |
|
||||
|
Underlying map's end().
Definition at line 74 of file valuegenmap.h. |
|
||||
|
Underlying map's end().
Definition at line 73 of file valuegenmap.h. Referenced by get(), getptr(), merge(), relink(), set(), and set_default(). |
|
||||
|
Similar to map's [], but returns actual value (not pointer or ValueGenerator), has a default of zero if not found, and never adds a new entry. See Roldan Pozo's C++ notes, lecture 4, for how to implement this as operator[] in a way that will still work with const references. Definition at line 147 of file valuegenmap.h. Referenced by Retinal_Object::get_var(). |
|
||||
|
Similar to [], but adds a new ValueGenerator if the key is not found rather than adding a null pointer. Unlike get() this returns a pointer to the actual data, and should thus only be used when absolutely necessary. Definition at line 157 of file valuegenmap.h. Referenced by Retinal_Object::get_varptr(). |
|
||||
|
Insert into underlying map.
Definition at line 76 of file valuegenmap.h. Referenced by getptr(), set(), and set_default(). |
|
||||
|
Incorporate ValueGenerators from another map.
Definition at line 205 of file valuegenmap.h. Referenced by Retinal_Object::VarMap(), and Retinal_Object::merge_vars(). |
|
||||
|
Advance to the next state (whatever that means for this object).
Reimplemented from ValueGen. Definition at line 170 of file valuegenmap.h. Referenced by Retinal_Object::next(). |
|
||||
|
Relink all of the ValueGenerators in this map with those in the given map.
Definition at line 192 of file valuegenmap.h. Referenced by Retinal_Object::relink(). |
|
||||
|
Reset to the starting state.
Reimplemented from ValueGen. Definition at line 183 of file valuegenmap.h. Referenced by Retinal_Object::reset(). |
|
||||||
|
Instead of directly using the map's [], which has a tricky semantics, or find, which is cumbersome, map access is handled through named get and set member functions.
Definition at line 123 of file valuegenmap.h. Referenced by merge(). |
|
||||||
|
Set only if not yet set.
Definition at line 136 of file valuegenmap.h. Referenced by Retinal_Object::set_var_default(). |
1.2.1 written by Dimitri van Heesch,
© 1997-2000