libstdc++
__gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc > Class Template Reference

#include <splay_tree_.hpp>

Inherits __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >.

Public Types

typedef _Alloc allocator_type
 
typedef Cmp_Fn cmp_fn
 
typedef std::pair< size_type, size_type > comp_hash
 
typedef base_type::const_iterator const_iterator
 
typedef base_type::const_pointer const_pointer
 
typedef base_type::const_reference const_reference
 
typedef base_type::const_reverse_iterator const_reverse_iterator
 
typedef splay_tree_tag container_category
 
typedef _Alloc::difference_type difference_type
 
typedef base_type::iterator iterator
 
typedef base_type::key_const_pointer key_const_pointer
 
typedef base_type::key_const_reference key_const_reference
 
typedef base_type::key_pointer key_pointer
 
typedef base_type::key_reference key_reference
 
typedef base_type::key_type key_type
 
typedef base_type::mapped_const_pointer mapped_const_pointer
 
typedef base_type::mapped_const_reference mapped_const_reference
 
typedef base_type::mapped_pointer mapped_pointer
 
typedef base_type::mapped_reference mapped_reference
 
typedef base_type::mapped_type mapped_type
 
typedef __nothrowcopy::indicator no_throw_indicator
 
typedef traits_type::node_const_iterator node_const_iterator
 
typedef traits_type::node_iterator node_iterator
 
typedef base_type::node_update node_update
 
typedef base_type::const_iterator point_const_iterator
 
typedef base_type::point_iterator point_iterator
 
typedef base_type::pointer pointer
 
typedef base_type::reference reference
 
typedef base_type::reverse_iterator reverse_iterator
 
typedef _Alloc::size_type size_type
 
typedef integral_constant< int, Store_Hash > store_extra
 
typedef stored_data< value_type, size_type, Store_Hash > stored_data_type
 
typedef base_type::value_type value_type
 

Public Member Functions

 splay_tree_map (const Cmp_Fn &)
 
 splay_tree_map (const Cmp_Fn &, const node_update &)
 
 splay_tree_map (const splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc > &)
 
iterator begin ()
 
const_iterator begin () const
 
void clear ()
 
template<typename It >
void copy_from_range (It, It)
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
iterator erase (iterator it)
 
bool erase (key_const_reference)
 
reverse_iterator erase (reverse_iterator)
 
template<typename Pred >
size_type erase_if (Pred)
 
point_iterator find (key_const_reference)
 
point_const_iterator find (key_const_reference) const
 
Cmp_Fn & get_cmp_fn ()
 
const Cmp_Fn & get_cmp_fn () const
 
void initialize ()
 
std::pair< point_iterator, bool > insert (const_reference r_value)
 
void join (splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc > &)
 
point_iterator lower_bound (key_const_reference)
 
point_const_iterator lower_bound (key_const_reference) const
 
size_type max_size () const
 
node_iterator node_begin ()
 
node_const_iterator node_begin () const
 
node_iterator node_end ()
 
node_const_iterator node_end () const
 
mapped_reference operator[] (key_const_reference r_key)
 
reverse_iterator rbegin ()
 
const_reverse_iterator rbegin () const
 
reverse_iterator rend ()
 
const_reverse_iterator rend () const
 
size_type size () const
 
void split (key_const_reference, splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc > &)
 
void swap (splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc > &)
 
void swap (tree_order_statistics_node_update< Node_CItr, Node_Itr, Cmp_Fn, _Alloc > &)
 
point_iterator upper_bound (key_const_reference)
 
point_const_iterator upper_bound (key_const_reference) const
 

Public Attributes

no_throw_indicator m_no_throw_copies_indicator
 
store_extra m_store_extra_indicator
 

Protected Types

typedef node_alloc_traits::value_type node
 
typedef node_alloc_traits::allocator_type node_allocator
 
typedef traits_type::null_node_update_pointer null_node_update_pointer
 
typedef types_traits< Key, Mapped, _Alloc, false > traits_base
 

Protected Member Functions

void actual_erase_node (node_pointer)
 
template<typename Node_Update_ >
void apply_update (node_pointer, Node_Update_ *)
 
void apply_update (node_pointer, null_node_update_pointer)
 
std::pair< node_pointer, bool > erase (node_pointer)
 
node_pointer get_new_node_for_leaf_insert (const_reference, false_type)
 
node_pointer get_new_node_for_leaf_insert (const_reference, true_type)
 
void initialize_min_max ()
 
iterator insert_imp_empty (const_reference)
 
std::pair< point_iterator, bool > insert_leaf (const_reference)
 
iterator insert_leaf_new (const_reference, node_pointer, bool)
 
void join_finish (tree_order_statistics_node_update< Node_CItr, Node_Itr, Cmp_Fn, _Alloc > &)
 
bool join_prep (tree_order_statistics_node_update< Node_CItr, Node_Itr, Cmp_Fn, _Alloc > &)
 
size_type recursive_count (node_pointer) const
 
void rotate_left (node_pointer)
 
void rotate_parent (node_pointer)
 
void rotate_right (node_pointer)
 
void split_finish (tree_order_statistics_node_update< Node_CItr, Node_Itr, Cmp_Fn, _Alloc > &)
 
bool split_prep (key_const_reference, tree_order_statistics_node_update< Node_CItr, Node_Itr, Cmp_Fn, _Alloc > &)
 
void update_min_max_for_erased_node (node_pointer)
 
template<typename Node_Update_ >
void update_to_top (node_pointer, Node_Update_ *)
 
void update_to_top (node_pointer, null_node_update_pointer)
 
void value_swap (tree_order_statistics_node_update< Node_CItr, Node_Itr, Cmp_Fn, _Alloc > &)
 

Static Protected Member Functions

static void clear_imp (node_pointer)
 

Protected Attributes

node_pointer m_p_head
 
size_type m_size
 

Static Protected Attributes

static node_allocator s_node_allocator
 

Detailed Description

template<typename Key, typename Mapped, typename Cmp_Fn, typename Node_And_It_Traits, typename _Alloc>
class __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >

Splay tree.

Definition at line 107 of file splay_tree_.hpp.

Member Typedef Documentation

◆ allocator_type

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef _Alloc __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::allocator_type

Definition at line 118 of file splay_tree_.hpp.

◆ cmp_fn

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef Cmp_Fn __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::cmp_fn

Definition at line 121 of file splay_tree_.hpp.

◆ comp_hash

typedef std::pair<size_type, size_type> __gnu_pbds::detail::types_traits< Key, Mapped, _Alloc, Store_Hash >::comp_hash
inherited

Definition at line 187 of file types_traits.hpp.

◆ const_iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::const_iterator __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::const_iterator

Definition at line 140 of file splay_tree_.hpp.

◆ const_pointer

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::const_pointer __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::const_pointer

Definition at line 134 of file splay_tree_.hpp.

◆ const_reference

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::const_reference __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::const_reference

Definition at line 136 of file splay_tree_.hpp.

◆ const_reverse_iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::const_reverse_iterator __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::const_reverse_iterator

Definition at line 142 of file splay_tree_.hpp.

◆ container_category

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef splay_tree_tag __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::container_category

Definition at line 117 of file splay_tree_.hpp.

◆ difference_type

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef _Alloc::difference_type __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::difference_type

Definition at line 120 of file splay_tree_.hpp.

◆ iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::iterator __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::iterator

Definition at line 139 of file splay_tree_.hpp.

◆ key_const_pointer

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::key_const_pointer __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::key_const_pointer

Definition at line 124 of file splay_tree_.hpp.

◆ key_const_reference

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::key_const_reference __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::key_const_reference

Definition at line 126 of file splay_tree_.hpp.

◆ key_pointer

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::key_pointer __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::key_pointer

Definition at line 123 of file splay_tree_.hpp.

◆ key_reference

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::key_reference __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::key_reference

Definition at line 125 of file splay_tree_.hpp.

◆ key_type

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::key_type __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::key_type

Definition at line 122 of file splay_tree_.hpp.

◆ mapped_const_pointer

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::mapped_const_pointer __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::mapped_const_pointer

Definition at line 129 of file splay_tree_.hpp.

◆ mapped_const_reference

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::mapped_const_reference __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::mapped_const_reference

Definition at line 131 of file splay_tree_.hpp.

◆ mapped_pointer

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::mapped_pointer __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::mapped_pointer

Definition at line 128 of file splay_tree_.hpp.

◆ mapped_reference

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::mapped_reference __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::mapped_reference

Definition at line 130 of file splay_tree_.hpp.

◆ mapped_type

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::mapped_type __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::mapped_type

Definition at line 127 of file splay_tree_.hpp.

◆ no_throw_indicator

typedef __nothrowcopy::indicator __gnu_pbds::detail::types_traits< Key, Mapped, _Alloc, Store_Hash >::no_throw_indicator
inherited

Definition at line 189 of file types_traits.hpp.

◆ node

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef node_alloc_traits::value_type __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node
protectedinherited

Definition at line 120 of file bin_search_tree_.hpp.

◆ node_allocator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef node_alloc_traits::allocator_type __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_allocator
protectedinherited

Definition at line 118 of file bin_search_tree_.hpp.

◆ node_const_iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef traits_type::node_const_iterator __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_const_iterator
inherited

Definition at line 164 of file bin_search_tree_.hpp.

◆ node_iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef traits_type::node_iterator __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_iterator
inherited

Definition at line 165 of file bin_search_tree_.hpp.

◆ node_update

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::node_update __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_update

Definition at line 143 of file splay_tree_.hpp.

◆ null_node_update_pointer

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef traits_type::null_node_update_pointer __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::null_node_update_pointer
protectedinherited

Definition at line 124 of file bin_search_tree_.hpp.

◆ point_const_iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::const_iterator __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::point_const_iterator

Definition at line 138 of file splay_tree_.hpp.

◆ point_iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::point_iterator __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::point_iterator

Definition at line 137 of file splay_tree_.hpp.

◆ pointer

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::pointer __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::pointer

Definition at line 133 of file splay_tree_.hpp.

◆ reference

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::reference __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::reference

Definition at line 135 of file splay_tree_.hpp.

◆ reverse_iterator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::reverse_iterator __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::reverse_iterator

Definition at line 141 of file splay_tree_.hpp.

◆ size_type

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef _Alloc::size_type __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::size_type

Definition at line 119 of file splay_tree_.hpp.

◆ store_extra

typedef integral_constant<int, Store_Hash> __gnu_pbds::detail::types_traits< Key, Mapped, _Alloc, Store_Hash >::store_extra
inherited

Definition at line 188 of file types_traits.hpp.

◆ stored_data_type

typedef stored_data<value_type, size_type, Store_Hash> __gnu_pbds::detail::types_traits< Key, Mapped, _Alloc, Store_Hash >::stored_data_type
inherited

Definition at line 181 of file types_traits.hpp.

◆ traits_base

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef types_traits<Key, Mapped, _Alloc, false> __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::traits_base
protectedinherited

Definition at line 115 of file bin_search_tree_.hpp.

◆ value_type

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
typedef base_type::value_type __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::value_type

Definition at line 132 of file splay_tree_.hpp.

Member Function Documentation

◆ node_begin() [1/2]

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
node_iterator __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_begin ( )
inlineinherited

Returns a node_iterator corresponding to the node at the root of the tree.

◆ node_begin() [2/2]

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
node_const_iterator __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_begin ( ) const
inlineinherited

Returns a const node_iterator corresponding to the node at the root of the tree.

◆ node_end() [1/2]

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
node_iterator __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_end ( )
inlineinherited

Returns a node_iterator corresponding to a node just after a leaf of the tree.

◆ node_end() [2/2]

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
node_const_iterator __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::node_end ( ) const
inlineinherited

Returns a const node_iterator corresponding to a node just after a leaf of the tree.

◆ operator[]()

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
mapped_reference __gnu_pbds::detail::splay_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::operator[] ( key_const_reference  r_key)
inline

Definition at line 167 of file splay_tree_.hpp.

Member Data Documentation

◆ m_no_throw_copies_indicator

no_throw_indicator __gnu_pbds::detail::types_traits< Key, Mapped, _Alloc, Store_Hash >::m_no_throw_copies_indicator
inherited

Definition at line 192 of file types_traits.hpp.

◆ m_p_head

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
node_pointer __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::m_p_head
protectedinherited

Definition at line 395 of file bin_search_tree_.hpp.

◆ m_size

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
size_type __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::m_size
protectedinherited

Definition at line 396 of file bin_search_tree_.hpp.

◆ m_store_extra_indicator

store_extra __gnu_pbds::detail::types_traits< Key, Mapped, _Alloc, Store_Hash >::m_store_extra_indicator
inherited

Definition at line 191 of file types_traits.hpp.

◆ s_node_allocator

template<typename Key , typename Mapped , typename Cmp_Fn , typename Node_And_It_Traits , typename _Alloc >
node_allocator __gnu_pbds::detail::bin_search_tree_map< Key, Mapped, Cmp_Fn, Node_And_It_Traits, _Alloc >::s_node_allocator
staticprotectedinherited

Definition at line 397 of file bin_search_tree_.hpp.


The documentation for this class was generated from the following file: