メインページ | ネームスペース一覧 | クラス階層 | 構成 | ファイル一覧 | ネームスペースメンバ | 構成メンバ | ファイルメンバ | 関連ページ

クラス テンプレートstatic_container::abstruct_list_node_pool< Value >

サブクラスはコンストラクタで init() を呼ばなければならない。 [詳細]

#include <list_node_pool.h>

static_container::abstruct_list_node_pool< Value >に対する継承グラフ

Inheritance graph
[凡例]
static_container::abstruct_list_node_pool< Value >のコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

Public 型

typedef list_link link
typedef list_node< Value > node

Public メソッド

virtual size_type size () const=0
nodeallocate ()
 メモリ領域の貸与のみ。value のコンストラクタ呼び出しは、ユーザーの責任。

void deallocate (link *first, link *last)
 デストラクタ呼び出しは行わない

void deallocate (link *n)
 デストラクタ呼び出しは行わない

bool full () const
size_type rest () const
 空きノード数取得


Protected メソッド

 abstruct_list_node_pool ()
virtual nodegetTop ()=0
void init ()

Private 変数

link free_

説明

template<typename Value>
class static_container::abstruct_list_node_pool< Value >

サブクラスはコンストラクタで init() を呼ばなければならない。

list_node_pool.h15 行で定義されています。


型定義

template<typename Value>
typedef list_link static_container::abstruct_list_node_pool< Value >::link
 

list_node_pool.h17 行で定義されています。

参照元 static_container::abstruct_list_node_pool< Value >::deallocate(), と static_container::abstruct_list_node_pool< Value >::rest().

template<typename Value>
typedef list_node< Value > static_container::abstruct_list_node_pool< Value >::node
 

list_node_pool.h18 行で定義されています。

参照元 static_container::abstruct_list_node_pool< Value >::allocate(), と static_container::abstruct_list_node_pool< Value >::init().


コンストラクタとデストラクタ

template<typename Value>
static_container::abstruct_list_node_pool< Value >::abstruct_list_node_pool  )  [inline, protected]
 

list_node_pool.h24 行で定義されています。

00024                                   {
00025         }


関数

template<typename Value>
node* static_container::abstruct_list_node_pool< Value >::allocate  )  [inline]
 

メモリ領域の貸与のみ。value のコンストラクタ呼び出しは、ユーザーの責任。

list_node_pool.h44 行で定義されています。

参照先 static_container::abstruct_list_node_pool< Value >::free_, static_container::list_link::isolate(), static_container::list_link::next, と static_container::abstruct_list_node_pool< Value >::node.

00044                          {
00045             if ( free_.next != &free_ ) {
00046                 node* result = static_cast< node* >( free_.next );
00047                 result->isolate();
00048                 return result;
00049             } else {
00050                 return 0;
00051             }
00052         }

template<typename Value>
void static_container::abstruct_list_node_pool< Value >::deallocate link n  )  [inline]
 

デストラクタ呼び出しは行わない

list_node_pool.h79 行で定義されています。

参照先 static_container::abstruct_list_node_pool< Value >::deallocate(), static_container::abstruct_list_node_pool< Value >::link, と static_container::list_link::next.

00079                                       {
00080             deallocate( n, n->next );
00081         }

template<typename Value>
void static_container::abstruct_list_node_pool< Value >::deallocate link first,
link last
[inline]
 

デストラクタ呼び出しは行わない

list_node_pool.h58 行で定義されています。

参照先 static_container::abstruct_list_node_pool< Value >::free_, static_container::abstruct_list_node_pool< Value >::link, static_container::list_link::next, と static_container::list_link::prev.

参照元 static_container::abstruct_list_node_pool< Value >::deallocate().

00058                                                       {
00059             if ( first == last ) {
00060                 return;
00061             }
00062             
00063             //  「first の直前」と「last」を接続
00064             first->prev->next = last;
00065             link* lastPrev = last->prev;
00066             last->prev = first->prev;
00067 
00068             //  [ first, lastPrev ] を free_ の終端に接続
00069             first->prev = free_.prev;
00070             free_.prev->next = first;
00071             free_.prev = lastPrev;
00072             lastPrev->next = &free_;
00073         }

template<typename Value>
bool static_container::abstruct_list_node_pool< Value >::full  )  const [inline]
 

戻り値:
true これ以上挿入不能
false 挿入可能

list_node_pool.h88 行で定義されています。

参照先 static_container::abstruct_list_node_pool< Value >::free_, と static_container::list_link::next.

00088                           {
00089             return free_.next == &free_;
00090         }

template<typename Value>
virtual node* static_container::abstruct_list_node_pool< Value >::getTop  )  [protected, pure virtual]
 

static_container::list_node_pool< Value, Size >を実装しています.

参照元 static_container::abstruct_list_node_pool< Value >::init().

template<typename Value>
void static_container::abstruct_list_node_pool< Value >::init  )  [inline, protected]
 

list_node_pool.h28 行で定義されています。

参照先 static_container::abstruct_list_node_pool< Value >::free_, static_container::abstruct_list_node_pool< Value >::getTop(), static_container::list_link::next, static_container::abstruct_list_node_pool< Value >::node, static_container::list_link::prev, static_container::abstruct_list_node_pool< Value >::size(), と static_container::size_type.

参照元 static_container::list_node_pool< Value, Size >::list_node_pool().

00028                        {
00029             //  すべての要素を free_ に追加
00030             node* top = getTop();
00031             free_.next = top;
00032             free_.prev = top + size() - 1;
00033             top->prev = &free_;
00034             free_.prev->next = &free_;
00035             for ( size_type i = 1; i < size(); ++i ) {
00036                 top[ i - 1 ].next = &top[ i ];
00037                 top[ i ].prev = &top[ i - 1 ];
00038             }
00039         }

template<typename Value>
size_type static_container::abstruct_list_node_pool< Value >::rest  )  const [inline]
 

空きノード数取得

list_node_pool.h93 行で定義されています。

参照先 static_container::abstruct_list_node_pool< Value >::free_, static_container::abstruct_list_node_pool< Value >::link, static_container::list_link::next, と static_container::size_type.

00093                                {
00094             link* n = free_.next;
00095             size_type result = 0;
00096             while ( &free_ != n ) {
00097                 n = n->next;
00098                 ++result;
00099             }
00100             return result;
00101         }

template<typename Value>
virtual size_type static_container::abstruct_list_node_pool< Value >::size  )  const [pure virtual]
 

static_container::list_node_pool< Value, Size >を実装しています.

参照元 static_container::abstruct_list_node_pool< Value >::init().


変数

template<typename Value>
link static_container::abstruct_list_node_pool< Value >::free_ [private]
 

list_node_pool.h21 行で定義されています。

参照元 static_container::abstruct_list_node_pool< Value >::allocate(), static_container::abstruct_list_node_pool< Value >::deallocate(), static_container::abstruct_list_node_pool< Value >::full(), static_container::abstruct_list_node_pool< Value >::init(), と static_container::abstruct_list_node_pool< Value >::rest().


このクラスの説明は次のファイルから生成されました:
static_containerに対してSat Jun 19 11:31:02 2004に生成されました。 doxygen 1.3.6