foobar2000 SDK  2015-08-03
Public Types | Public Member Functions | Data Fields | Private Member Functions
pfc::_avltree_node< t_storage >

#include <avltree.h>

+ Inheritance diagram for pfc::_avltree_node< t_storage >:

Public Types

typedef _list_node< t_storage > t_node
 
typedef refcounted_object_ptr_t< t_selft_ptr
 
typedef t_selft_rawptr
 
typedef _avltree_node< t_storage > t_self
 
- Public Types inherited from pfc::_list_node< t_storage >
typedef _list_node< t_storage > t_self
 

Public Member Functions

template<typename t_param >
 _avltree_node (t_param const &param)
 
void add_ref () throw ()
 
t_rawptr child (bool which) const throw ()
 
void link_child (bool which, t_self *ptr) throw ()
 
void link_left (t_self *ptr) throw ()
 
void link_right (t_self *ptr) throw ()
 
t_nodenext () throw ()
 
t_rawptr peakchild (bool direction) throw ()
 
t_nodeprev () throw ()
 
void release () throw ()
 
t_rawptr step (bool direction) throw ()
 
void unlink () throw ()
 
bool which_child (const t_self *ptr) const throw ()
 
- Public Member Functions inherited from pfc::_list_node< t_storage >
 TEMPLATE_CONSTRUCTOR_FORWARD_FLOOD (_list_node, m_content) t_storagem_content
 
t_selfwalk (bool forward) throw ()
 
- Public Member Functions inherited from pfc::refcounted_object_root
void _refcount_release_temporary () throw ()
 
void refcount_add_ref () throw ()
 
void refcount_release () throw ()
 

Data Fields

t_size m_depth
 
t_ptr m_left
 
t_rawptr m_parent
 
t_ptr m_right
 

Private Member Functions

 ~_avltree_node () throw ()
 

Additional Inherited Members

- Protected Member Functions inherited from pfc::refcounted_object_root
 refcounted_object_root ()
 
virtual ~refcounted_object_root ()
 

Detailed Description

template<typename t_storage>
class pfc::_avltree_node< t_storage >

Definition at line 4 of file avltree.h.

Member Typedef Documentation

template<typename t_storage >
typedef _list_node<t_storage> pfc::_avltree_node< t_storage >::t_node

Definition at line 6 of file avltree.h.

template<typename t_storage >
typedef refcounted_object_ptr_t<t_self> pfc::_avltree_node< t_storage >::t_ptr

Definition at line 10 of file avltree.h.

template<typename t_storage >
typedef t_self* pfc::_avltree_node< t_storage >::t_rawptr

Definition at line 11 of file avltree.h.

template<typename t_storage >
typedef _avltree_node<t_storage> pfc::_avltree_node< t_storage >::t_self

Definition at line 7 of file avltree.h.

Constructor & Destructor Documentation

template<typename t_storage >
template<typename t_param >
pfc::_avltree_node< t_storage >::_avltree_node ( t_param const &  param)
inline

Definition at line 8 of file avltree.h.

8 : t_node(param), m_left(), m_right(), m_depth() {}
t_size m_depth
Definition: avltree.h:16
_list_node< t_storage > t_node
Definition: avltree.h:6
template<typename t_storage >
pfc::_avltree_node< t_storage >::~_avltree_node ( )
throw (
)
inlineprivate

Definition at line 68 of file avltree.h.

68 {}

Member Function Documentation

template<typename t_storage >
void pfc::_avltree_node< t_storage >::add_ref ( )
throw (
)
inline

Definition at line 36 of file avltree.h.

36 {this->refcount_add_ref();}
template<typename t_storage >
t_rawptr pfc::_avltree_node< t_storage >::child ( bool  which) const
throw (
)
inline

Definition at line 39 of file avltree.h.

39 {return which ? m_right.get_ptr() : m_left.get_ptr();}
template<typename t_storage >
void pfc::_avltree_node< t_storage >::link_child ( bool  which,
t_self ptr 
)
throw (
)
inline

Definition at line 27 of file avltree.h.

27  {
28  (which ? m_right : m_left) = ptr;
29  if (ptr != NULL) ptr->m_parent = this;
30  }
template<typename t_storage >
void pfc::_avltree_node< t_storage >::link_left ( t_self ptr)
throw (
)
inline

Definition at line 18 of file avltree.h.

18  {
19  m_left = ptr;
20  if (ptr != NULL) ptr->m_parent = this;
21  }
t_rawptr m_parent
Definition: avltree.h:14
template<typename t_storage >
void pfc::_avltree_node< t_storage >::link_right ( t_self ptr)
throw (
)
inline

Definition at line 22 of file avltree.h.

22  {
23  m_right = ptr;
24  if (ptr != NULL) ptr->m_parent = this;
25  }
t_rawptr m_parent
Definition: avltree.h:14
template<typename t_storage >
t_node* pfc::_avltree_node< t_storage >::next ( )
throw (
)
inlinevirtual

Reimplemented from pfc::_list_node< t_storage >.

Definition at line 66 of file avltree.h.

66 {return step(true);}
t_rawptr step(bool direction)
Definition: avltree.h:44
template<typename t_storage >
t_rawptr pfc::_avltree_node< t_storage >::peakchild ( bool  direction)
throw (
)
inline

Definition at line 57 of file avltree.h.

57  {
58  t_self* walk = this;
59  for(;;) {
60  t_rawptr next = walk->child(direction);
61  if (next == NULL) return walk;
62  walk = next;
63  }
64  }
t_self * t_rawptr
Definition: avltree.h:11
t_self * walk(bool forward)
Definition: iterators.h:14
_avltree_node< t_storage > t_self
Definition: avltree.h:7
t_node * next()
Definition: avltree.h:66
template<typename t_storage >
t_node* pfc::_avltree_node< t_storage >::prev ( )
throw (
)
inlinevirtual

Reimplemented from pfc::_list_node< t_storage >.

Definition at line 65 of file avltree.h.

65 {return step(false);}
t_rawptr step(bool direction)
Definition: avltree.h:44
template<typename t_storage >
void pfc::_avltree_node< t_storage >::release ( )
throw (
)
inline

Definition at line 37 of file avltree.h.

37 {this->refcount_release();}
template<typename t_storage >
t_rawptr pfc::_avltree_node< t_storage >::step ( bool  direction)
throw (
)
inline

Definition at line 44 of file avltree.h.

44  {
45  t_self* walk = this;
46  for(;;) {
47  t_self* t = walk->child(direction);
48  if (t != NULL) return t->peakchild(!direction);
49  for(;;) {
50  t = walk->m_parent;
51  if (t == NULL) return NULL;
52  if (t->which_child(walk) != direction) return t;
53  walk = t;
54  }
55  }
56  }
t_self * walk(bool forward)
Definition: iterators.h:14
_avltree_node< t_storage > t_self
Definition: avltree.h:7
template<typename t_storage >
void pfc::_avltree_node< t_storage >::unlink ( )
throw (
)
inline

Definition at line 32 of file avltree.h.

32  {
33  m_left.release(); m_right.release(); m_parent = NULL; m_depth = 0;
34  }
t_rawptr m_parent
Definition: avltree.h:14
t_size m_depth
Definition: avltree.h:16
template<typename t_storage >
bool pfc::_avltree_node< t_storage >::which_child ( const t_self ptr) const
throw (
)
inline

Definition at line 40 of file avltree.h.

40 {return ptr == m_right.get_ptr();}

Field Documentation

template<typename t_storage >
t_size pfc::_avltree_node< t_storage >::m_depth

Definition at line 16 of file avltree.h.

template<typename t_storage >
t_ptr pfc::_avltree_node< t_storage >::m_left

Definition at line 13 of file avltree.h.

template<typename t_storage >
t_rawptr pfc::_avltree_node< t_storage >::m_parent

Definition at line 14 of file avltree.h.

template<typename t_storage >
t_ptr pfc::_avltree_node< t_storage >::m_right

Definition at line 13 of file avltree.h.


The documentation for this class was generated from the following file: