Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

gslib::sapling::tree< Value, Allocator >::node Class Reference

実際にアロケーションをするクラス More...

Inheritance diagram for gslib::sapling::tree< Value, Allocator >::node:

Inheritance graph
[legend]
Collaboration diagram for gslib::sapling::tree< Value, Allocator >::node:

Collaboration graph
[legend]
List of all members.

Public Member Functions

size_type depth () const
nodeparent ()
nodenext ()
nodeprev ()
nodebegin ()
nodeend ()
const nodeparent () const
const nodenext () const
const nodeprev () const
const nodebegin () const
const nodeend () const
reference value ()
const_reference value () const
void next (link *n)
void prev (link *p)
void parent (link *p)
 node (const_reference v)

Private Attributes

link self_children_
 子(開始〜終端)を格納


Detailed Description

template<typename Value, typename Allocator = std::allocator< void >>
class gslib::sapling::tree< Value, Allocator >::node

実際にアロケーションをするクラス

Definition at line 121 of file tree.h.


Constructor & Destructor Documentation

template<typename Value, typename Allocator = std::allocator< void >>
gslib::sapling::tree< Value, Allocator >::node::node const_reference  v  )  [inline]
 

Definition at line 189 of file tree.h.

References gslib::sapling::tree< Value, Allocator >::node::self_children_.

00189                                           :
00190                     value_holder( v ),
00191                     self_children_( this ) {
00192                 }
            };


Member Function Documentation

template<typename Value, typename Allocator = std::allocator< void >>
const node* gslib::sapling::tree< Value, Allocator >::node::begin  )  const [inline]
 

Definition at line 167 of file tree.h.

References gslib::sapling::tree< Value, Allocator >::link::next, and gslib::sapling::tree< Value, Allocator >::node::self_children_.

00167                                           {
00168                     return static_cast< const node* >( self_children_.next );
00169                 }

template<typename Value, typename Allocator = std::allocator< void >>
node* gslib::sapling::tree< Value, Allocator >::node::begin  )  [inline]
 

Definition at line 152 of file tree.h.

References gslib::sapling::tree< Value, Allocator >::link::next, and gslib::sapling::tree< Value, Allocator >::node::self_children_.

Referenced by gslib::sapling::tree< Value, Allocator >::const_post_order_iterator::bottom(), gslib::sapling::tree< Value, Allocator >::const_post_order_iterator::down(), gslib::sapling::tree< Value, Allocator >::const_pre_order_iterator::down_front(), gslib::sapling::tree< Value, Allocator >::has_child(), and gslib::sapling::tree< Value, Allocator >::is_begin().

00152                                 {
00153                     return static_cast< node* >( self_children_.next );
00154                 }

template<typename Value, typename Allocator = std::allocator< void >>
size_type gslib::sapling::tree< Value, Allocator >::node::depth  )  const [inline]
 

Return values:
0 root
tree::npos root end ( = tree.end() )
others distance from root

Definition at line 131 of file tree.h.

References gslib::sapling::tree< Value, Allocator >::is_root(), gslib::sapling::tree< Value, Allocator >::is_root_end(), gslib::sapling::tree< Value, Allocator >::node::parent(), and gslib::sapling::tree< Value, Allocator >::size_type.

Referenced by gslib::sapling::tree< Value, Allocator >::iterator_base::depth().

00131                                         {
00132                     if ( is_root_end( this ) ) {
00133                         return npos;
00134                     }
00135                     size_type i = 0;
00136                     const node* n = this;
00137                     while ( false == is_root( n ) ) {
00138                         ++i;
00139                         n = n->parent();
00140                     }
00141                     return i;
00142                 }

Here is the call graph for this function:

template<typename Value, typename Allocator = std::allocator< void >>
const node* gslib::sapling::tree< Value, Allocator >::node::end  )  const [inline]
 

Definition at line 170 of file tree.h.

References gslib::sapling::tree< Value, Allocator >::node::self_children_.

00170                                         {
00171                     return static_cast< const node* >( &self_children_ );
00172                 }

template<typename Value, typename Allocator = std::allocator< void >>
node* gslib::sapling::tree< Value, Allocator >::node::end  )  [inline]
 

Definition at line 155 of file tree.h.

References gslib::sapling::tree< Value, Allocator >::node::self_children_.

Referenced by gslib::sapling::tree< Value, Allocator >::const_post_order_iterator::bottom(), gslib::sapling::tree< Value, Allocator >::const_pre_order_iterator::down_back(), gslib::sapling::tree< Value, Allocator >::get_parent(), gslib::sapling::tree< Value, Allocator >::has_child(), gslib::sapling::tree< Value, Allocator >::is_back(), and gslib::sapling::tree< Value, Allocator >::is_end().

00155                               {
00156                     return static_cast< node* >( &self_children_ );
00157                 }

template<typename Value, typename Allocator = std::allocator< void >>
void gslib::sapling::tree< Value, Allocator >::node::next link n  )  [inline]
 

Definition at line 179 of file tree.h.

00179                                      {
00180                     value_holder::next = n;
00181                 }

template<typename Value, typename Allocator = std::allocator< void >>
const node* gslib::sapling::tree< Value, Allocator >::node::next  )  const [inline]
 

Definition at line 161 of file tree.h.

00161                                          {
00162                     return static_cast< const node* >( value_holder::next );
00163                 }

template<typename Value, typename Allocator = std::allocator< void >>
node* gslib::sapling::tree< Value, Allocator >::node::next  )  [inline]
 

Definition at line 146 of file tree.h.

Referenced by gslib::sapling::tree< Value, Allocator >::insert().

00146                                {
00147                     return static_cast< node* >( value_holder::next );
00148                 }

template<typename Value, typename Allocator = std::allocator< void >>
void gslib::sapling::tree< Value, Allocator >::node::parent link p  )  [inline]
 

Definition at line 185 of file tree.h.

00185                                        {
00186                     value_holder::parent = static_cast< root_end* >( p );
00187                 }

template<typename Value, typename Allocator = std::allocator< void >>
const node* gslib::sapling::tree< Value, Allocator >::node::parent  )  const [inline]
 

Definition at line 158 of file tree.h.

00158                                            {
00159                     return static_cast< const node* >( value_holder::parent );
00160                 }

template<typename Value, typename Allocator = std::allocator< void >>
node* gslib::sapling::tree< Value, Allocator >::node::parent  )  [inline]
 

Definition at line 143 of file tree.h.

Referenced by gslib::sapling::tree< Value, Allocator >::const_post_order_iterator::decrement(), gslib::sapling::tree< Value, Allocator >::node::depth(), gslib::sapling::tree< Value, Allocator >::get_parent(), and gslib::sapling::tree< Value, Allocator >::insert().

00143                                  {
00144                     return static_cast< node* >( value_holder::parent );
00145                 }

template<typename Value, typename Allocator = std::allocator< void >>
void gslib::sapling::tree< Value, Allocator >::node::prev link p  )  [inline]
 

Definition at line 182 of file tree.h.

00182                                      {
00183                     value_holder::prev = p;
00184                 }

template<typename Value, typename Allocator = std::allocator< void >>
const node* gslib::sapling::tree< Value, Allocator >::node::prev  )  const [inline]
 

Definition at line 164 of file tree.h.

00164                                          {
00165                     return static_cast< const node* >( value_holder::prev );
00166                 }

template<typename Value, typename Allocator = std::allocator< void >>
node* gslib::sapling::tree< Value, Allocator >::node::prev  )  [inline]
 

Definition at line 149 of file tree.h.

Referenced by gslib::sapling::tree< Value, Allocator >::const_pre_order_iterator::down_back(), gslib::sapling::tree< Value, Allocator >::insert(), and gslib::sapling::tree< Value, Allocator >::is_back().

00149                                {
00150                     return static_cast< node* >( value_holder::prev );
00151                 }

template<typename Value, typename Allocator = std::allocator< void >>
const_reference gslib::sapling::tree< Value, Allocator >::node::value  )  const [inline]
 

Definition at line 176 of file tree.h.

00176                                               {
00177                     return value_holder::value;
00178                 }

template<typename Value, typename Allocator = std::allocator< void >>
reference gslib::sapling::tree< Value, Allocator >::node::value  )  [inline]
 

Definition at line 173 of file tree.h.

References gslib::sapling::tree< Value, Allocator >::reference.

Referenced by gslib::sapling::tree< Value, Allocator >::root().

00173                                     {
00174                     return value_holder::value;
00175                 }


Member Data Documentation

template<typename Value, typename Allocator = std::allocator< void >>
link gslib::sapling::tree< Value, Allocator >::node::self_children_ [private]
 

子(開始〜終端)を格納

Definition at line 122 of file tree.h.

Referenced by gslib::sapling::tree< Value, Allocator >::node::begin(), gslib::sapling::tree< Value, Allocator >::node::end(), and gslib::sapling::tree< Value, Allocator >::node::node().


The documentation for this class was generated from the following file:
Generated on Sat Nov 27 15:03:20 2004 for sapling by doxygen 1.3.6