NIM 跨平台 C++ SDK
载入中...
搜索中...
未找到
phmap::priv::btree_node< Params > 模板类 参考

#include <btree.h>

类 phmap::priv::btree_node< Params > 继承关系图:
phmap::priv::btree< Params >::EmptyNodeType

Public 类型

using params_type = Params
 
using key_type = typename Params::key_type
 
using value_type = typename Params::value_type
 
using pointer = typename Params::pointer
 
using const_pointer = typename Params::const_pointer
 
using reference = typename Params::reference
 
using const_reference = typename Params::const_reference
 
using key_compare = typename Params::key_compare
 
using size_type = typename Params::size_type
 
using difference_type = typename Params::difference_type
 
using use_linear_search = std::integral_constant< bool, std::is_arithmetic< key_type >::value &&(std::is_same< phmap::Less< key_type >, key_compare >::value||std::is_same< std::less< key_type >, key_compare >::value||std::is_same< std::greater< key_type >, key_compare >::value)>
 

Public 成员函数

 ~btree_node ()=default
 
 btree_node (btree_node const &)=delete
 
btree_nodeoperator= (btree_node const &)=delete
 
bool leaf () const
 
field_type position () const
 
field_type start () const
 
field_type count () const
 
field_type max_count () const
 
btree_nodeparent () const
 
bool is_root () const
 
void make_root ()
 
const key_typekey (size_type i) const
 
reference value (size_type i)
 
const_reference value (size_type i) const
 
btree_nodechild (size_type i) const
 
btree_node *& mutable_child (size_type i)
 
void clear_child (size_type i)
 
void set_child (size_type i, btree_node *c)
 
void init_child (int i, btree_node *c)
 
template<typename K >
SearchResult< int, is_key_compare_to::value > lower_bound (const K &k, const key_compare &comp) const
 
template<typename K >
int upper_bound (const K &k, const key_compare &comp) const
 
template<typename K , typename Compare >
SearchResult< int, btree_is_key_compare_to< Compare, key_type >::valuelinear_search (const K &k, const Compare &comp) const
 
template<typename K , typename Compare >
SearchResult< int, btree_is_key_compare_to< Compare, key_type >::valuebinary_search (const K &k, const Compare &comp) const
 
template<typename K , typename Compare >
SearchResult< int, falselinear_search_impl (const K &k, int s, const int e, const Compare &comp, std::false_type) const
 
template<typename K , typename Compare >
SearchResult< int, truelinear_search_impl (const K &k, int s, const int e, const Compare &comp, std::true_type) const
 
template<typename K , typename Compare >
SearchResult< int, falsebinary_search_impl (const K &k, int s, int e, const Compare &comp, std::false_type) const
 
template<typename K , typename CompareTo >
SearchResult< int, truebinary_search_impl (const K &k, int s, int e, const CompareTo &comp, std::true_type) const
 
template<typename... Args>
void emplace_value (size_type i, allocator_type *alloc, Args &&... args)
 
void remove_value (int i, allocator_type *alloc)
 
void remove_values_ignore_children (int i, size_type to_erase, allocator_type *alloc)
 
void rebalance_right_to_left (int to_move, btree_node *right, allocator_type *alloc)
 
void rebalance_left_to_right (int to_move, btree_node *right, allocator_type *alloc)
 
void split (int insert_position, btree_node *dest, allocator_type *alloc)
 
void merge (btree_node *sibling, allocator_type *alloc)
 
void swap (btree_node *src, allocator_type *alloc)
 
void destroy (allocator_type *alloc)
 

静态 Public 成员函数

static constexpr size_type Alignment ()
 
static btree_nodeinit_leaf (btree_node *n, btree_node *parent, int max_cnt)
 
static btree_nodeinit_internal (btree_node *n, btree_node *parent)
 
static bool testonly_uses_linear_node_search ()
 

Protected 成员函数

 btree_node ()=default
 

Private 类型

enum  { kTargetNodeSize = params_type::kTargetNodeSize , kNodeTargetValues = NodeTargetValues(0, params_type::kTargetNodeSize) }
 
using is_key_compare_to = typename Params::is_key_compare_to
 
using is_multi_container = typename Params::is_multi_container
 
using field_type = typename Params::node_count_type
 
using allocator_type = typename Params::allocator_type
 
using slot_type = typename Params::slot_type
 
using layout_type = phmap::priv::Layout< btree_node *, field_type, slot_type, btree_node * >
 

Private 成员函数

template<size_type N>
layout_type::template ElementType< N > * GetField ()
 
template<size_type N>
const layout_type::template ElementType< N > * GetField () const
 
void set_parent (btree_node *p)
 
field_typemutable_count ()
 
slot_typeslot (size_type i)
 
const slot_typeslot (size_type i) const
 
void set_position (field_type v)
 
void set_start (field_type v)
 
void set_count (field_type v)
 
void set_max_count (field_type v)
 
template<typename... Args>
void value_init (const size_type i, allocator_type *alloc, Args &&... args)
 
void value_destroy (const size_type i, allocator_type *alloc)
 
void uninitialized_move_n (const size_type n, const size_type i, const size_type j, btree_node *x, allocator_type *alloc)
 
void value_destroy_n (const size_type i, const size_type n, allocator_type *alloc)
 

静态 Private 成员函数

static constexpr size_type SizeWithNValues (size_type n)
 
static constexpr size_type MinimumOverhead ()
 
static constexpr size_type NodeTargetValues (const int begin, const int end)
 
static constexpr layout_type LeafLayout (const int max_values=kNodeValues)
 
static constexpr layout_type InternalLayout ()
 
static constexpr size_type LeafSize (const int max_values=kNodeValues)
 
static constexpr size_type InternalSize ()
 

友元

template<typename P >
class btree
 
template<typename N , typename R , typename P >
struct btree_iterator
 
class BtreeNodePeer
 

成员类型定义说明

◆ allocator_type

template<typename Params >
using phmap::priv::btree_node< Params >::allocator_type = typename Params::allocator_type
private

◆ const_pointer

template<typename Params >
using phmap::priv::btree_node< Params >::const_pointer = typename Params::const_pointer

◆ const_reference

template<typename Params >
using phmap::priv::btree_node< Params >::const_reference = typename Params::const_reference

◆ difference_type

template<typename Params >
using phmap::priv::btree_node< Params >::difference_type = typename Params::difference_type

◆ field_type

template<typename Params >
using phmap::priv::btree_node< Params >::field_type = typename Params::node_count_type
private

◆ is_key_compare_to

template<typename Params >
using phmap::priv::btree_node< Params >::is_key_compare_to = typename Params::is_key_compare_to
private

◆ is_multi_container

template<typename Params >
using phmap::priv::btree_node< Params >::is_multi_container = typename Params::is_multi_container
private

◆ key_compare

template<typename Params >
using phmap::priv::btree_node< Params >::key_compare = typename Params::key_compare

◆ key_type

template<typename Params >
using phmap::priv::btree_node< Params >::key_type = typename Params::key_type

◆ layout_type

template<typename Params >
using phmap::priv::btree_node< Params >::layout_type = phmap::priv::Layout<btree_node *, field_type, slot_type, btree_node *>
private

◆ params_type

template<typename Params >
using phmap::priv::btree_node< Params >::params_type = Params

◆ pointer

template<typename Params >
using phmap::priv::btree_node< Params >::pointer = typename Params::pointer

◆ reference

template<typename Params >
using phmap::priv::btree_node< Params >::reference = typename Params::reference

◆ size_type

template<typename Params >
using phmap::priv::btree_node< Params >::size_type = typename Params::size_type

◆ slot_type

template<typename Params >
using phmap::priv::btree_node< Params >::slot_type = typename Params::slot_type
private

◆ use_linear_search

template<typename Params >
using phmap::priv::btree_node< Params >::use_linear_search = std::integral_constant< bool, std::is_arithmetic<key_type>::value && (std::is_same<phmap::Less<key_type>, key_compare>::value || std::is_same<std::less<key_type>, key_compare>::value || std::is_same<std::greater<key_type>, key_compare>::value)>

◆ value_type

template<typename Params >
using phmap::priv::btree_node< Params >::value_type = typename Params::value_type

成员枚举类型说明

◆ anonymous enum

template<typename Params >
anonymous enum
private
枚举值
kTargetNodeSize 
kNodeTargetValues 

构造及析构函数说明

◆ ~btree_node()

template<typename Params >
phmap::priv::btree_node< Params >::~btree_node ( )
default

◆ btree_node() [1/2]

template<typename Params >
phmap::priv::btree_node< Params >::btree_node ( btree_node< Params > const &  )
delete

◆ btree_node() [2/2]

template<typename Params >
phmap::priv::btree_node< Params >::btree_node ( )
protecteddefault

成员函数说明

◆ Alignment()

template<typename Params >
static constexpr size_type phmap::priv::btree_node< Params >::Alignment ( )
inlinestaticconstexpr

◆ binary_search()

template<typename Params >
template<typename K , typename Compare >
SearchResult< int, btree_is_key_compare_to< Compare, key_type >::value > phmap::priv::btree_node< Params >::binary_search ( const K &  k,
const Compare &  comp 
) const
inline

◆ binary_search_impl() [1/2]

template<typename Params >
template<typename K , typename Compare >
SearchResult< int, false > phmap::priv::btree_node< Params >::binary_search_impl ( const K &  k,
int  s,
int  e,
const Compare &  comp,
std::false_type   
) const
inline

◆ binary_search_impl() [2/2]

template<typename Params >
template<typename K , typename CompareTo >
SearchResult< int, true > phmap::priv::btree_node< Params >::binary_search_impl ( const K &  k,
int  s,
int  e,
const CompareTo &  comp,
std::true_type   
) const
inline

◆ child()

template<typename Params >
btree_node * phmap::priv::btree_node< Params >::child ( size_type  i) const
inline

◆ clear_child()

template<typename Params >
void phmap::priv::btree_node< Params >::clear_child ( size_type  i)
inline

◆ count()

template<typename Params >
field_type phmap::priv::btree_node< Params >::count ( ) const
inline

◆ destroy()

template<typename Params >
void phmap::priv::btree_node< Params >::destroy ( allocator_type alloc)
inline

◆ emplace_value()

template<typename P >
template<typename... Args>
void phmap::priv::btree_node< P >::emplace_value ( size_type  i,
allocator_type alloc,
Args &&...  args 
)
inline

◆ GetField() [1/2]

template<typename Params >
template<size_type N>
layout_type::template ElementType< N > * phmap::priv::btree_node< Params >::GetField ( )
inlineprivate

◆ GetField() [2/2]

template<typename Params >
template<size_type N>
const layout_type::template ElementType< N > * phmap::priv::btree_node< Params >::GetField ( ) const
inlineprivate

◆ init_child()

template<typename Params >
void phmap::priv::btree_node< Params >::init_child ( int  i,
btree_node< Params > *  c 
)
inline

◆ init_internal()

template<typename Params >
static btree_node * phmap::priv::btree_node< Params >::init_internal ( btree_node< Params > *  n,
btree_node< Params > *  parent 
)
inlinestatic

◆ init_leaf()

template<typename Params >
static btree_node * phmap::priv::btree_node< Params >::init_leaf ( btree_node< Params > *  n,
btree_node< Params > *  parent,
int  max_cnt 
)
inlinestatic

◆ InternalLayout()

template<typename Params >
static constexpr layout_type phmap::priv::btree_node< Params >::InternalLayout ( )
inlinestaticconstexprprivate

◆ InternalSize()

template<typename Params >
static constexpr size_type phmap::priv::btree_node< Params >::InternalSize ( )
inlinestaticconstexprprivate

◆ is_root()

template<typename Params >
bool phmap::priv::btree_node< Params >::is_root ( ) const
inline

◆ key()

template<typename Params >
const key_type & phmap::priv::btree_node< Params >::key ( size_type  i) const
inline

◆ leaf()

template<typename Params >
bool phmap::priv::btree_node< Params >::leaf ( ) const
inline

◆ LeafLayout()

template<typename Params >
static constexpr layout_type phmap::priv::btree_node< Params >::LeafLayout ( const int  max_values = kNodeValues)
inlinestaticconstexprprivate

◆ LeafSize()

template<typename Params >
static constexpr size_type phmap::priv::btree_node< Params >::LeafSize ( const int  max_values = kNodeValues)
inlinestaticconstexprprivate

◆ linear_search()

template<typename Params >
template<typename K , typename Compare >
SearchResult< int, btree_is_key_compare_to< Compare, key_type >::value > phmap::priv::btree_node< Params >::linear_search ( const K &  k,
const Compare &  comp 
) const
inline

◆ linear_search_impl() [1/2]

template<typename Params >
template<typename K , typename Compare >
SearchResult< int, false > phmap::priv::btree_node< Params >::linear_search_impl ( const K &  k,
int  s,
const int  e,
const Compare &  comp,
std::false_type   
) const
inline

◆ linear_search_impl() [2/2]

template<typename Params >
template<typename K , typename Compare >
SearchResult< int, true > phmap::priv::btree_node< Params >::linear_search_impl ( const K &  k,
int  s,
const int  e,
const Compare &  comp,
std::true_type   
) const
inline

◆ lower_bound()

template<typename Params >
template<typename K >
SearchResult< int, is_key_compare_to::value > phmap::priv::btree_node< Params >::lower_bound ( const K &  k,
const key_compare comp 
) const
inline

◆ make_root()

template<typename Params >
void phmap::priv::btree_node< Params >::make_root ( )
inline

◆ max_count()

template<typename Params >
field_type phmap::priv::btree_node< Params >::max_count ( ) const
inline

◆ merge()

template<typename P >
void phmap::priv::btree_node< P >::merge ( btree_node< Params > *  sibling,
allocator_type alloc 
)

◆ MinimumOverhead()

template<typename Params >
static constexpr size_type phmap::priv::btree_node< Params >::MinimumOverhead ( )
inlinestaticconstexprprivate

◆ mutable_child()

template<typename Params >
btree_node *& phmap::priv::btree_node< Params >::mutable_child ( size_type  i)
inline

◆ mutable_count()

template<typename Params >
field_type & phmap::priv::btree_node< Params >::mutable_count ( )
inlineprivate

◆ NodeTargetValues()

template<typename Params >
static constexpr size_type phmap::priv::btree_node< Params >::NodeTargetValues ( const int  begin,
const int  end 
)
inlinestaticconstexprprivate

◆ operator=()

template<typename Params >
btree_node & phmap::priv::btree_node< Params >::operator= ( btree_node< Params > const &  )
delete

◆ parent()

template<typename Params >
btree_node * phmap::priv::btree_node< Params >::parent ( ) const
inline

◆ position()

template<typename Params >
field_type phmap::priv::btree_node< Params >::position ( ) const
inline

◆ rebalance_left_to_right()

template<typename P >
void phmap::priv::btree_node< P >::rebalance_left_to_right ( int  to_move,
btree_node< Params > *  right,
allocator_type alloc 
)

◆ rebalance_right_to_left()

template<typename P >
void phmap::priv::btree_node< P >::rebalance_right_to_left ( int  to_move,
btree_node< Params > *  right,
allocator_type alloc 
)

◆ remove_value()

template<typename P >
void phmap::priv::btree_node< P >::remove_value ( int  i,
allocator_type alloc 
)
inline

◆ remove_values_ignore_children()

template<typename P >
void phmap::priv::btree_node< P >::remove_values_ignore_children ( int  i,
size_type  to_erase,
allocator_type alloc 
)
inline

◆ set_child()

template<typename Params >
void phmap::priv::btree_node< Params >::set_child ( size_type  i,
btree_node< Params > *  c 
)
inline

◆ set_count()

template<typename Params >
void phmap::priv::btree_node< Params >::set_count ( field_type  v)
inlineprivate

◆ set_max_count()

template<typename Params >
void phmap::priv::btree_node< Params >::set_max_count ( field_type  v)
inlineprivate

◆ set_parent()

template<typename Params >
void phmap::priv::btree_node< Params >::set_parent ( btree_node< Params > *  p)
inlineprivate

◆ set_position()

template<typename Params >
void phmap::priv::btree_node< Params >::set_position ( field_type  v)
inlineprivate

◆ set_start()

template<typename Params >
void phmap::priv::btree_node< Params >::set_start ( field_type  v)
inlineprivate

◆ SizeWithNValues()

template<typename Params >
static constexpr size_type phmap::priv::btree_node< Params >::SizeWithNValues ( size_type  n)
inlinestaticconstexprprivate

◆ slot() [1/2]

template<typename Params >
slot_type * phmap::priv::btree_node< Params >::slot ( size_type  i)
inlineprivate

◆ slot() [2/2]

template<typename Params >
const slot_type * phmap::priv::btree_node< Params >::slot ( size_type  i) const
inlineprivate

◆ split()

template<typename P >
void phmap::priv::btree_node< P >::split ( int  insert_position,
btree_node< Params > *  dest,
allocator_type alloc 
)

◆ start()

template<typename Params >
field_type phmap::priv::btree_node< Params >::start ( ) const
inline

◆ swap()

template<typename P >
void phmap::priv::btree_node< P >::swap ( btree_node< Params > *  src,
allocator_type alloc 
)

◆ testonly_uses_linear_node_search()

template<typename Params >
static bool phmap::priv::btree_node< Params >::testonly_uses_linear_node_search ( )
inlinestatic

◆ uninitialized_move_n()

template<typename Params >
void phmap::priv::btree_node< Params >::uninitialized_move_n ( const size_type  n,
const size_type  i,
const size_type  j,
btree_node< Params > *  x,
allocator_type alloc 
)
inlineprivate

◆ upper_bound()

template<typename Params >
template<typename K >
int phmap::priv::btree_node< Params >::upper_bound ( const K &  k,
const key_compare comp 
) const
inline

◆ value() [1/2]

template<typename Params >
reference phmap::priv::btree_node< Params >::value ( size_type  i)
inline

◆ value() [2/2]

template<typename Params >
const_reference phmap::priv::btree_node< Params >::value ( size_type  i) const
inline

◆ value_destroy()

template<typename Params >
void phmap::priv::btree_node< Params >::value_destroy ( const size_type  i,
allocator_type alloc 
)
inlineprivate

◆ value_destroy_n()

template<typename Params >
void phmap::priv::btree_node< Params >::value_destroy_n ( const size_type  i,
const size_type  n,
allocator_type alloc 
)
inlineprivate

◆ value_init()

template<typename Params >
template<typename... Args>
void phmap::priv::btree_node< Params >::value_init ( const size_type  i,
allocator_type alloc,
Args &&...  args 
)
inlineprivate

友元及相关函数文档

◆ btree

template<typename Params >
template<typename P >
friend class btree
friend

◆ btree_iterator

template<typename Params >
template<typename N , typename R , typename P >
friend struct btree_iterator
friend

◆ BtreeNodePeer

template<typename Params >
friend class BtreeNodePeer
friend

该类的文档由以下文件生成: