#include <pointermap.h>
Public Types | |
| typedef K | key_type |
| Key type of our local map. More... | |
| typedef 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 const_iterator. More... | |
Public Methods | |
| PointerMap () | |
| virtual | ~PointerMap () |
| 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... | |
| T* | getptr (const key_type& k) |
| Similar to map's [], but if the key is not present just returns a null pointer without adding a new entry. More... | |
| const T* | getptr (const key_type& k) const |
| Const version of getptr. More... | |
| void | erase () |
| Remove all items from the map. More... | |
| void | erase (const key_type& k) |
| Remove the item with the given key, if any, from the map. More... | |
Protected Attributes | |
| map_type | m |
| Underlying container. More... | |
By default, the objects are assumed to be allocated on the heap and their memory management is handled by the database; if instead you wish to manage the memory yourself (e.g. for objects existing in more than one map) supply false for the owns_objects template parameter.
Definition at line 32 of file pointermap.h.
|
|||
|
Map's const_iterator.
Definition at line 51 of file pointermap.h. |
|
|||
|
Data element type of our local map.
Definition at line 39 of file pointermap.h. |
|
|||
|
Map's iterator.
Definition at line 48 of file pointermap.h. |
|
|||
|
Key type of our local map.
Definition at line 36 of file pointermap.h. |
|
|||
|
Type of our local map.
Definition at line 45 of file pointermap.h. |
|
|||
|
Element type of our local map.
Definition at line 42 of file pointermap.h. |
|
||||
|
Definition at line 54 of file pointermap.h. |
|
||||
|
Definition at line 55 of file pointermap.h. |
|
||||
|
Underlying map's begin().
Definition at line 59 of file pointermap.h. |
|
||||
|
Underlying map's begin().
Definition at line 58 of file pointermap.h. Referenced by Eyes::activate(). |
|
||||
|
Underlying map's end().
Definition at line 61 of file pointermap.h. |
|
||||
|
Underlying map's end().
Definition at line 60 of file pointermap.h. Referenced by Eyes::activate(), getptr(), and set(). |
|
||||
|
Remove the item with the given key, if any, from the map.
Definition at line 110 of file pointermap.h. |
|
||||
|
Remove all items from the map.
Definition at line 102 of file pointermap.h. Referenced by Eyes::uninit(). |
|
||||
|
Const version of getptr.
Definition at line 93 of file pointermap.h. |
|
||||
|
Similar to map's [], but if the key is not present just returns a null pointer without adding a new entry.
Definition at line 87 of file pointermap.h. Referenced by Eyes::activate(), and erase(). |
|
||||
|
Insert into underlying map.
Definition at line 63 of file pointermap.h. Referenced by set(). |
|
||||||
|
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. It is illegal to supply an invalid pointer to set, since this class will handle the deallocation of the object pointed to. Definition at line 72 of file pointermap.h. Referenced by Eyes::init(). |
|
|||
|
Underlying container.
Definition at line 119 of file pointermap.h. |
1.2.1 written by Dimitri van Heesch,
© 1997-2000