#include <lock_map.h>
A map which inherits from mutex to provide synchronization capabilities. It guarantees the following:
Inheritance diagram for lock_map< S, T >:
Public Types | |
typedef map_type::iterator | iterator |
typedef map_type::const_iterator | const_iterator |
typedef map_type::size_type | size_type |
typedef S | key_type |
typedef T | data_type |
Public Member Functions | |
iterator | begin () |
iterator | end () |
const_iterator | begin () const |
const_iterator | end () const |
size_type | size () const |
size_type | erase (const key_type &k) |
void | erase (iterator pos) |
iterator | find (const key_type &k) |
data_type & | operator[] (const key_type &k) |
Private Types | |
typedef std::map< S, T > | map_type |
Private Attributes | |
std::map< S, T > | m_map |
|
An iterator for the map. Note that the map does not retain the order in
which the elements are added, rather it sorts the elements by their
keys. The iterator points to a pair which has the form |
|
The type of the values stored in the map. |
|
An iterator for the map. Note that the map does not retain the order in
which the elements are added, rather it sorts the elements by their
keys. The iterator points to a pair which has the form |
|
The type of the keys used to index the map. |
|
The type of the map used internally. Currently this is std::map. |
|
The type used to keep track of the number of elements in the map. |
|
Gets the element at the beginning of the map.
|
|
Gets the element at the beginning of the map.
|
|
Gets an element at the end of the map. Note that the const_iterator returned by end() does not refer to a valid element and that any valid element that the const_iterator may refer to cannot be modified.
|
|
Gets an element at the end of the map. Note that the iterator returned by end() does not refer to a valid element.
|
|
Removes an element from the map.
|
|
Removes an element from the map.
|
|
Finds an element in the map.
|
|
Gets a value in the map by using the associated key.
|
|
Gets the number of elements in the map.
|
|
|