49template <
class TKey,
class TValue,
class TKeyComp = std::less<TKey>,
50 class TAlloc = std::allocator<std::pair<const TKey, const TValue>>>
59 using value_type = std::pair<const key_type, const mapped_type>;
83 return comp(a.first, b.first);
88 return comp(a, b.first);
93 return comp(a.first, b);
108 using pointer =
typename alloc_traits::pointer;
151 [[nodiscard]] value_compare
value_comp() const noexcept;
210 void clear() noexcept;
250 template <class TMapped>
266 template <class TMapped>
282 template <class... Args>
299 template <class... Args>
Declarations of the persistent AVL tree.
version_type get_current_version() const noexcept
Returns the current verison.
Definition _persistent_avl.hpp:345
persistent_avl_version_type version_type
Definition _persistent_avl.hpp:99
version_type get_preceding_version(version_type version) const
Returns the preceding version to the given version.
Definition _persistent_avl.hpp:351
A map type using an AVL tree as the underlying structure.
Definition map.hpp:47
A persistent map type using an AVL tree as the underlying structure.
Definition persistent_map.hpp:51
std::pair< bool, version_type > erase(const key_type &key, version_type version) noexcept
Erases an item with the given key.
Definition persistent_map.ipp:242
~persistent_map() noexcept
Definition persistent_map.ipp:68
void clear() noexcept
Erases the whole tree with all its versions.
Definition persistent_map.ipp:149
std::pair< const key_type, const mapped_type > value_type
Definition persistent_map.hpp:59
int get_height(version_type version) const noexcept
Returns the height of the underlying tree in the given version.
Definition persistent_map.ipp:141
typename alloc_traits::size_type size_type
Definition persistent_map.hpp:105
bool contains(const key_type &key, version_type version) const noexcept
Checks whether there exists an item with given key in the tree.
Definition persistent_map.ipp:119
typename alloc_traits::const_pointer const_pointer
Definition persistent_map.hpp:109
std::allocator_traits< allocator_type > alloc_traits
Definition persistent_map.hpp:104
const value_type & const_reference
Definition persistent_map.hpp:62
TValue mapped_type
Definition persistent_map.hpp:58
bool empty(version_type version) const noexcept
Checks whether the map contains any values in a given version.
Definition persistent_map.ipp:128
std::pair< bool, version_type > try_emplace(const key_type &key, version_type version, Args &&...args)
Construct an item in-place.
value_compare value_comp() const noexcept
Returns the function that compares keys in the key, value pairs.
Definition persistent_map.ipp:88
std::vector< const mapped_type * > list_in_order(version_type version) const noexcept
Returns a vector of values sorted by keys.
Definition persistent_map.ipp:97
persistent_map()
Definition persistent_map.ipp:20
typename alloc_traits::difference_type difference_type
Definition persistent_map.hpp:106
version_type get_current_version() const noexcept
Returns the current verison.
Definition persistent_map.hpp:326
size_type size(version_type version) const noexcept
Returns the current number of items in the given version.
Definition persistent_map.ipp:135
std::pair< bool, version_type > insert_or_assign(const key_type &key, TMapped &&value, version_type version)
Inserts an item or assigns the value.
void swap(persistent_map &other) noexcept
Swaps the content.
Definition persistent_map.ipp:248
TAlloc allocator_type
Definition persistent_map.hpp:103
std::pair< bool, version_type > insert(const value_type &item, version_type version)
Inserts an item.
Definition persistent_map.ipp:156
typename tree_type::version_type version_type
Definition persistent_map.hpp:124
persistent_map & operator=(const persistent_map &other)
Definition persistent_map.ipp:42
TKey key_type
Definition persistent_map.hpp:57
typename alloc_traits::pointer pointer
Definition persistent_map.hpp:108
const mapped_type * find(const key_type &key, version_type version) const noexcept
Access specified item.
Definition persistent_map.ipp:109
key_compare key_comp() const noexcept
Returns the function that compares keys.
Definition persistent_map.ipp:82
TKeyComp key_compare
Definition persistent_map.hpp:66
value_type & reference
Definition persistent_map.hpp:61
version_type get_preceding_version(version_type version) const
Returns the preceding version to the given version.
Definition persistent_map.hpp:332
allocator_type get_allocator() const noexcept
Returns the associated allocator.
Definition persistent_map.ipp:76
Declarations of the persistent map.
Definition _avl.hpp:14
Implementation of the persistent map.
Definition persistent_map.hpp:73
bool operator()(const value_type &a, const value_type &b) const noexcept
Definition persistent_map.hpp:81
key_compare comp
Definition persistent_map.hpp:76
bool operator()(const key_type &a, const value_type &b) const noexcept
Definition persistent_map.hpp:86
value_compare(key_compare c)
Definition persistent_map.hpp:79
bool operator()(const value_type &a, const key_type &b) const noexcept
Definition persistent_map.hpp:91
bool operator()(const key_type &a, const key_type &b) const noexcept
Definition persistent_map.hpp:96