#include <vectormap.h>
Classes | |
struct | FirstCompare |
struct | FirstOrder |
Public Types | |
typedef Key | key_type |
typedef Tp | mapped_type |
typedef std::pair< Key, Tp > | value_type |
typedef std::vector< value_type > | vector_type |
typedef vector_type::difference_type | difference_type |
typedef vector_type::iterator | iterator |
typedef vector_type::const_iterator | const_iterator |
Public Member Functions | |
vectormap () | |
vectormap (const vectormap< Key, Tp > &other) | |
void | insert (const value_type &x) |
void | sort () |
const Tp & | operator[] (const key_type &key) const |
iterator | find (const key_type &key) |
const_iterator | find (const key_type &key) const |
difference_type | count (const key_type &key) const |
Private Attributes | |
bool | _sorted |
This vectormap
templated class is intended to provide the performance characteristics of a sorted std::vector with an interface more closely resembling that of a std::map, for use in particular when memory is tight.
This class is limited in its applicability. The typical use case is:
* vectormap<KeyType,ValType> vmap; * for ( ; ;) * vmap.insert (std::make_pair(key,val)); * * val1 = vmap[key1]; * val2 = vmap[key2]; *
Definition at line 61 of file vectormap.h.
typedef vector_type::const_iterator libMesh::vectormap< Key, Tp >::const_iterator |
Definition at line 72 of file vectormap.h.
typedef vector_type::difference_type libMesh::vectormap< Key, Tp >::difference_type |
Definition at line 70 of file vectormap.h.
typedef vector_type::iterator libMesh::vectormap< Key, Tp >::iterator |
Definition at line 71 of file vectormap.h.
typedef Key libMesh::vectormap< Key, Tp >::key_type |
Definition at line 66 of file vectormap.h.
typedef Tp libMesh::vectormap< Key, Tp >::mapped_type |
Definition at line 67 of file vectormap.h.
typedef std::pair<Key, Tp> libMesh::vectormap< Key, Tp >::value_type |
Definition at line 68 of file vectormap.h.
typedef std::vector<value_type> libMesh::vectormap< Key, Tp >::vector_type |
Definition at line 69 of file vectormap.h.
|
inline |
Default constructor. Initializes sorted member to false.
Definition at line 101 of file vectormap.h.
|
inline |
|
inline |
key
.For a map-like object, this should be 1 or 0.
Definition at line 210 of file vectormap.h.
References libMesh::vectormap< Key, Tp >::_sorted, end, and libMesh::vectormap< Key, Tp >::sort().
|
inline |
Definition at line 160 of file vectormap.h.
References libMesh::vectormap< Key, Tp >::_sorted, end, and libMesh::vectormap< Key, Tp >::sort().
|
inline |
Definition at line 183 of file vectormap.h.
References libMesh::vectormap< Key, Tp >::_sorted, end, and libMesh::vectormap< Key, Tp >::sort().
|
inline |
Inserts x
into the vectormap.
Definition at line 116 of file vectormap.h.
References libMesh::vectormap< Key, Tp >::_sorted.
|
inline |
key
Definition at line 137 of file vectormap.h.
References libMesh::vectormap< Key, Tp >::_sorted, end, and libMesh::vectormap< Key, Tp >::sort().
|
inline |
Sort & unique the vectormap, preparing for use.
Definition at line 125 of file vectormap.h.
References libMesh::vectormap< Key, Tp >::_sorted, and end.
Referenced by libMesh::vectormap< Key, Tp >::count(), libMesh::vectormap< Key, Tp >::find(), and libMesh::vectormap< Key, Tp >::operator[]().
|
private |
Definition at line 232 of file vectormap.h.
Referenced by libMesh::vectormap< Key, Tp >::count(), libMesh::vectormap< Key, Tp >::find(), libMesh::vectormap< Key, Tp >::insert(), libMesh::vectormap< Key, Tp >::operator[](), and libMesh::vectormap< Key, Tp >::sort().