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

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

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

#include <lodge_list.h>

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

Inheritance graph
[凡例]
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 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.h27 行で定義されています。


型定義

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

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

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

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

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

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

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

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

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


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

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

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

00177                                    : pool_( &ioPool ) {
00178             init();
00179         }

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

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

00180                                               : pool_( other.pool_ ) {
00181             init();
00182             insert( begin(), other.begin(), other.end() );          
00183         }

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

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

00184                       {
00185             clear();
00186         }


関数

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

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

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

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

00220                                                 {
00221             node* n = pool_->allocate();
00222             BOOST_ASSERT( 0 != n );
00223             iterator prev = pos;
00224             --prev;
00225             prev.setNext( n );
00226             pos.setPrev( n );
00227             n->next = pos.getNode();
00228             n->prev = prev.getNode();
00229             return &n->value;
00230         }

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

末尾を取得

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

00340                                 {
00341             return *( --end() );
00342         }

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

末尾を取得

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

00336                          {
00337             return *( --end() );
00338         }

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

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

00203                                      {
00204             return const_iterator( end_.next );
00205         }

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

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

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

00197                          {
00198             return iterator( end_.next );
00199         }

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

クリア(全要素削除)

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

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

00283                      {
00284             erase( begin(), end() );
00285         }

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

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

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

00036                                          {
00037             static_container::destruct< Value >( v );
00038         }

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

空かどうか?

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

00323                            {
00324             return end_.next == &end_;
00325         }

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

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

00206                                    {
00207             return const_iterator( &end_ );
00208         }

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

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

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

00200                        {
00201             return iterator( &end_ );
00202         }

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

区間 [ first, last ) を削除

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

00275                                                     {
00276             //  解放
00277             std::for_each( first, last, destruct );
00278             //  node を pool に返す
00279             pool_->deallocate( first.getNode(), last.getNode() );
00280         }

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

pos で示される要素を削除

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

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

00266                                    {
00267             //  解放
00268             destruct( *pos );
00269 
00270             //  node を pool に返す
00271             pool_->deallocate( pos.getNode() );
00272         }

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

先頭を取得

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

00332                                  {
00333             return *begin();
00334         }

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

先頭を取得

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

00328                           {
00329             return *begin();
00330         }

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

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

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

00171                     {
00172             end_.next = &end_;
00173             end_.prev = &end_;
00174         }

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

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

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

00247                                                        {
00248             for ( ; first != last; ++first ) {
00249                 Value* val = allocate( pos );
00250                 //  コンストラクタ呼び出し
00251                 new( val ) Value( *first );
00252             }
00253         }

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

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

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

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

00236                                                   {
00237             Value* val = allocate( pos );
00238             //  コンストラクタ呼び出し
00239             new( val ) Value( v );
00240         }

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

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

00188                                                            {
00189             if ( this != &other ) {
00190                 clear();
00191                 pool_ = other.pool_;
00192                 insert( begin(), other.begin(), other.end() );
00193             }
00194             return *this;
00195         }

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

末尾を削除

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

00293                         {
00294             erase( --end() );
00295         }

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

先頭を削除

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

00288                          {
00289             erase( begin() );
00290         }

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

末尾に追加

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

00261                                        {
00262             return insert( end(), v );
00263         }

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

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

00210                               {
00211             node* n = pool_->allocate();
00212             BOOST_ASSERT( 0 != n );
00213             new( &n->value ) Value();
00214         }

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

先頭に追加

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

00256                                         {
00257             return insert( begin(), v );
00258         }

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

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

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

00298                                           {
00299             remove_if( std::bind2nd( std::equal_to< value_type >(), value ) );
00300         }

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

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

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

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

00307                                     {
00308             for ( iterator it = begin(); end() != it; ) {
00309                 if ( pred( *it ) ) {
00310                     erase( it++ );
00311                 } else {
00312                     ++it;
00313                 }
00314             }
00315         }

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

サイズ取得

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

00318                                {
00319             return static_cast< size_type >( std::distance( begin(), end() ) );
00320         }


変数

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

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

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

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

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


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