avltree_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated. More...
#include <intrusive_fwd.hpp>
Public Types | |
typedef NodeTraits::node | node |
typedef NodeTraits | node_traits |
typedef NodeTraits::node_ptr | node_ptr |
typedef NodeTraits::const_node_ptr | const_node_ptr |
typedef NodeTraits::balance | balance |
typedef bstree_algo::insert_commit_data | insert_commit_data |
This type is the information that will be filled by insert_unique_check. More... | |
typedef data_for_rebalance_t < node_ptr > | data_for_rebalance |
Static Public Member Functions | |
static void | swap_nodes (const node_ptr &node1, const node_ptr &node2) |
Requires: node1 and node2 can't be header nodes of two trees. More... | |
static void | swap_nodes (const node_ptr &node1, const node_ptr &header1, const node_ptr &node2, const node_ptr &header2) |
Requires: node1 and node2 can't be header nodes of two trees with header header1 and header2. More... | |
static void | replace_node (const node_ptr &node_to_be_replaced, const node_ptr &new_node) |
Requires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree. More... | |
static void | replace_node (const node_ptr &node_to_be_replaced, const node_ptr &header, const node_ptr &new_node) |
Requires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree. More... | |
static void | unlink (const node_ptr &node) |
Requires: node is a tree node but not the header. More... | |
static void | init_header (const node_ptr &header) |
Requires: node must not be part of any tree. More... | |
static node_ptr | erase (const node_ptr &header, const node_ptr &z) |
Requires: header must be the header of a tree, z a node of that tree and z != header. More... | |
template<class Cloner , class Disposer > | |
static void | clone (const const_node_ptr &source_header, const node_ptr &target_header, Cloner cloner, Disposer disposer) |
Requires: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it. More... | |
template<class NodePtrCompare > | |
static node_ptr | insert_equal_upper_bound (const node_ptr &h, const node_ptr &new_node, NodePtrCompare comp) |
template<class NodePtrCompare > | |
static node_ptr | insert_equal_lower_bound (const node_ptr &h, const node_ptr &new_node, NodePtrCompare comp) |
template<class NodePtrCompare > | |
static node_ptr | insert_equal (const node_ptr &header, const node_ptr &hint, const node_ptr &new_node, NodePtrCompare comp) |
static node_ptr | insert_before (const node_ptr &header, const node_ptr &pos, const node_ptr &new_node) |
static void | push_back (const node_ptr &header, const node_ptr &new_node) |
static void | push_front (const node_ptr &header, const node_ptr &new_node) |
static void | insert_unique_commit (const node_ptr &header, const node_ptr &new_value, const insert_commit_data &commit_data) |
Requires: "header" must be the header node of a tree. More... | |
static bool | is_header (const const_node_ptr &p) |
Requires: p is a node of a tree. More... | |
static node_ptr | begin_node (const const_node_ptr &header) |
Requires: 'header' is the header node of a tree. More... | |
static node_ptr | end_node (const const_node_ptr &header) |
Requires: 'header' is the header node of a tree. More... | |
static node_ptr | root_node (const const_node_ptr &header) |
Requires: 'header' is the header node of a tree. More... | |
static bool | unique (const const_node_ptr &node) |
Requires: 'node' is a node of the tree or a node initialized by init(...) or init_node. More... | |
static node_ptr | get_header (const const_node_ptr &node) |
Requires: 'node' is a node of the tree or a header node. More... | |
static node_ptr | next_node (const node_ptr &node) |
Requires: 'node' is a node from the tree except the header. More... | |
static node_ptr | prev_node (const node_ptr &node) |
Requires: 'node' is a node from the tree except the leftmost node. More... | |
static node_ptr | minimum (node_ptr node) |
Requires: 'node' is a node of a tree but not the header. More... | |
static node_ptr | maximum (node_ptr node) |
Requires: 'node' is a node of a tree but not the header. More... | |
static void | init (const node_ptr &node) |
Requires: 'node' must not be part of any tree. More... | |
static bool | inited (const const_node_ptr &node) |
Effects: Returns true if node is in the same state as if called init(node) More... | |
template<class Disposer > | |
static void | clear_and_dispose (const node_ptr &header, Disposer disposer) |
Requires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw. More... | |
static node_ptr | unlink_leftmost_without_rebalance (const node_ptr &header) |
Requires: header is the header of a tree. More... | |
static std::size_t | size (const const_node_ptr &header) |
Requires: node is a node of the tree but it's not the header. More... | |
static void | swap_tree (const node_ptr &header1, const node_ptr &header2) |
Requires: header1 and header2 must be the header nodes of two trees. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static node_ptr | find (const const_node_ptr &header, const KeyType &key, KeyNodePtrCompare comp) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static std::pair< node_ptr, node_ptr > | bounded_range (const const_node_ptr &header, const KeyType &lower_key, const KeyType &upper_key, KeyNodePtrCompare comp, bool left_closed, bool right_closed) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static std::size_t | count (const const_node_ptr &header, const KeyType &key, KeyNodePtrCompare comp) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static std::pair< node_ptr, node_ptr > | equal_range (const const_node_ptr &header, const KeyType &key, KeyNodePtrCompare comp) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static std::pair< node_ptr, node_ptr > | lower_bound_range (const const_node_ptr &header, const KeyType &key, KeyNodePtrCompare comp) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static node_ptr | lower_bound (const const_node_ptr &header, const KeyType &key, KeyNodePtrCompare comp) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static node_ptr | upper_bound (const const_node_ptr &header, const KeyType &key, KeyNodePtrCompare comp) |
Requires: "header" must be the header node of a tree. More... | |
static void | insert_unique_commit (const node_ptr &header, const node_ptr &new_value, const insert_commit_data &commit_data) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static std::pair< node_ptr, bool > | insert_unique_check (const const_node_ptr &header, const KeyType &key, KeyNodePtrCompare comp, insert_commit_data &commit_data, std::size_t *pdepth=0) |
Requires: "header" must be the header node of a tree. More... | |
template<class KeyType , class KeyNodePtrCompare > | |
static std::pair< node_ptr, bool > | insert_unique_check (const const_node_ptr &header, const node_ptr &hint, const KeyType &key, KeyNodePtrCompare comp, insert_commit_data &commit_data, std::size_t *pdepth=0) |
Requires: "header" must be the header node of a tree. More... | |
template<class NodePtrCompare > | |
static node_ptr | insert_equal (const node_ptr &h, const node_ptr &hint, const node_ptr &new_node, NodePtrCompare comp, std::size_t *pdepth=0) |
Requires: "header" must be the header node of a tree. More... | |
template<class NodePtrCompare > | |
static node_ptr | insert_equal_upper_bound (const node_ptr &h, const node_ptr &new_node, NodePtrCompare comp, std::size_t *pdepth=0) |
Requires: "h" must be the header node of a tree. More... | |
template<class NodePtrCompare > | |
static node_ptr | insert_equal_lower_bound (const node_ptr &h, const node_ptr &new_node, NodePtrCompare comp, std::size_t *pdepth=0) |
Requires: "h" must be the header node of a tree. More... | |
static node_ptr | insert_before (const node_ptr &header, const node_ptr &pos, const node_ptr &new_node, std::size_t *pdepth=0) |
Requires: "header" must be the header node of a tree. More... | |
static void | push_back (const node_ptr &header, const node_ptr &new_node, std::size_t *pdepth=0) |
Requires: "header" must be the header node of a tree. More... | |
static void | push_front (const node_ptr &header, const node_ptr &new_node, std::size_t *pdepth=0) |
Requires: "header" must be the header node of a tree. More... | |
static std::size_t | depth (const_node_ptr node) |
Requires: 'node' can't be a header node. More... | |
static void | rebalance (const node_ptr &header) |
Requires: header must be the header of a tree. More... | |
static node_ptr | rebalance_subtree (const node_ptr &old_root) |
Requires: old_root is a node of a tree. More... | |
template<class Checker > | |
static void | check (const const_node_ptr &header, Checker checker, typename Checker::return_type &checker_return) |
Effects: Asserts the integrity of the container with additional checks provided by the user. More... | |
Static Protected Member Functions | |
static void | erase (const node_ptr &header, const node_ptr &z, data_for_rebalance &info) |
static std::size_t | subtree_size (const const_node_ptr &subtree) |
Requires: node is a node of the tree but it's not the header. More... | |
static bool | is_left_child (const node_ptr &p) |
Requires: p is a node of a tree. More... | |
static bool | is_right_child (const node_ptr &p) |
Requires: p is a node of a tree. More... | |
static void | insert_before_check (const node_ptr &header, const node_ptr &pos, insert_commit_data &commit_data, std::size_t *pdepth=0) |
static void | push_back_check (const node_ptr &header, insert_commit_data &commit_data, std::size_t *pdepth=0) |
static void | push_front_check (const node_ptr &header, insert_commit_data &commit_data, std::size_t *pdepth=0) |
template<class NodePtrCompare > | |
static void | insert_equal_check (const node_ptr &header, const node_ptr &hint, const node_ptr &new_node, NodePtrCompare comp, insert_commit_data &commit_data) |
template<class NodePtrCompare > | |
static void | insert_equal_upper_bound_check (const node_ptr &h, const node_ptr &new_node, NodePtrCompare comp, insert_commit_data &commit_data, std::size_t *pdepth=0) |
template<class NodePtrCompare > | |
static void | insert_equal_lower_bound_check (const node_ptr &h, const node_ptr &new_node, NodePtrCompare comp, insert_commit_data &commit_data, std::size_t *pdepth=0) |
static void | insert_commit (const node_ptr &header, const node_ptr &new_node, const insert_commit_data &commit_data) |
static void | set_child (const node_ptr &header, const node_ptr &new_child, const node_ptr &new_parent, const bool link_left) |
static void | rotate_left_no_parent_fix (const node_ptr &p, const node_ptr &p_right) |
static void | rotate_left (const node_ptr &p, const node_ptr &p_right, const node_ptr &p_parent, const node_ptr &header) |
static void | rotate_right_no_parent_fix (const node_ptr &p, const node_ptr &p_left) |
static void | rotate_right (const node_ptr &p, const node_ptr &p_left, const node_ptr &p_parent, const node_ptr &header) |
avltree_algorithms is configured with a NodeTraits class, which encapsulates the information about the node to be manipulated.
NodeTraits must support the following interface:
Typedefs:
node
: The type of the node that forms the binary search tree
node_ptr
: A pointer to a node
const_node_ptr
: A pointer to a const node
balance
: The type of the balance factor
Static functions:
static node_ptr get_parent(const_node_ptr n);
static void set_parent(node_ptr n, node_ptr parent);
static node_ptr get_left(const_node_ptr n);
static void set_left(node_ptr n, node_ptr left);
static node_ptr get_right(const_node_ptr n);
static void set_right(node_ptr n, node_ptr right);
static balance get_balance(const_node_ptr n);
static void set_balance(node_ptr n, balance b);
static balance negative();
static balance zero();
static balance positive();
typedef NodeTraits::balance boost::intrusive::avltree_algorithms< NodeTraits >::balance |
typedef NodeTraits::const_node_ptr boost::intrusive::avltree_algorithms< NodeTraits >::const_node_ptr |
|
inherited |
typedef bstree_algo::insert_commit_data boost::intrusive::avltree_algorithms< NodeTraits >::insert_commit_data |
This type is the information that will be filled by insert_unique_check.
typedef NodeTraits::node boost::intrusive::avltree_algorithms< NodeTraits >::node |
typedef NodeTraits::node_ptr boost::intrusive::avltree_algorithms< NodeTraits >::node_ptr |
typedef NodeTraits boost::intrusive::avltree_algorithms< NodeTraits >::node_traits |
|
inlinestaticinherited |
Requires: 'header' is the header node of a tree.
Effects: Returns the first node of the tree, the header if the tree is empty.
Complexity: Constant time.
Throws: Nothing.
References boost::bimaps::relation::support::get_left().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_unique_check(), and boost::intrusive::bstree_algorithms< NodeTraits >::size().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs. 'lower_key' must not be greater than 'upper_key' according to 'comp'. If 'lower_key' == 'upper_key', ('left_closed' || 'right_closed') must be false.
Effects: Returns an a pair with the following criteria:
first = lower_bound(lower_key) if left_closed, upper_bound(lower_key) otherwise
second = upper_bound(upper_key) if right_closed, lower_bound(upper_key) otherwise
Complexity: Logarithmic.
Throws: If "comp" throws.
Note: This function can be more efficient than calling upper_bound and lower_bound for lower_key and upper_key.
Note: Experimental function, the interface might change.
References boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), boost::flyweights::x, and boost::polygon::y().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::equal_range().
|
inlinestaticinherited |
Effects: Asserts the integrity of the container with additional checks provided by the user.
Requires: header must be the header of a tree.
Complexity: Linear time.
Note: The method might not have effect when asserts are turned off (e.g., with NDEBUG). Experimental function, interface might change in future versions.
References boost::bimaps::relation::support::get_left(), and boost::bimaps::relation::support::get_right().
|
inlinestaticinherited |
Requires: "disposer" must be an object function taking a node_ptr parameter and shouldn't throw.
Effects: Empties the target tree calling void disposer::operator()(const node_ptr &)
for every node of the tree except the header.
Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.
Throws: If cloner functor throws. If this happens target nodes are disposed.
References boost::intrusive::bstree_algorithms< NodeTraits >::init_header().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::clone().
|
inlinestatic |
Requires: "cloner" must be a function object taking a node_ptr and returning a new cloned node of it.
"disposer" must take a node_ptr and shouldn't throw.
Effects: First empties target tree calling void disposer::operator()(const node_ptr &)
for every node of the tree except the header.
Then, duplicates the entire tree pointed by "source_header" cloning each source node with node_ptr Cloner::operator()(const node_ptr &)
to obtain the nodes of the target tree. If "cloner" throws, the cloned target nodes are disposed using void disposer(const node_ptr &)
.
Complexity: Linear to the number of element of the source tree plus the. number of elements of tree target tree when calling this function.
Throws: If cloner functor throws. If this happens target nodes are disposed.
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
Effects: Returns the number of elements with a key equivalent to "key" according to "comp".
Complexity: Logarithmic.
Throws: If "comp" throws.
References boost::intrusive::bstree_algorithms< NodeTraits >::equal_range(), boost::n, and boost::intrusive::bstree_algorithms< NodeTraits >::next_node().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::subtree_size().
|
inlinestaticinherited |
Requires: 'node' can't be a header node.
Effects: Calculates the depth of a node: the depth of a node is the length (number of edges) of the path from the root to that node. (The root node is at depth 0.)
Complexity: Logarithmic to the number of nodes in the tree.
Throws: Nothing.
Referenced by boost::intrusive::sgtree_algorithms< NodeTraits >::insert_before(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_before_check(), boost::intrusive::sgtree_algorithms< NodeTraits >::insert_equal(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_check(), boost::intrusive::sgtree_algorithms< NodeTraits >::insert_equal_lower_bound(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_lower_bound_check(), boost::intrusive::sgtree_algorithms< NodeTraits >::insert_equal_upper_bound(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_upper_bound_check(), boost::intrusive::sgtree_algorithms< NodeTraits >::insert_unique_check(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_unique_check(), boost::intrusive::sgtree_algorithms< NodeTraits >::push_back(), boost::intrusive::bstree_algorithms< NodeTraits >::push_back_check(), boost::intrusive::sgtree_algorithms< NodeTraits >::push_front(), and boost::intrusive::bstree_algorithms< NodeTraits >::push_front_check().
|
inlinestaticinherited |
Requires: 'header' is the header node of a tree.
Effects: Returns the header of the tree.
Complexity: Constant time.
Throws: Nothing.
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::size().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
Effects: Returns an a pair of node_ptr delimiting a range containing all elements that are equivalent to "key" according to "comp" or an empty range that indicates the position where those elements would be if there are no equivalent elements.
Complexity: Logarithmic.
Throws: If "comp" throws.
References boost::intrusive::bstree_algorithms< NodeTraits >::bounded_range().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::count().
|
inlinestatic |
Requires: header must be the header of a tree, z a node of that tree and z != header.
Effects: Erases node "z" from the tree with header "header".
Complexity: Amortized constant time.
Throws: Nothing.
References boost::fusion::erase().
Referenced by boost::intrusive::avltree_algorithms< NodeTraits >::unlink().
|
inlinestaticprotectedinherited |
References BOOST_ASSERT, boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), boost::intrusive::bstree_algorithms< NodeTraits >::maximum(), boost::intrusive::bstree_algorithms< NodeTraits >::minimum(), boost::intrusive::bstree_algorithms< NodeTraits >::set_child(), boost::flyweights::x, and boost::polygon::y().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
Effects: Returns a node_ptr to the first element that is equivalent to "key" according to "comp" or "header" if that element does not exist.
Complexity: Logarithmic.
Throws: If "comp" throws.
References boost::end, boost::intrusive::bstree_algorithms< NodeTraits >::lower_bound(), and boost::polygon::y().
|
inlinestaticinherited |
Requires: 'node' is a node of the tree or a header node.
Effects: Returns the header of the tree.
Complexity: Logarithmic.
Throws: Nothing.
References boost::intrusive::bstree_algorithms< NodeTraits >::is_header(), boost::n, and boost::multiprecision::backends::p.
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::replace_node(), and boost::intrusive::bstree_algorithms< NodeTraits >::swap_nodes().
|
inlinestaticinherited |
Requires: 'node' must not be part of any tree.
Effects: After the function unique(node) == true.
Complexity: Constant.
Throws: Nothing.
Nodes: If node is inserted in a tree, this function corrupts the tree.
|
inlinestatic |
Requires: node must not be part of any tree.
Effects: Initializes the header to represent an empty tree. unique(header) == true.
Complexity: Constant.
Throws: Nothing.
Nodes: If node is inserted in a tree, this function corrupts the tree.
|
inlinestaticinherited |
Effects: Returns true if node is in the same state as if called init(node)
Complexity: Constant.
Throws: Nothing.
References boost::bimaps::relation::support::get_left(), and boost::bimaps::relation::support::get_right().
|
inlinestatic |
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
"pos" must be a valid iterator or header (end) node. "pos" must be an iterator pointing to the successor to "new_node" once inserted according to the order of already inserted nodes. This function does not check "pos" and this precondition must be guaranteed by the caller.
Effects: Inserts new_node into the tree before "pos".
Complexity: Constant-time.
Throws: Nothing.
Note: If "pos" is not the successor of the newly inserted "new_node" tree invariants might be broken.
References boost::intrusive::bstree_algorithms< NodeTraits >::insert_before_check(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_commit().
|
inlinestaticprotectedinherited |
References boost::intrusive::bstree_algorithms< NodeTraits >::depth(), boost::bimaps::relation::support::get_left(), boost::intrusive::bstree_algorithms< NodeTraits >::prev_node(), and boost::intrusive::bstree_algorithms< NodeTraits >::unique().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_before().
|
inlinestaticprotectedinherited |
References boost::bimaps::relation::support::get_left(), and boost::bimaps::relation::support::get_right().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_before(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_lower_bound(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_upper_bound(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_unique_commit(), boost::intrusive::bstree_algorithms< NodeTraits >::push_back(), and boost::intrusive::bstree_algorithms< NodeTraits >::push_front().
|
inlinestatic |
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs. "hint" is node from the "header"'s tree.
Effects: Inserts new_node into the tree, using "hint" as a hint to where it will be inserted. If "hint" is the upper_bound the insertion takes constant time (two comparisons in the worst case).
Complexity: Logarithmic in general, but it is amortized constant time if new_node is inserted immediately before "hint".
Throws: If "comp" throws.
References boost::intrusive::bstree_algorithms< NodeTraits >::insert_commit(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_check().
|
inlinestaticprotectedinherited |
References boost::intrusive::bstree_algorithms< NodeTraits >::depth(), boost::bimaps::relation::support::get_left(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_lower_bound_check(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_upper_bound_check(), boost::intrusive::bstree_algorithms< NodeTraits >::prev_node(), and boost::intrusive::bstree_algorithms< NodeTraits >::unique().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal().
|
inlinestatic |
|
inlinestaticinherited |
Requires: "h" must be the header node of a tree.
NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.
Effects: Inserts new_node into the tree before the lower bound according to "comp".
Complexity: Average complexity for insert element is at most logarithmic.
Throws: If "comp" throws.
References boost::intrusive::bstree_algorithms< NodeTraits >::insert_commit(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_lower_bound_check().
|
inlinestaticprotectedinherited |
References boost::intrusive::bstree_algorithms< NodeTraits >::depth(), boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), boost::flyweights::x, and boost::polygon::y().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_check(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_lower_bound().
|
inlinestatic |
|
inlinestaticinherited |
Requires: "h" must be the header node of a tree.
NodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares two node_ptrs.
Effects: Inserts new_node into the tree before the upper bound according to "comp".
Complexity: Average complexity for insert element is at most logarithmic.
Throws: If "comp" throws.
References boost::intrusive::bstree_algorithms< NodeTraits >::insert_commit(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_upper_bound_check().
|
inlinestaticprotectedinherited |
References boost::intrusive::bstree_algorithms< NodeTraits >::depth(), boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), boost::flyweights::x, and boost::polygon::y().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_check(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_upper_bound().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr.
Effects: Checks if there is an equivalent node to "key" in the tree according to "comp" and obtains the needed information to realize a constant-time node insertion if there is no equivalent node.
Returns: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.
Complexity: Average complexity is at most logarithmic.
Throws: If "comp" throws.
Notes: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.
If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set.
References boost::intrusive::bstree_algorithms< NodeTraits >::depth(), boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), boost::flyweights::x, and boost::polygon::y().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_unique_check().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. NodePtrCompare compares KeyType with a node_ptr. "hint" is node from the "header"'s tree.
Effects: Checks if there is an equivalent node to "key" in the tree according to "comp" using "hint" as a hint to where it should be inserted and obtains the needed information to realize a constant-time node insertion if there is no equivalent node. If "hint" is the upper_bound the function has constant time complexity (two comparisons in the worst case).
Returns: If there is an equivalent value returns a pair containing a node_ptr to the already present node and false. If there is not equivalent key can be inserted returns true in the returned pair's boolean and fills "commit_data" that is meant to be used with the "insert_commit" function to achieve a constant-time insertion function.
Complexity: Average complexity is at most logarithmic, but it is amortized constant time if new_node should be inserted immediately before "hint".
Throws: If "comp" throws.
Notes: This function is used to improve performance when constructing a node is expensive and the user does not want to have two equivalent nodes in the tree: if there is an equivalent value the constructed object must be discarded. Many times, the part of the node that is used to impose the order is much cheaper to construct than the node and this function offers the possibility to use that part to check if the insertion will be successful.
If the check is successful, the user can construct the node and use "insert_commit" to insert the node in constant-time. This gives a total logarithmic complexity to the insertion: check(O(log(N)) + commit(O(1)).
"commit_data" remains valid for a subsequent "insert_unique_commit" only if no more objects are inserted or erased from the set.
References boost::intrusive::bstree_algorithms< NodeTraits >::begin_node(), boost::intrusive::bstree_algorithms< NodeTraits >::depth(), boost::bimaps::relation::support::get_left(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_unique_check(), boost::intrusive::bstree_algorithms< NodeTraits >::prev_node(), and boost::intrusive::bstree_algorithms< NodeTraits >::unique().
|
inlinestatic |
Requires: "header" must be the header node of a tree.
"commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".
Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.
Complexity: Constant time.
Throws: Nothing.
Notes: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls.
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
"commit_data" must have been obtained from a previous call to "insert_unique_check". No objects should have been inserted or erased from the set between the "insert_unique_check" that filled "commit_data" and the call to "insert_commit".
Effects: Inserts new_node in the set using the information obtained from the "commit_data" that a previous "insert_check" filled.
Complexity: Constant time.
Throws: Nothing.
Notes: This function has only sense if a "insert_unique_check" has been previously executed to fill "commit_data". No value should be inserted or erased between the "insert_check" and "insert_commit" calls.
References boost::intrusive::bstree_algorithms< NodeTraits >::insert_commit().
|
inlinestatic |
Requires: p is a node of a tree.
Effects: Returns true if p is the header of the tree.
Complexity: Constant.
Throws: Nothing.
Referenced by boost::intrusive::avltree_algorithms< NodeTraits >::unlink().
|
inlinestaticprotectedinherited |
Requires: p is a node of a tree.
Effects: Returns true if p is a left child.
Complexity: Constant.
Throws: Nothing.
References boost::bimaps::relation::support::get_left(), and boost::multiprecision::backends::p.
|
inlinestaticprotectedinherited |
Requires: p is a node of a tree.
Effects: Returns true if p is a right child.
Complexity: Constant.
Throws: Nothing.
References boost::bimaps::relation::support::get_right(), and boost::multiprecision::backends::p.
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::rebalance_subtree().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
Effects: Returns a node_ptr to the first element that is not less than "key" according to "comp" or "header" if that element does not exist.
Complexity: Logarithmic.
Throws: If "comp" throws.
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::find(), and boost::intrusive::bstree_algorithms< NodeTraits >::lower_bound_range().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
Effects: Returns an a pair of node_ptr delimiting a range containing the first element that is equivalent to "key" according to "comp" or an empty range that indicates the position where that element would be if there are no equivalent elements.
Complexity: Logarithmic.
Throws: If "comp" throws.
References boost::intrusive::bstree_algorithms< NodeTraits >::lower_bound(), and boost::intrusive::bstree_algorithms< NodeTraits >::next_node().
|
inlinestaticinherited |
Requires: 'node' is a node of a tree but not the header.
Effects: Returns the maximum node of the subtree starting at p.
Complexity: Logarithmic to the size of the subtree.
Throws: Nothing.
References boost::bimaps::relation::support::get_right().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::erase(), and boost::intrusive::bstree_algorithms< NodeTraits >::prev_node().
|
inlinestaticinherited |
Requires: 'node' is a node of a tree but not the header.
Effects: Returns the minimum node of the subtree starting at p.
Complexity: Logarithmic to the size of the subtree.
Throws: Nothing.
References boost::bimaps::relation::support::get_left().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::erase(), boost::intrusive::bstree_algorithms< NodeTraits >::next_node(), and boost::intrusive::bstree_algorithms< NodeTraits >::unlink_leftmost_without_rebalance().
|
inlinestaticinherited |
Requires: 'node' is a node from the tree except the header.
Effects: Returns the next node of the tree.
Complexity: Average constant time.
Throws: Nothing.
References boost::bimaps::relation::support::get_right(), boost::intrusive::bstree_algorithms< NodeTraits >::minimum(), boost::n, and boost::multiprecision::backends::p.
Referenced by boost::intrusive::splaytree_algorithms< NodeTraits >::count(), boost::intrusive::bstree_algorithms< NodeTraits >::count(), boost::intrusive::bstree_algorithms< NodeTraits >::lower_bound_range(), and boost::intrusive::bstree_algorithms< NodeTraits >::size().
|
inlinestaticinherited |
Requires: 'node' is a node from the tree except the leftmost node.
Effects: Returns the previous node of the tree.
Complexity: Average constant time.
Throws: Nothing.
References boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), boost::intrusive::bstree_algorithms< NodeTraits >::is_header(), boost::intrusive::bstree_algorithms< NodeTraits >::maximum(), boost::multiprecision::backends::p, and boost::flyweights::x.
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::insert_before_check(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_check(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_unique_check().
|
inlinestatic |
References boost::xpressive::push_back.
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
"new_node" must be, according to the used ordering no less than the greatest inserted key.
Effects: Inserts new_node into the tree before "pos".
Complexity: Constant-time.
Throws: Nothing.
Note: If "new_node" is less than the greatest inserted key tree invariants are broken. This function is slightly faster than using "insert_before".
References boost::intrusive::bstree_algorithms< NodeTraits >::insert_commit(), and boost::intrusive::bstree_algorithms< NodeTraits >::push_back_check().
|
inlinestaticprotectedinherited |
|
inlinestatic |
References boost::xpressive::push_front.
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
"new_node" must be, according to the used ordering, no greater than the lowest inserted key.
Effects: Inserts new_node into the tree before "pos".
Complexity: Constant-time.
Throws: Nothing.
Note: If "new_node" is greater than the lowest inserted key tree invariants are broken. This function is slightly faster than using "insert_before".
References boost::intrusive::bstree_algorithms< NodeTraits >::insert_commit(), and boost::intrusive::bstree_algorithms< NodeTraits >::push_front_check().
|
inlinestaticprotectedinherited |
|
inlinestaticinherited |
Requires: header must be the header of a tree.
Effects: Rebalances the tree.
Throws: Nothing.
Complexity: Linear.
References boost::intrusive::bstree_algorithms< NodeTraits >::rebalance_subtree(), and boost::units::root().
|
inlinestaticinherited |
Requires: old_root is a node of a tree.
It shall not be null.
Effects: Rebalances the subtree rooted at old_root.
Returns: The new root of the subtree.
Throws: Nothing.
Complexity: Linear.
References boost::bimaps::relation::support::get_right(), boost::intrusive::bstree_algorithms< NodeTraits >::is_right_child(), and boost::intrusive::bstree_algorithms< NodeTraits >::size().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::rebalance().
|
inlinestatic |
Requires: node_to_be_replaced must be inserted in a tree and new_node must not be inserted in a tree.
Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced
Complexity: Logarithmic.
Throws: Nothing.
Note: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing and comparison is needed. Experimental function
|
inlinestatic |
Requires: node_to_be_replaced must be inserted in a tree with header "header" and new_node must not be inserted in a tree.
Effects: Replaces node_to_be_replaced in its position in the tree with new_node. The tree does not need to be rebalanced
Complexity: Constant.
Throws: Nothing.
Note: This function will break container ordering invariants if new_node is not equivalent to node_to_be_replaced according to the ordering rules. This function is faster than erasing and inserting the node, since no rebalancing or comparison is needed. Experimental function
|
inlinestaticinherited |
Requires: 'header' is the header node of a tree.
Effects: Returns the root of the tree if any, header otherwise
Complexity: Constant time.
Throws: Nothing.
|
inlinestaticprotectedinherited |
|
inlinestaticprotectedinherited |
References boost::bimaps::relation::support::get_left().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::rotate_left().
|
inlinestaticprotectedinherited |
|
inlinestaticprotectedinherited |
References boost::bimaps::relation::support::get_right().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::rotate_right().
|
inlinestaticprotectedinherited |
|
inlinestaticinherited |
Requires: node is a node of the tree but it's not the header.
Effects: Returns the number of nodes of the subtree.
Complexity: Linear time.
Throws: Nothing.
References boost::intrusive::bstree_algorithms< NodeTraits >::begin_node(), boost::end, boost::intrusive::bstree_algorithms< NodeTraits >::end_node(), boost::multiprecision::backends::i, and boost::intrusive::bstree_algorithms< NodeTraits >::next_node().
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::rebalance_subtree().
|
inlinestaticprotectedinherited |
Requires: node is a node of the tree but it's not the header.
Effects: Returns the number of nodes of the subtree.
Complexity: Linear time.
Throws: Nothing.
References boost::intrusive::bstree_algorithms< NodeTraits >::count(), boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), and boost::n.
|
inlinestatic |
Requires: node1 and node2 can't be header nodes of two trees.
Effects: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.
Complexity: Logarithmic.
Throws: Nothing.
Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.
Experimental function
|
inlinestatic |
Requires: node1 and node2 can't be header nodes of two trees with header header1 and header2.
Effects: Swaps two nodes. After the function node1 will be inserted in the position node2 before the function. node2 will be inserted in the position node1 had before the function.
Complexity: Constant.
Throws: Nothing.
Note: This function will break container ordering invariants if node1 and node2 are not equivalent according to the ordering rules.
Experimental function
References boost::multiprecision::backends::c.
|
inlinestaticinherited |
Requires: header1 and header2 must be the header nodes of two trees.
Effects: Swaps two trees. After the function header1 will contain links to the second tree and header2 will have links to the first tree.
Complexity: Constant.
Throws: Nothing.
References boost::bimaps::relation::support::get_left(), and boost::bimaps::relation::support::get_right().
|
inlinestaticinherited |
Requires: 'node' is a node of the tree or a node initialized by init(...) or init_node.
Effects: Returns true if the node is initialized by init() or init_node().
Complexity: Constant time.
Throws: Nothing.
Referenced by boost::intrusive::bstree_algorithms< NodeTraits >::clone(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_before_check(), boost::intrusive::bstree_algorithms< NodeTraits >::insert_equal_check(), and boost::intrusive::bstree_algorithms< NodeTraits >::insert_unique_check().
|
inlinestatic |
Requires: node is a tree node but not the header.
Effects: Unlinks the node and rebalances the tree.
Complexity: Average complexity is constant time.
Throws: Nothing.
References boost::intrusive::avltree_algorithms< NodeTraits >::erase(), boost::intrusive::avltree_algorithms< NodeTraits >::is_header(), and boost::flyweights::x.
|
inlinestaticinherited |
Requires: header is the header of a tree.
Effects: Unlinks the leftmost node from the tree, and updates the header link to the new leftmost node.
Complexity: Average complexity is constant time.
Throws: Nothing.
Notes: This function breaks the tree and the tree can only be used for more unlink_leftmost_without_rebalance calls. This function is normally used to achieve a step by step controlled destruction of the tree.
References boost::bimaps::relation::support::get_left(), boost::bimaps::relation::support::get_right(), and boost::intrusive::bstree_algorithms< NodeTraits >::minimum().
|
inlinestaticinherited |
Requires: "header" must be the header node of a tree.
KeyNodePtrCompare is a function object that induces a strict weak ordering compatible with the strict weak ordering used to create the the tree. KeyNodePtrCompare can compare KeyType with tree's node_ptrs.
Effects: Returns a node_ptr to the first element that is greater than "key" according to "comp" or "header" if that element does not exist.
Complexity: Logarithmic.
Throws: If "comp" throws.