NIM 跨平台 C++ SDK
|
#include <btree.h>
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_node & | operator= (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_node * | parent () const |
bool | is_root () const |
void | make_root () |
const key_type & | key (size_type i) const |
reference | value (size_type i) |
const_reference | value (size_type i) const |
btree_node * | child (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 >::value > | linear_search (const K &k, const Compare &comp) const |
template<typename K , typename Compare > | |
SearchResult< int, btree_is_key_compare_to< Compare, key_type >::value > | binary_search (const K &k, const Compare &comp) const |
template<typename K , typename Compare > | |
SearchResult< int, false > | linear_search_impl (const K &k, int s, const int e, const Compare &comp, std::false_type) const |
template<typename K , typename Compare > | |
SearchResult< int, true > | linear_search_impl (const K &k, int s, const int e, const Compare &comp, std::true_type) const |
template<typename K , typename Compare > | |
SearchResult< int, false > | binary_search_impl (const K &k, int s, int e, const Compare &comp, std::false_type) const |
template<typename K , typename CompareTo > | |
SearchResult< int, true > | binary_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_node * | init_leaf (btree_node *n, btree_node *parent, int max_cnt) |
static btree_node * | init_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_type & | mutable_count () |
slot_type * | slot (size_type i) |
const slot_type * | slot (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 |
|
private |
using phmap::priv::btree_node< Params >::const_pointer = typename Params::const_pointer |
using phmap::priv::btree_node< Params >::const_reference = typename Params::const_reference |
using phmap::priv::btree_node< Params >::difference_type = typename Params::difference_type |
|
private |
|
private |
|
private |
using phmap::priv::btree_node< Params >::key_compare = typename Params::key_compare |
using phmap::priv::btree_node< Params >::key_type = typename Params::key_type |
|
private |
using phmap::priv::btree_node< Params >::params_type = Params |
using phmap::priv::btree_node< Params >::pointer = typename Params::pointer |
using phmap::priv::btree_node< Params >::reference = typename Params::reference |
using phmap::priv::btree_node< Params >::size_type = typename Params::size_type |
|
private |
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)> |
using phmap::priv::btree_node< Params >::value_type = typename Params::value_type |
|
default |
|
delete |
|
protecteddefault |
|
inlinestaticconstexpr |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlinestatic |
|
inlinestatic |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inline |
|
inline |
|
inline |
|
inlinestaticconstexprprivate |
|
inlinestaticconstexprprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
void phmap::priv::btree_node< P >::merge | ( | btree_node< Params > * | sibling, |
allocator_type * | alloc | ||
) |
|
inlinestaticconstexprprivate |
|
inline |
|
inlineprivate |
|
inlinestaticconstexprprivate |
|
delete |
|
inline |
|
inline |
void phmap::priv::btree_node< P >::rebalance_left_to_right | ( | int | to_move, |
btree_node< Params > * | right, | ||
allocator_type * | alloc | ||
) |
void phmap::priv::btree_node< P >::rebalance_right_to_left | ( | int | to_move, |
btree_node< Params > * | right, | ||
allocator_type * | alloc | ||
) |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inlinestaticconstexprprivate |
|
inlineprivate |
|
inlineprivate |
void phmap::priv::btree_node< P >::split | ( | int | insert_position, |
btree_node< Params > * | dest, | ||
allocator_type * | alloc | ||
) |
|
inline |
void phmap::priv::btree_node< P >::swap | ( | btree_node< Params > * | src, |
allocator_type * | alloc | ||
) |
|
inlinestatic |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
friend |
|
friend |