13 #ifndef USSHRINKABLEMAP_H
14 #define USSHRINKABLEMAP_H
28 template<
class Key,
class T>
32 static std::map<Key,T> emptyContainer;
37 typedef typename container_type::iterator
iterator;
39 typedef typename container_type::size_type
size_type;
40 typedef typename container_type::key_type
key_type;
43 typedef typename container_type::reference
reference;
47 : container(emptyContainer)
53 return container.begin();
58 return container.begin();
63 return container.end();
68 return container.end();
73 return container.erase(pos);
78 return container.erase(first, last);
83 return container.erase(key);
88 return container.empty();
98 return container.size();
103 return container.max_size();
108 return container[key];
113 return container.count(key);
118 return container.find(key);
123 return container.find(key);
128 return container.equal_range(key);
131 std::pair<const_iterator,const_iterator>
equal_range(
const Key& key)
const
133 return container.equal_range(key);
138 return container.lower_bound(key);
143 return container.lower_bound(key);
148 return container.upper_bound(key);
153 return container.upper_bound(key);
161 : container(container)
167 template<
class Key,
class T>
168 std::map<Key,T> ShrinkableMap<Key,T>::emptyContainer;
A std::map style associative container allowing query and removal operations only.
container_type::iterator iterator
const_iterator end() const
size_type count(const Key &key) const
std::map< Key, T > container_type
size_type max_size() const
const_iterator upper_bound(const Key &key) const
const_iterator lower_bound(const Key &key) const
iterator upper_bound(const Key &key)
container_type::const_iterator const_iterator
friend class ServiceHooks
T & operator[](const Key &key)
std::pair< const_iterator, const_iterator > equal_range(const Key &key) const
const_iterator find(const Key &key) const
size_type erase(const Key &key)
container_type::key_type key_type
container_type::const_reference const_reference
void erase(iterator first, iterator last)
container_type::value_type value_type
std::pair< iterator, iterator > equal_range(const Key &key)
container_type::mapped_type mapped_type
container_type::reference reference
iterator lower_bound(const Key &key)
const_iterator begin() const
container_type::size_type size_type
iterator find(const Key &key)