Public Types | |
| typedef OFPair< K, V > | value_type |
| the type of values saved in this map | |
Public Member Functions | |
| typedef | OFListIterator (value_type) iterator |
| iterator class for OFMap. | |
| typedef | OFListConstIterator (value_type) const _iterator |
| constant iterator class for OFMap. | |
| OFMap () | |
| default constructor | |
| OFMap & | operator= (const OFMap &other) |
| copy constructor | |
| V & | operator[] (const K &key) |
| index operator. | |
| iterator | begin () |
| returns iterator pointing to the first element of this map | |
| iterator | end () |
| returns iterator pointer after the last element of this map | |
| const_iterator | begin () const |
| returns constant iterator pointing to the first element of this map | |
| const_iterator | end () const |
| returns constant iterator pointer after the last element of this map | |
| iterator | find (const K &key) |
| looks up the given key in this map | |
| const_iterator | find (const K &key) const |
| looks up the given key in this map | |
| size_t | size () const |
| returns the number of elements saved in this map | |
| void | clear () |
| removes all elements from this map | |
| void | erase (const iterator &first, const iterator &last) |
| removes all elements in the given range from this map | |
| void | erase (const iterator &elem) |
| removes the element to which the given iterator points to | |
| int | erase (const K &key) |
| removes the element with the given key from this map | |
| OFPair< iterator, bool > | insert (const value_type &val) |
| inserts a new element into the map, but does not overwrite existing elements | |
Protected Attributes | |
| OFList< value_type > | values_ |
This class is a subset of std::map.
Definition at line 97 of file ofmap.h.
| typedef OFMap< K, V >::OFListIterator | ( | value_type | ) |
iterator class for OFMap.
You can modify elements through this iterator's ->first and ->second properties.
Referenced by OFMap< K, V >::insert().
| typedef OFMap< K, V >::OFListConstIterator | ( | value_type | ) | const |
constant iterator class for OFMap.
You can read the elements, but you may not modify them.
| V& OFMap< K, V >::operator[] | ( | const K & | key | ) | [inline] |
index operator.
You can use this to add new elements to the map. Beware: Don't use this for checking if a given key is already used in the map, use find() != end() for this job!
| key | the key you want to access |
Definition at line 142 of file ofmap.h.
References OFMap< K, V >::end(), OFMap< K, V >::find(), and OFMap< K, V >::insert().
| iterator OFMap< K, V >::begin | ( | ) | [inline] |
returns iterator pointing to the first element of this map
Definition at line 156 of file ofmap.h.
References OFMap< K, V >::values_.
Referenced by OFMap< K, V >::find(), and OFMap< K, V >::operator=().
| iterator OFMap< K, V >::end | ( | ) | [inline] |
returns iterator pointer after the last element of this map
Definition at line 161 of file ofmap.h.
References OFMap< K, V >::values_.
Referenced by OFMap< K, V >::erase(), OFMap< K, V >::find(), OFMap< K, V >::insert(), OFMap< K, V >::operator=(), and OFMap< K, V >::operator[]().
| const_iterator OFMap< K, V >::begin | ( | ) | const [inline] |
returns constant iterator pointing to the first element of this map
Definition at line 166 of file ofmap.h.
References OFMap< K, V >::values_.
| const_iterator OFMap< K, V >::end | ( | ) | const [inline] |
returns constant iterator pointer after the last element of this map
Definition at line 171 of file ofmap.h.
References OFMap< K, V >::values_.
| iterator OFMap< K, V >::find | ( | const K & | key | ) | [inline] |
looks up the given key in this map
| key | the key to look for |
Definition at line 177 of file ofmap.h.
References OFMap< K, V >::begin(), and OFMap< K, V >::end().
Referenced by OFMap< K, V >::erase(), OFMap< K, V >::insert(), and OFMap< K, V >::operator[]().
| const_iterator OFMap< K, V >::find | ( | const K & | key | ) | const [inline] |
looks up the given key in this map
| key | the key to look for |
Definition at line 194 of file ofmap.h.
References OFMap< K, V >::begin(), and OFMap< K, V >::end().
| size_t OFMap< K, V >::size | ( | ) | const [inline] |
returns the number of elements saved in this map
Definition at line 210 of file ofmap.h.
References OFMap< K, V >::values_.
| void OFMap< K, V >::erase | ( | const iterator & | first, | |
| const iterator & | last | |||
| ) | [inline] |
removes all elements in the given range from this map
| first | the first element to remove | |
| last | the first element NOT to remove |
Definition at line 219 of file ofmap.h.
References OFMap< K, V >::values_.
| void OFMap< K, V >::erase | ( | const iterator & | elem | ) | [inline] |
removes the element to which the given iterator points to
| elem | the element to remove |
Definition at line 227 of file ofmap.h.
References OFMap< K, V >::values_.
| int OFMap< K, V >::erase | ( | const K & | key | ) | [inline] |
removes the element with the given key from this map
Definition at line 235 of file ofmap.h.
References OFMap< K, V >::end(), OFMap< K, V >::find(), and OFMap< K, V >::values_.
| OFPair<iterator, bool> OFMap< K, V >::insert | ( | const value_type & | val | ) | [inline] |
inserts a new element into the map, but does not overwrite existing elements
| val | the value to insert |
Definition at line 252 of file ofmap.h.
References OFMap< K, V >::end(), OFMap< K, V >::find(), OFPair< K, V >::first, OFMap< K, V >::OFListIterator(), and OFMap< K, V >::values_.
Referenced by OFMap< K, V >::operator=(), and OFMap< K, V >::operator[]().
OFList<value_type> OFMap< K, V >::values_ [protected] |
Definition at line 107 of file ofmap.h.
Referenced by OFMap< K, V >::begin(), OFMap< K, V >::clear(), OFMap< K, V >::end(), OFMap< K, V >::erase(), OFMap< K, V >::insert(), and OFMap< K, V >::size().