|
Gnash
0.8.10
|
#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. | |
| T & | top (StackSize i) |
| From the top of the stack, get the i'th value down. | |
| const T & | at (StackSize i) const |
| From the top of the stack, get the i'th value down. | |
| T & | at (StackSize i) |
| From the top of the stack, get the i'th value down. | |
| 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. | |
| void | drop (StackSize i) |
| void | clear () |
| Drop all stack elements reguardless of the "downstop". | |
| void | push (const T &t) |
| T & | pop () |
| Pop the top of the stack. | |
| void | grow (StackSize i) |
| StackSize | getDownstop () const |
| Gives the size of the stack which is currently accessible. | |
| StackSize | size () const |
| Alias for getDownstop() | |
| bool | empty () const |
| Is the stack empty to us? (Check totalSize() != for actually empty) | |
| StackSize | fixDownstop () |
| void | setDownstop (StackSize i) |
| StackSize | totalSize () const |
| Return the complete stack size, including non-accessible elements. | |
| void | setAllSizes (StackSize total, StackSize downstop) |
| SafeStack () | |
| Default constructor. | |
| ~SafeStack () | |
| Delete the allocated data. | |
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 |
| gnash::SafeStack< T >::SafeStack | ( | ) | [inline] |
Default constructor.
| gnash::SafeStack< T >::~SafeStack | ( | ) | [inline] |
Delete the allocated data.
| void gnash::SafeStack< T >::assign | ( | StackSize | i, |
| T | val | ||
| ) | [inline] |
Assign a value to given index counting from bottom.
| const T& gnash::SafeStack< T >::at | ( | StackSize | i | ) | const [inline] |
From the top of the stack, get the i'th value down.
0 is the topmost value value.
Referenced by gnash::VM::markReachableResources().
| T& gnash::SafeStack< T >::at | ( | StackSize | i | ) | [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.
| void gnash::SafeStack< T >::clear | ( | ) | [inline] |
Drop all stack elements reguardless of the "downstop".
Referenced by gnash::movie_root::reset().
| void gnash::SafeStack< T >::drop | ( | StackSize | i | ) | [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.
Referenced by gnash::as_environment::drop(), gnash::abc::Machine::execute(), gnash::abc::Machine::immediateFunction(), gnash::SafeStack< State >::pop(), and gnash::abc::Machine::pushCall().
| bool gnash::SafeStack< T >::empty | ( | ) | const [inline] |
Is the stack empty to us? (Check totalSize() != for actually empty)
Referenced by gnash::abc::Machine::completeName().
| StackSize gnash::SafeStack< T >::fixDownstop | ( | ) | [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.
Referenced by gnash::abc::Machine::executeFunction(), and gnash::abc::Machine::instantiateClass().
| StackSize gnash::SafeStack< T >::getDownstop | ( | ) | const [inline] |
Gives the size of the stack which is currently accessible.
| void gnash::SafeStack< T >::grow | ( | StackSize | i | ) | [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::execute(), gnash::abc::Machine::immediateFunction(), gnash::SafeStack< State >::push(), and gnash::abc::Machine::pushCall().
| T& gnash::SafeStack< T >::pop | ( | ) | [inline] |
Pop the top of the stack.
Referenced by gnash::abc::Machine::execute(), and gnash::as_environment::pop().
| void gnash::SafeStack< T >::push | ( | const T & | t | ) | [inline] |
Put a new value onto the top of the stack. The value will be copied.
Referenced by gnash::abc::Machine::execute(), gnash::abc::Machine::getMember(), gnash::as_environment::push(), gnash::abc::Machine::pushSet(), and gnash::abc::Machine::setMember().
| void gnash::SafeStack< T >::setAllSizes | ( | StackSize | total, |
| StackSize | downstop | ||
| ) | [inline] |
Set the total size and local size of the stack, for restoring a stack through unknown changes.
Referenced by gnash::abc::Machine::executeFunction(), and gnash::abc::Machine::instantiateClass().
| void gnash::SafeStack< T >::setDownstop | ( | StackSize | i | ) | [inline] |
Makes the stack read to a depth of 'i'. This cannot be more than totalSize()
Referenced by gnash::abc::Machine::immediateFunction(), and gnash::abc::Machine::pushCall().
| StackSize gnash::SafeStack< T >::size | ( | ) | const [inline] |
Alias for getDownstop()
Referenced by gnash::SafeStack< State >::assign(), gnash::as_environment::drop(), gnash::SafeStack< State >::drop(), gnash::VM::dumpState(), gnash::SafeStack< State >::empty(), gnash::abc::Machine::execute(), gnash::SafeStack< State >::grow(), gnash::as_environment::stack_size(), gnash::SafeStack< State >::top(), and gnash::SafeStack< State >::value().
| const T& gnash::SafeStack< T >::top | ( | StackSize | i | ) | const [inline] |
From the top of the stack, get the i'th value down.
0 is the topmost value.
Referenced by gnash::abc::Machine::completeName(), gnash::abc::Machine::execute(), gnash::abc::Machine::getMember(), gnash::abc::Machine::immediateFunction(), gnash::SafeStack< State >::pop(), gnash::SafeStack< State >::push(), gnash::abc::Machine::setMember(), and gnash::as_environment::top().
| T& gnash::SafeStack< T >::top | ( | StackSize | i | ) | [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.
| StackSize gnash::SafeStack< T >::totalSize | ( | ) | const [inline] |
Return the complete stack size, including non-accessible elements.
This is required because AVM2 scope stacks are usable even when they appear inaccessible
Referenced by gnash::SafeStack< State >::at(), gnash::abc::Machine::executeFunction(), gnash::abc::Machine::instantiateClass(), and gnash::VM::markReachableResources().
| T& gnash::SafeStack< T >::value | ( | StackSize | i | ) | [inline] |
From the bottom of the stack, get the i'th value up. 0 is the bottommost value.
Referenced by gnash::VM::dumpState(), and gnash::abc::Machine::execute().
| const T& gnash::SafeStack< T >::value | ( | StackSize | i | ) | const [inline] |
1.7.6.1