Gnash
0.8.11dev
|
#include <SafeStack.h>
Public Types | |
typedef StackType::size_type | StackSize |
Public Member Functions | |
const T & | top (StackSize i) const |
From the top of the stack, get the i'th value down. More... | |
T & | top (StackSize i) |
From the top of the stack, get the i'th value down. More... | |
const T & | at (StackSize i) const |
From the top of the stack, get the i'th value down. More... | |
T & | at (StackSize i) |
From the top of the stack, get the i'th value down. More... | |
T & | value (StackSize i) |
const T & | value (StackSize i) const |
void | assign (StackSize i, T val) |
Assign a value to given index counting from bottom. More... | |
void | drop (StackSize i) |
void | clear () |
Drop all stack elements reguardless of the "downstop". More... | |
void | push (const T &t) |
T & | pop () |
Pop the top of the stack. More... | |
void | grow (StackSize i) |
StackSize | getDownstop () const |
Gives the size of the stack which is currently accessible. More... | |
StackSize | size () const |
Alias for getDownstop() More... | |
bool | empty () const |
Is the stack empty to us? (Check totalSize() != for actually empty) More... | |
StackSize | fixDownstop () |
void | setDownstop (StackSize i) |
StackSize | totalSize () const |
Return the complete stack size, including non-accessible elements. More... | |
void | setAllSizes (StackSize total, StackSize downstop) |
SafeStack () | |
Default constructor. More... | |
~SafeStack () | |
Delete the allocated data. More... | |
A stack in which all references given remain valid while the stack lives.
Safe in SafeStack means that you can maintain a reference given by the stack as long as the stack is alive. Since it is a reference, there is no guarantee that it will remain constant, but it is guaranteed that it will remain valid.
Access outside of the bounds of the stack will result in a StackException being thrown.
typedef StackType::size_type gnash::SafeStack< T >::StackSize |
|
inline |
Default constructor.
|
inline |
Delete the allocated data.
|
inline |
Assign a value to given index counting from bottom.
|
inline |
From the top of the stack, get the i'th value down.
0 is the topmost value value.
|
inline |
From the top of the stack, get the i'th value down.
This is a non-const version of at(). 0 is the topmost value value.
|
inline |
Drop all stack elements reguardless of the "downstop".
|
inline |
Shrink the stack by i entries. Does not invalidate any entries previously given, it just sets the top for pop, push, and top operations.
|
inline |
Is the stack empty to us? (Check totalSize() != for actually empty)
|
inline |
Makes the stack appear empty to subsequent callers. This can be used to simulate multiple stacks with a single stack, as in function calling. Returns the old downstop for restoring it using setDownstop.
|
inline |
Gives the size of the stack which is currently accessible.
|
inline |
Grow by i entries. Normally this is 1, but there might be sometime when you need more than that.
Referenced by gnash::abc::Machine::pushCall().
|
inline |
Pop the top of the stack.
Referenced by gnash::abc::Machine::pushCall().
|
inline |
Put a new value onto the top of the stack. The value will be copied.
|
inline |
Set the total size and local size of the stack, for restoring a stack through unknown changes.
|
inline |
Makes the stack read to a depth of 'i'. This cannot be more than totalSize()
|
inline |
Alias for getDownstop()
Referenced by gnash::abc::Machine::execute().
|
inline |
From the top of the stack, get the i'th value down.
0 is the topmost value.
Referenced by gnash::abc::Machine::pushCall().
|
inline |
From the top of the stack, get the i'th value down.
This is a non-const version of top(). 0 is the topmost value value.
|
inline |
Return the complete stack size, including non-accessible elements.
This is required because AVM2 scope stacks are usable even when they appear inaccessible
|
inline |
From the bottom of the stack, get the i'th value up. 0 is the bottommost value.
|
inline |