バナーをクリックすれば目次に戻ります

Copyright 1999 Rogue Wave Software
Copyright 1999 Sun Microsystems, Inc.


RWSlistCollectablesStack

RWSlistCollectablesStack RWSlistCollectables RWSequenceable ...
...RWCollection RWCollectable

形式

// Smalltalk の typedef:
typedef RWSlistCollectablesStack Stack;
#include <rw/stackcol.h>
RWSlistCollectablesStack a;

説明

このクラスは、クラス RWSlistCollectables への制限されたインタフェースであり、後入れ先出し (LIFO) 方式のスタックを実装します。このスタックは順編成リストで、すべての挿入と削除はその一方 (リストの最初) で行われます。要素の順序は、外部的に、つまり挿入の順番で決まります。要素の重複は許可されています。

このクラスによって格納されるオブジェクトは、抽象基底クラス RWCollectable を継承しなければなりません。スタック内の項目と何かが一致するかどうかを検査するには、仮想関数 isEqual() が必要です (RWCollectable を参照してください) 。

このクラスは、Smalltalk のクラス Stack に対応しています。

持続性

多相

公開コンストラクタ

RWSlistCollectablesStack();

空のスタックを作成します。

RWSlistCollectablesStack(RWCollectable* a);

単一項目 a から成るスタックを作成します。

RWSlistCollectablesStack(const RWSlistCollectablesStack& s);

コピーコンストラクタ。スタック s のシャローコピーを作成します。

代入演算子

void
operator=(const RWSlistCollectablesStack& s);

代入演算子。スタック s のシャローコピーを作成します。

公開メンバー関数

virtual void
apply(RWapplyCollectable ap, void*);
virtual RWspace
binaryStoreSize() const;
virtual void
clear();

クラス RWSlistCollectables から継承した関数。

virtual void
clearAndDestroy();
virtual RWBoolean
contains(const RWCollectable* target) const;

クラス RWCollection から継承した関数。

RWBoolean
containsReference(const RWCollectable* e) const;
virtual size_t
entries() const;

クラス RWSlistCollectables から継承した関数。

virtual RWCollectable*
first() const;

クラス RWSlistCollectables から継承した関数。top() と同じ。

virtual RWCollectable*
insert(RWCollectable* c);

クラス RWSlistCollectables から継承した関数。push() と同じ。

virtual RWClassID
isA() const;

クラス RWCollectable から再定義した関数で、__RWSLISTCOLLECTABLESSTACK を返します。

virtual RWBoolean
isEmpty()const;

クラス RWSlistCollectables から継承した関数。

virtual RWCollectable*
last() const;

クラス RWSlistCollectables から継承した関数。スタックの最後にある項目を返します。

virtual size_t
occurrencesOf(const RWCollectable* target) const;
size_t
occurrencesOfReference(const RWCollectable* e) const;

クラス RWSlistCollectables から継承した関数。

virtual RWCollectable*
remove(const RWCollectable*);

クラス RWSlistCollectables から再定義した関数で、pop() を呼び出します。引数は無視します。

RWCollectable*
pop();

スタックの先頭にある項目を取り除き、その項目を返します。スタックが空であればNULL を返します。

void
push(RWCollectable*);

スタックの先頭に項目を追加します。

RWCollectable*
top() const;

スタックの先頭にある項目を返します。スタックが空であれば NULL を返します。