tree Interface (original) (raw)

A concrete basic tree-based associative container.

Defined in: assoc_container.hpp

Template Parameters

Parameter Description Default Value
typename Key Key type. -
typename Mapped Mapped type. -
class Cmp_Fn Comparison functor. std::less<Key>
class Tag Mapped-structure tag. rb_tree_tag
template< **typename** Const_Node_Iterator, **typename** Node_Iterator, **class** Cmp_Fn_, **typename** Allocator_> class Node_Update Node updater type. Design::Tree-Based Containers::Node Invariants explains this concept. null_tree_node_update
class Allocator Allocator type. std::allocator<**char**>

Base Classes

Class Derivation Type
basic_tree public

Public Types and Constants

Policy Definitions

Type Definition Description
cmp_fn Cmp_Fn Comparison functor type.

Iterator Definitions

Type Definition Description
const_node_iterator const_node_iterator Const node iterator.
node_iterator node_iterator Node iterator.

Public Methods

Method Description
tree () Default constructor.
tree (const cmp_fn &r_cmp_fn) Constructor taking some policy objects. r_cmp_fn will be copied by theCmp_Fn object of the container object.
template< **class** It> tree (It first_it, It last_it) Constructor taking iterators to a range of value_types. The value_types between first_it and last_it will be inserted into the container object.
template< **class** It> tree (It first_it, It last_it, const cmp_fn &r_cmp_fn) Constructor taking iterators to a range of value_types and some policy objects The value_types betweenfirst_it andlast_it will be inserted into the container object. r_cmp_fn will be copied by thecmp_fn object of the container object.
tree (const tree &other) Copy constructor.
virtual ~tree () Destructor.
tree & operator= (const tree &other) Assignment operator.
void swap (tree &other) Swaps content.

Policy Access Methods

Method Description
cmp_fn & get_cmp_fn () Access to the cmp_fn object.
const cmp_fn & get_cmp_fn () const Const access to the cmp_fn object.

Node-Iteration Methods

Method Description
node_iterator node_begin () Returns a node_iterator corresponding to the node at the root of the tree.
const_node_iterator node_begin () const Returns a const_node_iterator corresponding to the node at the root of the tree.
node_iterator node_end () Returns a node_iterator corresponding to a node just after a leaf of the tree.
const_node_iterator node_end () const Returns a const_node_iterator corresponding to a node just after a leaf of the tree.