22 #ifndef USSHRINKABLEMAP_H
23 #define USSHRINKABLEMAP_H
25 #include "usGlobalConfig.h"
37 template<
class Key,
class T>
41 static std::map<Key,T> emptyContainer;
46 typedef typename container_type::iterator
iterator;
48 typedef typename container_type::size_type
size_type;
49 typedef typename container_type::key_type
key_type;
52 typedef typename container_type::reference
reference;
56 : container(emptyContainer)
62 return container.begin();
67 return container.begin();
72 return container.end();
75 const_iterator
end()
const
77 return container.end();
82 return container.erase(pos);
85 void erase(iterator first, iterator last)
87 return container.erase(first, last);
92 return container.erase(key);
97 return container.empty();
107 return container.size();
112 return container.max_size();
117 return container[key];
120 size_type
count(
const Key& key)
const
122 return container.count(key);
127 return container.find(key);
130 const_iterator
find(
const Key& key)
const
132 return container.find(key);
137 return container.equal_range(key);
140 std::pair<const_iterator,const_iterator>
equal_range(
const Key& key)
const
142 return container.equal_range(key);
147 return container.lower_bound(key);
152 return container.lower_bound(key);
157 return container.upper_bound(key);
162 return container.upper_bound(key);
167 friend class ServiceHooks;
170 : container(container)
173 container_type& container;
176 template<
class Key,
class T>
177 std::map<Key,T> ShrinkableMap<Key,T>::emptyContainer;
181 #endif // USSHRINKABLEMAP_H
container_type::mapped_type mapped_type
container_type::key_type key_type
void erase(iterator first, iterator last)
const_iterator find(const Key &key) const
iterator find(const Key &key)
const_iterator upper_bound(const Key &key) const
size_type count(const Key &key) const
iterator lower_bound(const Key &key)
container_type::const_iterator const_iterator
container_type::const_reference const_reference
std::pair< iterator, iterator > equal_range(const Key &key)
T & operator[](const Key &key)
size_type erase(const Key &key)
const_iterator lower_bound(const Key &key) const
iterator upper_bound(const Key &key)
size_type max_size() const
container_type::value_type value_type
container_type::size_type size_type
std::pair< const_iterator, const_iterator > equal_range(const Key &key) const
container_type::iterator iterator
const_iterator end() const
container_type::reference reference
std::map< Key, T > container_type
const_iterator begin() const