cpp-stat-bench 0.24.0
Benchmark library with statistics for C++.
|
Class of mapping which preserves order of insertion. More...
#include <stat_bench/util/ordered_map.h>
Public Types | |
using | const_iterator |
Type of iterators. | |
using | iterator |
Type of iterators. | |
Public Member Functions | |
OrderedMap ()=default | |
Constructor. | |
OrderedMap (std::initializer_list< std::pair< Key, MappedValue > > initializer_list) | |
Constructor. | |
auto | at (const Key &key) const -> const MappedValue & |
Access a mapped value. | |
auto | begin () -> iterator |
Get an iterator pointing to the beginning of pairs. | |
auto | begin () const -> const_iterator |
Get an iterator pointing to the beginning of pairs. | |
auto | count (const Key &key) const -> std::size_t |
Count the number of pairs with a key. | |
template<typename... Args> | |
auto | emplace (Args &&... args) -> std::pair< iterator, bool > |
Insert a pair. | |
auto | empty () const noexcept -> bool |
Check whether this mapping is empty. | |
auto | end () -> iterator |
Get an iterator pointing to the end of pairs. | |
auto | end () const -> const_iterator |
Get an iterator pointing to the end of pairs. | |
auto | erase (const_iterator iter) -> iterator |
Erase a pair. | |
auto | find (const Key &key) const -> const_iterator |
Find a pair with a key. | |
auto | operator!= (const OrderedMap &rhs) const -> bool |
Check whether this is not equal to another mapping. | |
auto | operator== (const OrderedMap &rhs) const -> bool |
Check whether this is equal to another mapping. | |
auto | operator[] (const Key &key) -> MappedValue & |
Access a mapped value. | |
auto | pairs () const noexcept -> const std::vector< std::pair< Key, MappedValue > > & |
Get pairs. | |
void | reserve (std::size_t size) |
Reserve memory space. | |
auto | size () const noexcept -> std::size_t |
Get the number of pairs. | |
template<typename... Args> | |
auto | try_emplace (const Key &key, Args &&... args) -> std::pair< iterator, bool > |
Insert a pair if the key does not exist. | |
Class of mapping which preserves order of insertion.
Key | Type of keys. |
MappedValue | Type of mapped values. |
Definition at line 39 of file ordered_map.h.
using stat_bench::util::OrderedMap< Key, MappedValue >::const_iterator |
Type of iterators.
Definition at line 46 of file ordered_map.h.
using stat_bench::util::OrderedMap< Key, MappedValue >::iterator |
Type of iterators.
Definition at line 42 of file ordered_map.h.
|
inline |
Constructor.
[in] | initializer_list | Initializer list. |
Definition at line 59 of file ordered_map.h.
|
inlinenodiscard |
Access a mapped value.
[in] | key | Key. |
Definition at line 187 of file ordered_map.h.
|
inlinenodiscard |
Get an iterator pointing to the beginning of pairs.
Definition at line 210 of file ordered_map.h.
|
inlinenodiscard |
Get an iterator pointing to the beginning of pairs.
Definition at line 217 of file ordered_map.h.
|
inlinenodiscard |
Count the number of pairs with a key.
[in] | key | Key. |
Definition at line 91 of file ordered_map.h.
|
inline |
Insert a pair.
Args | Types of arguments. |
[in] | args | Arguments. |
Definition at line 113 of file ordered_map.h.
|
inlinenodiscardnoexcept |
Check whether this mapping is empty.
true | This mapping is empty. |
false | This mapping is not empty. |
Definition at line 72 of file ordered_map.h.
|
inlinenodiscard |
Get an iterator pointing to the end of pairs.
Definition at line 226 of file ordered_map.h.
|
inlinenodiscard |
Get an iterator pointing to the end of pairs.
Definition at line 233 of file ordered_map.h.
|
inline |
Erase a pair.
[in] | iter | Iterator pointing to the pair. |
Definition at line 151 of file ordered_map.h.
|
inlinenodiscard |
Find a pair with a key.
[in] | key | Key. |
Definition at line 197 of file ordered_map.h.
|
inlinenodiscard |
Check whether this is not equal to another mapping.
[in] | rhs | Right-hand-side mapping. |
true | This is not equal to the right-hand-side mapping. |
false | This is equal to the right-hand-side mapping. |
Definition at line 262 of file ordered_map.h.
|
inlinenodiscard |
Check whether this is equal to another mapping.
[in] | rhs | Right-hand-side mapping. |
true | This is equal to the right-hand-side mapping. |
false | This is not equal to the right-hand-side mapping. |
Definition at line 242 of file ordered_map.h.
|
inlinenodiscard |
Access a mapped value.
[in] | key | Key. |
Definition at line 169 of file ordered_map.h.
|
inlinenodiscardnoexcept |
|
inline |
Reserve memory space.
[in] | size | Number of pairs. |
Definition at line 100 of file ordered_map.h.
|
inlinenodiscardnoexcept |
|
inline |
Insert a pair if the key does not exist.
Args | Types of arguments. |
[in] | key | Key. |
[in] | args | Arguments. |
Definition at line 133 of file ordered_map.h.