#include <Containers_T.h>
Collaboration diagram for ACE_Unbounded_Stack:
Public Types | |
typedef ACE_Unbounded_Stack_Iterator< T> | ITERATOR |
Public Methods | |
ACE_Unbounded_Stack (ACE_Allocator *alloc = 0) | |
Initialize a new stack so that it is empty. Use user defined allocation strategy if specified. | |
ACE_Unbounded_Stack (const ACE_Unbounded_Stack<T> &s) | |
The copy constructor (performs initialization). | |
void | operator= (const ACE_Unbounded_Stack<T> &s) |
Assignment operator(performs assignment). | |
~ACE_Unbounded_Stack (void) | |
Perform actions needed when stack goes out of scope. | |
int | push (const T &new_item) |
int | pop (T &item) |
int | top (T &item) const |
int | is_empty (void) const |
Returns 1 if the container is empty, otherwise returns 0. | |
int | is_full (void) const |
Returns 1 if the container is full, otherwise returns 0. | |
int | insert (const T &new_item) |
int | remove (const T &item) |
Remove <item> from the Stack. Returns 0 if it removes the item, -1 if it can't find the item, and -1 if a failure occurs. | |
int | find (const T &item) const |
Finds if <item> occurs the set. Returns 0 if finds, else -1. | |
size_t | size (void) const |
The number of items in the stack. | |
void | dump (void) const |
Dump the state of an object. | |
Public Attributes | |
ACE_ALLOC_HOOK_DECLARE | |
Declare the dynamic allocation hooks. | |
Private Methods | |
void | delete_all_nodes (void) |
Delete all the nodes in the stack. | |
void | copy_all_nodes (const ACE_Unbounded_Stack<T> &s) |
Copy all nodes from <s> to <this>. | |
Private Attributes | |
ACE_Node<T>* | head_ |
Head of the linked list of Nodes. | |
size_t | cur_size_ |
Current size of the stack. | |
ACE_Allocator* | allocator_ |
Allocation strategy of the stack. | |
Friends | |
class | ACE_Unbounded_Stack_Iterator< T > |
This implementation of an unbounded Stack uses a linked list. If you use the <insert> or <remove> methods you should keep in mind that duplicate entries aren't allowed. In general, therefore, you should avoid the use of these methods since they aren't really part of the ADT stack.
|
|
|
Initialize a new stack so that it is empty. Use user defined allocation strategy if specified.
|
|
The copy constructor (performs initialization).
|
|
Perform actions needed when stack goes out of scope.
|
|
Copy all nodes from <s> to <this>.
|
|
Delete all the nodes in the stack.
|
|
Dump the state of an object.
|
|
Finds if <item> occurs the set. Returns 0 if finds, else -1.
|
|
Insert <new_item> into the Stack at the head (but doesn't allow duplicates). Returns -1 if failures occur, 1 if item is already present (i.e., no duplicates are allowed), else 0. |
|
Returns 1 if the container is empty, otherwise returns 0.
|
|
Returns 1 if the container is full, otherwise returns 0.
|
|
Assignment operator(performs assignment).
|
|
Remove and return the top stack item. Returns -1 if the stack is already empty, 0 if the stack is not already empty, and -1 if failure occurs. |
|
Place a new item on top of the stack. Returns -1 if the stack is already full, 0 if the stack is not already full, and -1 if failure occurs. |
|
Remove <item> from the Stack. Returns 0 if it removes the item, -1 if it can't find the item, and -1 if a failure occurs.
|
|
The number of items in the stack.
|
|
Return top stack item without removing it. Returns -1 if the stack is already empty, 0 if the stack is not already empty, and -1 if failure occurs. |
|
|
|
Declare the dynamic allocation hooks.
|
|
Allocation strategy of the stack.
|
|
Current size of the stack.
|
|
Head of the linked list of Nodes.
|