collection2  v0.6.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
collection2::List< Element, Size > Class Template Reference

リスト More...

#include <list.hpp>

Public Member Functions

 List (Node< Element, Size > *const data, const Size &dataSize)
 内部データを扱う領域とそのサイズを指定してリストを初期化 More...
 
 List (const List &)=delete
 
Listoperator= (const List &)=delete
 
OperationResult append (const Element &element)
 リストの末尾にデータを追加 More...
 
OperationResult insert (const Size &index, const Element &element)
 リスト内の任意の位置にデータを追加 More...
 
OperationResult pop (Element *const element)
 リスト末尾のデータを削除し、取り出す More...
 
OperationResult remove (const Size &index, Element *const element)
 リスト内の任意の位置にあるデータを削除し、取り出す More...
 
Element * get (const Size &index)
 リスト内の要素を参照する More...
 
Node< Element > * head () const
 リスト先頭へのポインタを取得 More...
 
Node< Element > * tail () const
 リスト末尾へのポインタを取得 More...
 
Size capacity () const
 リストの全体長を返す More...
 
Size amount () const
 現在リスト内にあるデータ数を返す More...
 

Detailed Description

template<typename Element, typename Size = size_t>
class collection2::List< Element, Size >

リスト

Template Parameters
Element扱う要素の型

Constructor & Destructor Documentation

◆ List()

template<typename Element , typename Size >
collection2::List< Element, Size >::List ( Node< Element, Size > *const  data,
const Size &  dataSize 
)

内部データを扱う領域とそのサイズを指定してリストを初期化

Parameters
data内部データ保管用領域
dataSize領域サイズ

Member Function Documentation

◆ append()

template<typename Element , typename Size >
OperationResult collection2::List< Element, Size >::append ( const Element &  element)

リストの末尾にデータを追加

Parameters
element追加するデータ
Returns
OperationResult 操作結果

◆ insert()

template<typename Element , typename Size >
OperationResult collection2::List< Element, Size >::insert ( const Size &  index,
const Element &  element 
)

リスト内の任意の位置にデータを追加

Parameters
index追加位置
element追加するデータ
Returns
OperationResult 操作結果

◆ pop()

template<typename Element , typename Size >
OperationResult collection2::List< Element, Size >::pop ( Element *const  element)

リスト末尾のデータを削除し、取り出す

Parameters
element削除したデータの格納先
Returns
OperationResult 操作結果

◆ remove()

template<typename Element , typename Size >
OperationResult collection2::List< Element, Size >::remove ( const Size &  index,
Element *const  element 
)

リスト内の任意の位置にあるデータを削除し、取り出す

Parameters
index削除位置
element削除したデータの格納先
Returns
OperationResult 操作結果

◆ get()

template<typename Element , typename Size >
Element * collection2::List< Element, Size >::get ( const Size &  index)

リスト内の要素を参照する

Parameters
index参照位置
Returns
Element* 要素へのポインタ
Note
範囲外のindexを指定した場合はnullptrが返ります。

◆ head()

template<typename Element , typename Size = size_t>
Node< Element > * collection2::List< Element, Size >::head ( ) const
inline

リスト先頭へのポインタを取得

Returns
Element* リスト先頭へのポインタ

◆ tail()

template<typename Element , typename Size = size_t>
Node< Element > * collection2::List< Element, Size >::tail ( ) const
inline

リスト末尾へのポインタを取得

Returns
Element* リスト末尾へのポインタ

◆ capacity()

template<typename Element , typename Size = size_t>
Size collection2::List< Element, Size >::capacity ( ) const
inline

リストの全体長を返す

Returns
buffer_size_t リスト長

◆ amount()

template<typename Element , typename Size = size_t>
Size collection2::List< Element, Size >::amount ( ) const
inline

現在リスト内にあるデータ数を返す

Returns
buffer_size_t リスト内に存在するデータの数

The documentation for this class was generated from the following file: