TB2::Stack - A stack object to be used when you need a stack of things.
# TODO use TB2::Stack; my $stack = TB2::Stack->new;
A generic stack object that centralizes the idea of a stack.
This is a read only attribute that is to be specified at creation if you need to have a stack that only contains a specific type of items.
Because this is a stack the value supplied for type is expected to be the subtype for ArrayRef. So, for example, if type => 'Str' then items will be of type ArrayRef[Str], if type => undef then items will just remain of type ArrayRef. Due to the way that the type system works you can only specify the inital value of the item, no complex types can be specified.
Default: undef implying that any item can be contained in the stack.
my $items = $stack->items;
Returns an array ref of the TB2::AssertRecord objects on the stack.
Returns the count of the items in the stack.
Remove the last element from the items stack and return it.
Remove the first element of the items stack, and return it.
!!!! CURRENTLY NOT IMPLIMENTED AS THERE COULD BE ISSUES WITH THREADS !!!!
Add or remove elements anywhere in an array
Prepend item(s) to the beginning of the items stack.
Append one or more elements to the items stack.