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

スタック More...

#include <stack.hpp>

Public Member Functions

 Stack (Element *const data, const Size &dataSize)
 内部データを扱う領域とそのサイズを指定してスタックを初期化 More...
 
 Stack (const Stack &)=delete
 
Stackoperator= (const Stack &)=delete
 
OperationResult push (const Element &data)
 スタックにデータを追加 More...
 
OperationResult pop (Element *const data)
 スタックからデータを取り出し More...
 
Size capacity () const
 スタックの全体長を返す More...
 
Size amount () const
 現在スタック内にあるデータ数を返す More...
 
bool hasSpace () const
 スタックに値を追加できるか More...
 
bool isEmpty () const
 スタックが空かどうか More...
 

Detailed Description

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

スタック

Template Parameters
Element
Size

Constructor & Destructor Documentation

◆ Stack()

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

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

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

Member Function Documentation

◆ push()

template<typename Element , typename Size >
OperationResult collection2::Stack< Element, Size >::push ( const Element &  data)

スタックにデータを追加

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

◆ pop()

template<typename Element , typename Size >
OperationResult collection2::Stack< Element, Size >::pop ( Element *const  data)

スタックからデータを取り出し

Parameters
data取り出したデータの格納先
Returns
OperationResult 操作結果

◆ capacity()

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

スタックの全体長を返す

Returns
buffer_size_t スタック長

◆ amount()

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

現在スタック内にあるデータ数を返す

Returns
buffer_size_t スタック内に存在するデータの数

◆ hasSpace()

template<typename Element , typename Size = size_t>
bool collection2::Stack< Element, Size >::hasSpace ( ) const
inline

スタックに値を追加できるか

Returns
bool

◆ isEmpty()

template<typename Element , typename Size = size_t>
bool collection2::Stack< Element, Size >::isEmpty ( ) const
inline

スタックが空かどうか

Returns
bool

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