ACE_Bounded_Stack< T > Class Template ReferenceImplement a generic LIFO abstract data type. More...
Collaboration diagram for ACE_Bounded_Stack< T >:
![]()
Detailed Descriptiontemplate<class T>
Implement a generic LIFO abstract data type.
|
ACE_Bounded_Stack< T >::ACE_Bounded_Stack | ( | size_t | size | ) | [inline] |
Initialize a new empty stack with the provided size..
Initialize and allocate space for a new Bounded_Stack with the provided size.
ACE_Bounded_Stack< T >::ACE_Bounded_Stack | ( | const ACE_Bounded_Stack< T > & | s | ) | [inline] |
Initialize the stack to be a copy of the stack provided.
Initialize the stack to be an exact copy of the Bounded_Stack provided as a parameter.
ACE_Bounded_Stack< T >::~ACE_Bounded_Stack | ( | void | ) | [inline] |
Perform actions needed when stack goes out of scope.
Deallocate the memory used by the Bounded_Stack.
void ACE_Bounded_Stack< T >::operator= | ( | const ACE_Bounded_Stack< T > & | s | ) | [inline] |
Assignment operator.
Perform a deep copy operation using the Bounded_Stack parameter. If the capacity of the lhs isn't sufficient for the rhs, then the underlying data structure will be reallocated to accomadate the larger number of elements.
ACE_INLINE int ACE_Bounded_Stack< T >::push | ( | const T & | new_item | ) | [inline] |
Add an element to the top of the stack.
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.
ACE_INLINE int ACE_Bounded_Stack< T >::pop | ( | T & | item | ) | [inline] |
Remove an item from the top of stack.
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.
ACE_INLINE int ACE_Bounded_Stack< T >::top | ( | T & | item | ) | const [inline] |
Examine the contents of the top of 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.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL ACE_INLINE int ACE_Bounded_Stack< T >::is_empty | ( | void | ) | const [inline] |
Returns 1 if the container is empty, otherwise returns 0.
Performs constant time check to determine if the stack is empty.
ACE_INLINE int ACE_Bounded_Stack< T >::is_full | ( | void | ) | const [inline] |
Returns 1 if the container is full, otherwise returns 0.
Performs constant time check to determine if the stack is at capacity.
ACE_INLINE size_t ACE_Bounded_Stack< T >::size | ( | void | ) | const [inline] |
The number of items in the stack.
Return the number of items currently in the stack.
ACE_BEGIN_VERSIONED_NAMESPACE_DECL void ACE_Bounded_Stack< T >::dump | ( | void | ) | const [inline] |
Dump the state of an object.
ACE_Bounded_Stack< T >::ACE_ALLOC_HOOK_DECLARE |
Declare the dynamic allocation hooks.
size_t ACE_Bounded_Stack< T >::size_ [private] |
Size of the dynamically allocated data.
size_t ACE_Bounded_Stack< T >::top_ [private] |
Keeps track of the current top of stack.
T* ACE_Bounded_Stack< T >::stack_ [private] |
Holds the stack's contents.