Changeset View
Changeset View
Standalone View
Standalone View
src/limitedmap.h
Show All 21 Lines | |||||
protected: | protected: | ||||
std::map<K, V> map; | std::map<K, V> map; | ||||
typedef typename std::map<K, V>::iterator iterator; | typedef typename std::map<K, V>::iterator iterator; | ||||
std::multimap<V, iterator> rmap; | std::multimap<V, iterator> rmap; | ||||
typedef typename std::multimap<V, iterator>::iterator rmap_iterator; | typedef typename std::multimap<V, iterator>::iterator rmap_iterator; | ||||
size_type nMaxSize; | size_type nMaxSize; | ||||
public: | public: | ||||
limitedmap(size_type nMaxSizeIn) { | explicit limitedmap(size_type nMaxSizeIn) { | ||||
assert(nMaxSizeIn > 0); | assert(nMaxSizeIn > 0); | ||||
nMaxSize = nMaxSizeIn; | nMaxSize = nMaxSizeIn; | ||||
} | } | ||||
const_iterator begin() const { return map.begin(); } | const_iterator begin() const { return map.begin(); } | ||||
const_iterator end() const { return map.end(); } | const_iterator end() const { return map.end(); } | ||||
size_type size() const { return map.size(); } | size_type size() const { return map.size(); } | ||||
bool empty() const { return map.empty(); } | bool empty() const { return map.empty(); } | ||||
const_iterator find(const key_type &k) const { return map.find(k); } | const_iterator find(const key_type &k) const { return map.find(k); } | ||||
▲ Show 20 Lines • Show All 62 Lines • Show Last 20 Lines |