#include <list_node_pool.h>
Inheritance diagram for gslib::static_container::abstruct_list_node_pool< Value >:
Public Types | |
typedef list_link | link |
typedef list_node< Value > | node |
Public Member Functions | |
virtual size_type | size () const=0 |
node * | allocate () |
メモリ領域の貸与のみ。value のコンストラクタ呼び出しは、ユーザーの責任。 | |
void | deallocate (link *first, link *last) |
デストラクタ呼び出しは行わない | |
void | deallocate (link *n) |
デストラクタ呼び出しは行わない | |
bool | full () const |
size_type | rest () const |
空きノード数取得 | |
Protected Member Functions | |
abstruct_list_node_pool () | |
virtual node * | getTop ()=0 |
void | init () |
Private Attributes | |
link | free_ |
Definition at line 69 of file list_node_pool.h.
|
Definition at line 71 of file list_node_pool.h. Referenced by gslib::static_container::abstruct_list_node_pool< Value >::deallocate(), and gslib::static_container::abstruct_list_node_pool< Value >::rest(). |
|
Definition at line 72 of file list_node_pool.h. Referenced by gslib::static_container::abstruct_list_node_pool< Value >::allocate(), and gslib::static_container::abstruct_list_node_pool< Value >::init(). |
|
Definition at line 78 of file list_node_pool.h.
00078 { 00079 } |
|
メモリ領域の貸与のみ。value のコンストラクタ呼び出しは、ユーザーの責任。
Definition at line 98 of file list_node_pool.h. References gslib::static_container::abstruct_list_node_pool< Value >::free_, gslib::static_container::list_link::isolate(), gslib::static_container::list_link::next, and gslib::static_container::abstruct_list_node_pool< Value >::node.
|
Here is the call graph for this function:
|
デストラクタ呼び出しは行わない
Definition at line 133 of file list_node_pool.h. References gslib::static_container::abstruct_list_node_pool< Value >::deallocate(), gslib::static_container::abstruct_list_node_pool< Value >::link, and gslib::static_container::list_link::next.
00133 { 00134 deallocate( n, n->next ); 00135 } |
Here is the call graph for this function:
|
デストラクタ呼び出しは行わない
Definition at line 112 of file list_node_pool.h. References gslib::static_container::abstruct_list_node_pool< Value >::free_, gslib::static_container::abstruct_list_node_pool< Value >::link, gslib::static_container::list_link::next, and gslib::static_container::list_link::prev. Referenced by gslib::static_container::abstruct_list_node_pool< Value >::deallocate().
00112 { 00113 if ( first == last ) { 00114 return; 00115 } 00116 00117 // 「first の直前」と「last」を接続 00118 first->prev->next = last; 00119 link* lastPrev = last->prev; 00120 last->prev = first->prev; 00121 00122 // [ first, lastPrev ] を free_ の終端に接続 00123 first->prev = free_.prev; 00124 free_.prev->next = first; 00125 free_.prev = lastPrev; 00126 lastPrev->next = &free_; 00127 } |
|
Definition at line 142 of file list_node_pool.h. References gslib::static_container::abstruct_list_node_pool< Value >::free_, and gslib::static_container::list_link::next.
|
|
Implemented in gslib::static_container::list_node_pool< Value, Size >. Referenced by gslib::static_container::abstruct_list_node_pool< Value >::init(). |
|
Definition at line 82 of file list_node_pool.h. References gslib::static_container::abstruct_list_node_pool< Value >::free_, gslib::static_container::abstruct_list_node_pool< Value >::getTop(), gslib::static_container::list_link::next, gslib::static_container::abstruct_list_node_pool< Value >::node, gslib::static_container::list_link::prev, and gslib::static_container::abstruct_list_node_pool< Value >::size(). Referenced by gslib::static_container::list_node_pool< Value, Size >::list_node_pool().
00082 { 00083 // すべての要素を free_ に追加 00084 node* top = getTop(); 00085 free_.next = top; 00086 free_.prev = top + size() - 1; 00087 top->prev = &free_; 00088 free_.prev->next = &free_; 00089 for ( size_type i = 1; i < size(); ++i ) { 00090 top[ i - 1 ].next = &top[ i ]; 00091 top[ i ].prev = &top[ i - 1 ]; 00092 } 00093 } |
Here is the call graph for this function:
|
空きノード数取得
Definition at line 147 of file list_node_pool.h. References gslib::static_container::abstruct_list_node_pool< Value >::free_, gslib::static_container::abstruct_list_node_pool< Value >::link, and gslib::static_container::list_link::next.
|
|
Implemented in gslib::static_container::list_node_pool< Value, Size >. Referenced by gslib::static_container::abstruct_list_node_pool< Value >::init(). |
|