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

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

list_node_pool からノードを借りてリンクリストをつなげていく。 利用が終わったら、list_node_pool にノードを返す。 [詳細]

#include <lodge_list.h>

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

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

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

Public 型

typedef list_link link
typedef list_node< Value > node
typedef abstruct_list_node_pool<
Value > 
pool
typedef boost::call_traits<
Value >::param_type 
param_type

Public メソッド

 lodge_list (pool &ioPool)
 lodge_list (const lodge_list &other)
 ~lodge_list ()
lodge_listoperator= (const lodge_list &other)
iterator begin ()
iterator end ()
const_iterator begin () const
const_iterator end () const
reference push_back ()
Value * allocate (iterator pos=end())
 ノードは、pos の直前に連結される

void insert (iterator pos, param_type v)
 prev = pos - 1 とすると、元々 prev, pos と接続されていたものが、prev, v, pos の順に接続される。

template<typename It> void insert (iterator pos, It first, It last)
 prev = pos - 1 とすると、元々 prev, pos と接続されていたものが、prev, v, pos の順に接続される。

void push_front (param_type v)
 先頭に追加

void push_back (param_type v)
 末尾に追加

void erase (iterator pos)
 pos で示される要素を削除

void erase (iterator first, iterator last)
 区間 [ first, last ) を削除

void clear ()
 クリア(全要素削除)

void pop_front ()
 先頭を削除

void pop_back ()
 末尾を削除

void remove (const Value &value)
 値 value を持つ要素を削除する

template<typename Pred> void remove_if (Pred pred)
 pred( *it ) が true を返すときに it を削除する

size_type size () const
 サイズ取得

bool empty () const
 空かどうか?

reference front ()
 先頭を取得

param_type front () const
 先頭を取得

reference back ()
 末尾を取得

param_type back () const
 末尾を取得


Private メソッド

void init ()

Static Private メソッド

void destruct (Value &v)

Private 変数

link end_
poolpool_

説明

template<typename Value>
class gslib::static_container::lodge_list< Value >

list_node_pool からノードを借りてリンクリストをつなげていく。 利用が終わったら、list_node_pool にノードを返す。

lodge_list 利用中に list_node_pool を破棄してはならない。

http://www.alc.co.jp/ で、 lodge = 【自動-1】 泊まる、宿泊{しゅくはく}する、下宿{げしゅく}する とあったので、命名したが、もっと良い名前があれば、随時募集。

lodge_list.h80 行で定義されています。


型定義

template<typename Value>
typedef list_link gslib::static_container::lodge_list< Value >::link
 

lodge_list.h82 行で定義されています。

template<typename Value>
typedef list_node< Value > gslib::static_container::lodge_list< Value >::node
 

lodge_list.h83 行で定義されています。

template<typename Value>
typedef boost::call_traits< Value >::param_type gslib::static_container::lodge_list< Value >::param_type
 

lodge_list.h87 行で定義されています。

template<typename Value>
typedef abstruct_list_node_pool< Value > gslib::static_container::lodge_list< Value >::pool
 

gslib::static_container::list< Value, MaxSize >, と gslib::static_container::list< std::pair< Key, Value >, MaxSize >で再定義されています。

lodge_list.h85 行で定義されています。


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

template<typename Value>
gslib::static_container::lodge_list< Value >::lodge_list pool ioPool  )  [inline]
 

lodge_list.h230 行で定義されています。

00230                                        : pool_( &ioPool ) {
00231                 init();
00232             }

template<typename Value>
gslib::static_container::lodge_list< Value >::lodge_list const lodge_list< Value > &  other  )  [inline]
 

lodge_list.h233 行で定義されています。

00233                                                   : pool_( other.pool_ ) {
00234                 init();
00235                 insert( begin(), other.begin(), other.end() );          
00236             }

template<typename Value>
gslib::static_container::lodge_list< Value >::~lodge_list  )  [inline]
 

lodge_list.h237 行で定義されています。

00237                           {
00238                 clear();
00239             }


関数

template<typename Value>
Value* gslib::static_container::lodge_list< Value >::allocate iterator  pos = end()  )  [inline]
 

ノードは、pos の直前に連結される

lodge_list.h273 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::insert().

00273                                                     {
00274                 node* n = pool_->allocate();
00275                 BOOST_ASSERT( 0 != n );
00276                 iterator prev = pos;
00277                 --prev;
00278                 prev.setNext( n );
00279                 pos.setPrev( n );
00280                 n->next = pos.getNode();
00281                 n->prev = prev.getNode();
00282                 return &n->value;
00283             }

template<typename Value>
param_type gslib::static_container::lodge_list< Value >::back  )  const [inline]
 

末尾を取得

lodge_list.h393 行で定義されています。

00393                                     {
00394                 return *( --end() );
00395             }

template<typename Value>
reference gslib::static_container::lodge_list< Value >::back  )  [inline]
 

末尾を取得

lodge_list.h389 行で定義されています。

00389                              {
00390                 return *( --end() );
00391             }

template<typename Value>
const_iterator gslib::static_container::lodge_list< Value >::begin  )  const [inline]
 

lodge_list.h256 行で定義されています。

00256                                          {
00257                 return const_iterator( end_.next );
00258             }

template<typename Value>
iterator gslib::static_container::lodge_list< Value >::begin  )  [inline]
 

lodge_list.h250 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::clear(), gslib::static_container::lodge_list< std::pair< Key, Value > >::front(), gslib::static_container::list< std::pair< Key, Value >, MaxSize >::list(), gslib::static_container::lodge_list< std::pair< Key, Value > >::lodge_list(), gslib::static_container::lodge_list< std::pair< Key, Value > >::operator=(), gslib::static_container::list< std::pair< Key, Value >, MaxSize >::operator=(), gslib::static_container::lodge_list< std::pair< Key, Value > >::pop_front(), gslib::static_container::lodge_list< std::pair< Key, Value > >::push_front(), gslib::static_container::lodge_list< std::pair< Key, Value > >::remove_if(), と gslib::static_container::lodge_list< std::pair< Key, Value > >::size().

00250                              {
00251                 return iterator( end_.next );
00252             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::clear  )  [inline]
 

クリア(全要素削除)

lodge_list.h336 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::operator=(), gslib::static_container::list< std::pair< Key, Value >, MaxSize >::operator=(), と gslib::static_container::lodge_list< std::pair< Key, Value > >::~lodge_list().

00336                          {
00337                 erase( begin(), end() );
00338             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::destruct Value &  v  )  [inline, static, private]
 

lodge_list.h89 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::erase().

00089                                              {
00090                 static_container::destruct< Value >( v );
00091             }

template<typename Value>
bool gslib::static_container::lodge_list< Value >::empty  )  const [inline]
 

空かどうか?

lodge_list.h376 行で定義されています。

00376                                {
00377                 return end_.next == &end_;
00378             }

template<typename Value>
const_iterator gslib::static_container::lodge_list< Value >::end  )  const [inline]
 

lodge_list.h259 行で定義されています。

00259                                        {
00260                 return const_iterator( &end_ );
00261             }

template<typename Value>
iterator gslib::static_container::lodge_list< Value >::end  )  [inline]
 

lodge_list.h253 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::back(), gslib::static_container::lodge_list< std::pair< Key, Value > >::clear(), gslib::static_container::list< std::pair< Key, Value >, MaxSize >::list(), gslib::static_container::lodge_list< std::pair< Key, Value > >::lodge_list(), gslib::static_container::lodge_list< std::pair< Key, Value > >::operator=(), gslib::static_container::list< std::pair< Key, Value >, MaxSize >::operator=(), gslib::static_container::lodge_list< std::pair< Key, Value > >::pop_back(), gslib::static_container::lodge_list< std::pair< Key, Value > >::push_back(), gslib::static_container::lodge_list< std::pair< Key, Value > >::remove_if(), と gslib::static_container::lodge_list< std::pair< Key, Value > >::size().

00253                            {
00254                 return iterator( &end_ );
00255             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::erase iterator  first,
iterator  last
[inline]
 

区間 [ first, last ) を削除

lodge_list.h328 行で定義されています。

00328                                                         {
00329                 //  解放
00330                 std::for_each( first, last, destruct );
00331                 //  node を pool に返す
00332                 pool_->deallocate( first.getNode(), last.getNode() );
00333             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::erase iterator  pos  )  [inline]
 

pos で示される要素を削除

lodge_list.h319 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::clear(), gslib::static_container::lodge_list< std::pair< Key, Value > >::pop_back(), gslib::static_container::lodge_list< std::pair< Key, Value > >::pop_front(), と gslib::static_container::lodge_list< std::pair< Key, Value > >::remove_if().

00319                                        {
00320                 //  解放
00321                 destruct( *pos );
00322 
00323                 //  node を pool に返す
00324                 pool_->deallocate( pos.getNode() );
00325             }

template<typename Value>
param_type gslib::static_container::lodge_list< Value >::front  )  const [inline]
 

先頭を取得

lodge_list.h385 行で定義されています。

00385                                      {
00386                 return *begin();
00387             }

template<typename Value>
reference gslib::static_container::lodge_list< Value >::front  )  [inline]
 

先頭を取得

lodge_list.h381 行で定義されています。

00381                               {
00382                 return *begin();
00383             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::init  )  [inline, private]
 

lodge_list.h224 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::lodge_list().

00224                         {
00225                 end_.next = &end_;
00226                 end_.prev = &end_;
00227             }

template<typename Value>
template<typename It>
void gslib::static_container::lodge_list< Value >::insert iterator  pos,
It  first,
It  last
[inline]
 

prev = pos - 1 とすると、元々 prev, pos と接続されていたものが、prev, v, pos の順に接続される。

lodge_list.h300 行で定義されています。

00300                                                            {
00301                 for ( ; first != last; ++first ) {
00302                     Value* val = allocate( pos );
00303                     //  コンストラクタ呼び出し
00304                     new( val ) Value( *first );
00305                 }
00306             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::insert iterator  pos,
param_type  v
[inline]
 

prev = pos - 1 とすると、元々 prev, pos と接続されていたものが、prev, v, pos の順に接続される。

lodge_list.h289 行で定義されています。

参照元 gslib::static_container::list< std::pair< Key, Value >, MaxSize >::list(), gslib::static_container::lodge_list< std::pair< Key, Value > >::lodge_list(), gslib::static_container::lodge_list< std::pair< Key, Value > >::operator=(), gslib::static_container::list< std::pair< Key, Value >, MaxSize >::operator=(), gslib::static_container::lodge_list< std::pair< Key, Value > >::push_back(), と gslib::static_container::lodge_list< std::pair< Key, Value > >::push_front().

00289                                                       {
00290                 Value* val = allocate( pos );
00291                 //  コンストラクタ呼び出し
00292                 new( val ) Value( v );
00293             }

template<typename Value>
lodge_list& gslib::static_container::lodge_list< Value >::operator= const lodge_list< Value > &  other  )  [inline]
 

lodge_list.h241 行で定義されています。

00241                                                                {
00242                 if ( this != &other ) {
00243                     clear();
00244                     pool_ = other.pool_;
00245                     insert( begin(), other.begin(), other.end() );
00246                 }
00247                 return *this;
00248             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::pop_back  )  [inline]
 

末尾を削除

lodge_list.h346 行で定義されています。

00346                             {
00347                 erase( --end() );
00348             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::pop_front  )  [inline]
 

先頭を削除

lodge_list.h341 行で定義されています。

00341                              {
00342                 erase( begin() );
00343             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::push_back param_type  v  )  [inline]
 

末尾に追加

lodge_list.h314 行で定義されています。

00314                                            {
00315                 insert( end(), v );
00316             }

template<typename Value>
reference gslib::static_container::lodge_list< Value >::push_back  )  [inline]
 

lodge_list.h263 行で定義されています。

00263                                   {
00264                 node* n = pool_->allocate();
00265                 BOOST_ASSERT( 0 != n );
00266                 return new( &n->value ) Value();
00267             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::push_front param_type  v  )  [inline]
 

先頭に追加

lodge_list.h309 行で定義されています。

00309                                             {
00310                 return insert( begin(), v );
00311             }

template<typename Value>
void gslib::static_container::lodge_list< Value >::remove const Value &  value  )  [inline]
 

値 value を持つ要素を削除する

lodge_list.h351 行で定義されています。

00351                                               {
00352                 remove_if( std::bind2nd( std::equal_to< value_type >(), value ) );
00353             }

template<typename Value>
template<typename Pred>
void gslib::static_container::lodge_list< Value >::remove_if Pred  pred  )  [inline]
 

pred( *it ) が true を返すときに it を削除する

lodge_list.h360 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::remove().

00360                                         {
00361                 for ( iterator it = begin(); end() != it; ) {
00362                     if ( pred( *it ) ) {
00363                         erase( it++ );
00364                     } else {
00365                         ++it;
00366                     }
00367                 }
00368             }

template<typename Value>
size_type gslib::static_container::lodge_list< Value >::size  )  const [inline]
 

サイズ取得

lodge_list.h371 行で定義されています。

00371                                    {
00372                 return static_cast< size_type >( std::distance( begin(), end() ) );
00373             }


変数

template<typename Value>
link gslib::static_container::lodge_list< Value >::end_ [private]
 

lodge_list.h221 行で定義されています。

template<typename Value>
pool* gslib::static_container::lodge_list< Value >::pool_ [private]
 

lodge_list.h222 行で定義されています。

参照元 gslib::static_container::lodge_list< std::pair< Key, Value > >::operator=().


このクラスの説明は次のファイルから生成されました:
static_containerに対してSat Nov 27 15:03:21 2004に生成されました。 doxygen 1.3.6