Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

__ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc > Class Template Reference
[Classes and types for internal use]

Tree base class with data hooks. More...

#include <vgtl_tree.h>

Inheritance diagram for __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >:

Inheritance graph
[legend]
Collaboration diagram for __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >:

Collaboration graph
[legend]
List of all members.

Public Types

typedef _Tree_iterator< _Tp,
_Tp &, _Tp *, container_type,
children_iterator, node_type
iterator
typedef _Tree_iterator< _Tp,
const _Tp &, const _Tp *,
container_type, children_iterator,
node_type
const_iterator
typedef _Tree_walker< _Tp,
_Tp &, _Tp *, container_type,
children_iterator, _Node > 
iterative_walker
typedef _Tree_walker< _Tp,
const _Tp &, const _Tp *,
container_type, children_iterator,
_Node > 
const_iterative_walker
typedef std::reverse_iterator<
const_iterator
const_reverse_iterator
typedef std::reverse_iterator<
iterator
reverse_iterator
typedef _Iterator children_iterator
typedef __one_iterator< void * > parents_iterator
typedef _Tp value_type
typedef _RTree_walker< _Tp,
_Tp &, _Tp *, container_type,
children_iterator, node_type
walker
typedef _RTree_walker< _Tp,
const _Tp &, const _Tp *,
container_type, children_iterator,
node_type
const_walker

Public Methods

 __ITree (const allocator_type &__a=allocator_type())
iterative_walker root (walker_type wt=cw_pre_post, bool front_to_back=true, bool depth_first=true)
const_iterative_walker root (walker_type wt=cw_pre_post, bool front_to_back=true, bool depth_first=true) const
iterative_walker through ()
const_iterative_walker through () const
iterative_walker begin (walker_type wt=cw_pre_post, bool front_to_back=true, bool depth_first=true)
const_iterative_walker begin (walker_type wt=cw_pre_post, bool front_to_back=true, bool depth_first=true) const
iterative_walker end (walker_type wt=cw_pre_post, bool front_to_back=true, bool depth_first=true)
const_iterative_walker end (walker_type wt=cw_pre_post, bool front_to_back=true, bool depth_first=true) const
reverse_iterator rbegin ()
reverse_iterator rend ()
const_reverse_iterator rbegin () const
const_reverse_iterator rend () const
size_type size () const
reference getroot ()
const_reference getroot () const
size_type depth (const iterative_walker &__position)
 __ITree (size_type __n, const _Tp &__value, const allocator_type &__a=allocator_type())
 __ITree (size_type __n)
 __ITree (const _Self &__x)
virtual ~__ITree ()
_Self & operator= (const _Self &__x)
_Self & operator= (_Node *__x)
allocator_type get_allocator () const
bool empty () const
size_type max_size () const
void swap (_Self &__x)
void insert_child (const __walker_base &__position, const _Tp &__x, const container_insert_arg &__It)
void insert_child (const __walker_base &__position, const container_insert_arg &__It)
void insert_children (const __walker_base &__position, size_type __n, const _Tp &__x, const children_iterator &__It)
void insert_subtree (const __walker_base &__position, _Self &__subtree, const children_iterator &__It)
void erase (const __walker_base &__position)
_ITree_node< _Tp, _Ctr, _Iterator > * erase_tree (const __walker_base &__position)
bool erase_child (const __walker_base &__position, const children_iterator &__It)
_ITree_node< _Tp, _Ctr, _Iterator > * erase_subtree (const __walker_base &__position, const children_iterator &__It)
size_type depth (const walker &__position)
void clear ()
void clear_children ()
void add_all_children (_Output_Iterator fi, _Node *_parent)

Protected Methods

_ITree_node< _Tp, _Ctr, _Iterator > * _C_create_node (const _Tp &__x)
_ITree_node< _Tp, _Ctr, _Iterator > * _C_create_node ()

Friends

bool operator==__VGTL_NULL_TMPL_ARGS (const __ITree &__x, const __ITree &__y)

Detailed Description

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
class __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >

This is the base class for all trees with data hooks

Definition at line 2044 of file vgtl_tree.h.


Member Typedef Documentation

typedef _Iterator __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::children_iterator [inherited]
 

iterator for accessing the children

Reimplemented from _Tree_base< _Tp, _Ctr, _Iterator, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

Definition at line 1562 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
typedef _Tree_walker<_Tp,const _Tp&,const _Tp*,container_type,children_iterator,_Node> __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::const_iterative_walker
 

the const iterative walker

Definition at line 2064 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
typedef _Tree_iterator<_Tp,const _Tp&,const _Tp*,container_type,children_iterator,node_type> __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::const_iterator
 

the const iterator

Reimplemented from __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

Definition at line 2059 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
typedef std::reverse_iterator<const_iterator> __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::const_reverse_iterator
 

the const reverse iterator

Reimplemented from __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

Definition at line 2068 of file vgtl_tree.h.

typedef _RTree_walker<_Tp,const _Tp&,const _Tp*,container_type,children_iterator,node_type> __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::const_walker [inherited]
 

the (recursive) const walker

Definition at line 1613 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
typedef _Tree_walker<_Tp,_Tp&,_Tp*,container_type,children_iterator,_Node> __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::iterative_walker
 

the iterative walker

Definition at line 2062 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
typedef _Tree_iterator<_Tp,_Tp&,_Tp*,container_type,children_iterator,node_type> __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::iterator
 

the iterator

Reimplemented from __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

Definition at line 2057 of file vgtl_tree.h.

typedef __one_iterator<void *> __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::parents_iterator [inherited]
 

iterator for accessing the parents

Reimplemented from _Tree_base< _Tp, _Ctr, _Iterator, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

Definition at line 1563 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
typedef std::reverse_iterator<iterator> __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::reverse_iterator
 

the reverse iterator

Reimplemented from __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

Definition at line 2070 of file vgtl_tree.h.

typedef _Tp __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::value_type [inherited]
 

standard typedef

Definition at line 1574 of file vgtl_tree.h.

typedef _RTree_walker<_Tp,_Tp&,_Tp*,container_type,children_iterator,node_type> __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::walker [inherited]
 

the (recursive) walker

Definition at line 1611 of file vgtl_tree.h.


Constructor & Destructor Documentation

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
__ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::__ITree const allocator_type   __a = allocator_type() [inline, explicit]
 

standard constructor

Definition at line 2091 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
__ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::__ITree size_type    __n,
const _Tp &    __value,
const allocator_type   __a = allocator_type()
[inline]
 

construct a tree containing __n nodes with value __value at the root spot.

Definition at line 2183 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
__ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::__ITree size_type    __n [inline, explicit]
 

construct a tree containing __n nodes with default value at the root spot.

Definition at line 2190 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
__ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::__ITree const _Self &    __x [inline]
 

copy constructor

Definition at line 2195 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
virtual __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::~__ITree   [inline, virtual]
 

standard destructor

Definition at line 2198 of file vgtl_tree.h.


Member Function Documentation

_ITree_node< _Tp, _Ctr, _Iterator >* __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::_C_create_node   [inline, protected, inherited]
 

construct a new tree node containing default data

Definition at line 1640 of file vgtl_tree.h.

_ITree_node< _Tp, _Ctr, _Iterator >* __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::_C_create_node const _Tp &    __x [inline, protected, inherited]
 

construct a new tree node containing data __x

Definition at line 1628 of file vgtl_tree.h.

void _Tree_base< _Tp, _Ctr, _Iterator, _ITree_node< _Tp, _Ctr, _Iterator > >::add_all_children _Output_Iterator    fi,
_Node *    _parent
[inherited]
 

add all children to the parent _parent. fi is a iterator to the children container of the parent

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
const_iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::begin walker_type    wt = cw_pre_post,
bool    front_to_back = true,
bool    depth_first = true
const [inline]
 

the const walker to the first node of the complete walk

Definition at line 2128 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::begin walker_type    wt = cw_pre_post,
bool    front_to_back = true,
bool    depth_first = true
[inline]
 

the walker to the first node of the complete walk

Definition at line 2121 of file vgtl_tree.h.

void __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::clear   [inline, inherited]
 

empty the tree

Reimplemented from _Tree_base< _Tp, _Ctr, _Iterator, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

Definition at line 1816 of file vgtl_tree.h.

void _Tree_base< _Tp, _Ctr, _Iterator, _ITree_node< _Tp, _Ctr, _Iterator > >::clear_children   [inline, inherited]
 

clear all children of the root node

Definition at line 1465 of file vgtl_tree.h.

size_type __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::depth const walker   __position [inline, inherited]
 

return the depth of node __position in the tree

Definition at line 1804 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
size_type __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::depth const iterative_walker   __position [inline]
 

return the depth of this __position in the tree

Definition at line 2176 of file vgtl_tree.h.

bool __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::empty   const [inline, inherited]
 

is the tree empty?

Definition at line 1656 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
const_iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::end walker_type    wt = cw_pre_post,
bool    front_to_back = true,
bool    depth_first = true
const [inline]
 

the const walker beyond the last node of the walk

Definition at line 2142 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::end walker_type    wt = cw_pre_post,
bool    front_to_back = true,
bool    depth_first = true
[inline]
 

the walker beyond the last node of the walk

Definition at line 2136 of file vgtl_tree.h.

void __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::erase const __walker_base &    __position [inline, inherited]
 

erase the node at position __position.

Definition at line 1712 of file vgtl_tree.h.

bool __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::erase_child const __walker_base &    __position,
const children_iterator   __It
[inline, inherited]
 

erase the (leaf) child __It of node __position. This works if and only if the child is a leaf.

Definition at line 1769 of file vgtl_tree.h.

_ITree_node< _Tp, _Ctr, _Iterator >* __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::erase_subtree const __walker_base &    __position,
const children_iterator   __It
[inline, inherited]
 

erase the subtree position __position, whose top node is the child at children_iterator position __It, and return its top node.

Definition at line 1789 of file vgtl_tree.h.

_ITree_node< _Tp, _Ctr, _Iterator >* __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::erase_tree const __walker_base &    __position [inline, inherited]
 

erase the subtree starting at position __position, and return its top node.

Definition at line 1742 of file vgtl_tree.h.

allocator_type __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::get_allocator   const [inline, inherited]
 

construct an allocator object

Definition at line 1586 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
const_reference __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::getroot   const [inline]
 

get a const reference to the virtual root node

Definition at line 2173 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
reference __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::getroot   [inline]
 

get a reference to the virtual root node

Definition at line 2171 of file vgtl_tree.h.

void __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::insert_child const __walker_base &    __position,
const container_insert_arg &    __It
[inline, inherited]
 

add a child below __position with default data, at the __It position in the __position - node's children container

Definition at line 1675 of file vgtl_tree.h.

void __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::insert_child const __walker_base &    __position,
const _Tp &    __x,
const container_insert_arg &    __It
[inline, inherited]
 

add a child below __position with data __x, at the __It position in the __position - node's children container

Definition at line 1667 of file vgtl_tree.h.

void __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::insert_children const __walker_base &    __position,
size_type    __n,
const _Tp &    __x,
const children_iterator   __It
[inline, inherited]
 

add __n children below __position with data __x, after the __It position in the __position - node's children container

Definition at line 1681 of file vgtl_tree.h.

void __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::insert_subtree const __walker_base &    __position,
_Self &    __subtree,
const children_iterator   __It
[inline, inherited]
 

add a complete subtree __subtree below position __position and children iterator position __It.

Definition at line 1701 of file vgtl_tree.h.

size_type __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::max_size   const [inline, inherited]
 

return the maximum possible size of the tree (theor. infinity)

Definition at line 1659 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
_Self& __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::operator= _Node *    __x [inline]
 

assign a tree from one node -> make this node the root node. This is useful for making trees out of erased subtrees.

Reimplemented in ntree< _Tp, _SequenceCtr, _PtrAlloc, _Alloc >, atree< _Tp, _AssocCtr, _Key, _Compare, _PtrAlloc, _Alloc >, and stree< _Key, _Compare, _AssocCtr, _PtrAlloc, _Alloc >.

Definition at line 2207 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
_Self& __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::operator= const _Self &    __x
 

standard assignment operator

Reimplemented from __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
const_reverse_iterator __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::rbegin   const [inline]
 

return a const reverse iterator to the first node in walk

Definition at line 2157 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
reverse_iterator __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::rbegin   [inline]
 

return a reverse iterator to the first node in walk

Definition at line 2150 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
const_reverse_iterator __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::rend   const [inline]
 

return a const reverse iterator beyond the last node in walk

Definition at line 2160 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
reverse_iterator __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::rend   [inline]
 

return a reverse iterator beyond the last node in walk

Definition at line 2153 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
const_iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::root walker_type    wt = cw_pre_post,
bool    front_to_back = true,
bool    depth_first = true
const [inline]
 

return a const iterative walker of type wt to the ground node

Definition at line 2105 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::root walker_type    wt = cw_pre_post,
bool    front_to_back = true,
bool    depth_first = true
[inline]
 

return an iterative walker of type wt to the ground node

Definition at line 2098 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
size_type __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::size   const [inline]
 

return the size of the tree (# of nodes)

Definition at line 2164 of file vgtl_tree.h.

void __Tree_t< _Tp, _Ctr, _Iterator, _Inserter, _ITree_node< _Tp, _Ctr, _Iterator >, _Alloc >::swap _Self &    __x [inline, inherited]
 

swap two trees

Definition at line 1662 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
const_iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::through   const [inline]
 

the const walker beyond the complete walk

Definition at line 2116 of file vgtl_tree.h.

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
iterative_walker __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc >::through   [inline]
 

the walker beyond the complete walk

Definition at line 2112 of file vgtl_tree.h.


Friends And Related Function Documentation

template<class _Tp, class _Ctr, class _Iterator, class _Inserter, class _Alloc>
bool operator==__VGTL_NULL_TMPL_ARGS const __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc > &    __x,
const __ITree< _Tp, _Ctr, _Iterator, _Inserter, _Alloc > &    __y
[friend]
 

comparison operator


The documentation for this class was generated from the following file:
Generated on Tue Nov 4 01:41:30 2003 for Vienna Graph Template Library by doxygen1.2.18