34#ifndef _UTILS_SORTEDLISTMAP_HXX_
35#define _UTILS_SORTEDLISTMAP_HXX_
58 typedef typename container_type::iterator
iterator;
62 template <
typename... Args>
64 :
cmp_(std::forward<Args>(args)...)
94 template<
class key_type>
98 return std::lower_bound(
103 template<
class key_type>
107 return std::upper_bound(
113 template<
class key_type>
119 if (ub == lb)
return end();
124 template<
class key_type>
128 return std::equal_range(
An mostly std::set<> compatible class that stores the internal data in a sorted vector.
iterator find(key_type key)
Searches for a single entry.
container_type container_
Holds the actual data elements.
CMP cmp_
Comparator instance.
void lazy_init()
Reestablishes sorted order in case anything was inserted or removed.
iterator lower_bound(key_type key)
void erase(const iterator &it)
Removes an entry from the vector, pointed by an iterator.
void erase(const iterator &it_b, const iterator &it_e)
Removes a sequence of entries from the vector, pointed by a pair of iterators.
container_type::const_iterator const_iterator
Const Iterator type.
iterator upper_bound(key_type key)
std::vector< data_type > container_type
Type that we store data in internally.
void reserve(size_t sz)
Ensures that a given size can be reached without memory allocation.
void insert(data_type &&d)
Adds new entry to the vector.
container_type::iterator iterator
Iterator type.
D data_type
Type of data stored in the set.
void clear()
Removes all entries.
size_t sortedCount_
The first this many elements in the container are already sorted.
std::pair< iterator, iterator > equal_range(key_type key)
#define HASSERT(x)
Checks that the value of expression x is true, else terminates the current process.