Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

vtkObjectBaseStack Class Reference

#include <vtkObjectBaseStack.h>

Inheritance diagram for vtkObjectBaseStack:

Inheritance graph
[legend]
Collaboration diagram for vtkObjectBaseStack:

Collaboration graph
[legend]
List of all members.

Detailed Description

A stack container for objects.

A stack is an adaptor that provides a restricted subset of Container functionality: it provides insertion, removal, and inspection of the item at the top of the stack. Stack is a "last in first out" (LIFO) data structure: the item at the top of a stack is the one that was most recently added.

Note:
Stack does not allow iteration through its items. Stack is generally a container adaptor, meaning that it is implemented on top of some underlying container type. By default that underlying internal type is deque.
Author:
Sean McInerney
Version:
Revision
1.3
Date:
Date
2005/06/24 23:17:16
See also:
vtkObjectBase

Definition at line 43 of file vtkObjectBaseStack.h.

Public Member Functions

 vtkTypeRevisionMacro (vtkObjectBaseStack, vtkAdaptorContainer)
void PrintSelf (ostream &, vtkIndent)
virtual vtkIdType GetSize (void) const
 Returns the number of items in the container.

virtual int IsEmpty (void) const
 Returns true if this container is empty.

virtual vtkIdType GetMaxSize (void) const
 Returns the maximum size of this container.

virtual int Clear (void)
 Erase ALL items in the container.

virtual int Swap (vtkObjectBaseStack *container)
 Swaps items of this container with those of the specified container.

virtual int Copy (vtkObjectBaseStack *container)
 Copy all items from the specified container into this container.

vtkIdType GetSizeLimit (void) const
 Get/Set stack size limit (-1 == unlimited).

void SetSizeLimit (vtkIdType limit)
 Get/Set stack size limit (-1 == unlimited).

Stack Operations
virtual int Push (vtkObjectBase *item)
 Add an item to the top of this stack.

int Pop (void)
 Removes the first item in this stack.

virtual vtkObjectBaseTop (void) const
 Returns the first item in this stack on success, NULL otherwise.

Atypical Operations
virtual vtkObjectBaseAt (vtkIdType position) const
 Provides access by index to the objects contained in this stack.

int PopBottom (void)
 Removes the last item in this stack.


Static Public Member Functions

vtkObjectBaseStackNew (void)

Protected Member Functions

 vtkObjectBaseStack (void)
 ~vtkObjectBaseStack ()
void ReportReferences (vtkGarbageCollector *)


Constructor & Destructor Documentation

vtkObjectBaseStack::vtkObjectBaseStack void   )  [protected]
 

vtkObjectBaseStack::~vtkObjectBaseStack  )  [protected]
 


Member Function Documentation

virtual vtkObjectBase* vtkObjectBaseStack::At vtkIdType  position  )  const [virtual]
 

Provides access by index to the objects contained in this stack.

Parameters:
position The item index for which object should be accessed.
Returns:
the item if position is a valid index, otherwise null.

Reimplemented in vtkObjectStack.

virtual int vtkObjectBaseStack::Clear void   )  [virtual]
 

Erase ALL items in the container.

Returns:
true on success, false otherwise.

Implements vtkContainer.

virtual int vtkObjectBaseStack::Copy vtkObjectBaseStack container  )  [virtual]
 

Copy all items from the specified container into this container.

Returns:
true on success, otherwise false.

virtual vtkIdType vtkObjectBaseStack::GetMaxSize void   )  const [virtual]
 

Returns the maximum size of this container.

Reimplemented from vtkContainer.

virtual vtkIdType vtkObjectBaseStack::GetSize void   )  const [virtual]
 

Returns the number of items in the container.

Reimplemented from vtkContainer.

vtkIdType vtkObjectBaseStack::GetSizeLimit void   )  const
 

Get/Set stack size limit (-1 == unlimited).

virtual int vtkObjectBaseStack::IsEmpty void   )  const [virtual]
 

Returns true if this container is empty.

Reimplemented from vtkContainer.

vtkObjectBaseStack* vtkObjectBaseStack::New void   )  [static]
 

Reimplemented from vtkObject.

Reimplemented in vtkObjectStack.

int vtkObjectBaseStack::Pop void   ) 
 

Removes the first item in this stack.

Note:
No object is returned. If the first item is needed, it should be retrieved before calling Pop.
Returns:
true on success, false otherwise.

int vtkObjectBaseStack::PopBottom void   ) 
 

Removes the last item in this stack.

Note:
No object is returned. If the last item is needed, it should be retrieved before calling PopBottom.
Returns:
true on success, false otherwise.

void vtkObjectBaseStack::PrintSelf ostream &  ,
vtkIndent 
[virtual]
 

Reimplemented from vtkAdaptorContainer.

Reimplemented in vtkObjectStack.

virtual int vtkObjectBaseStack::Push vtkObjectBase item  )  [virtual]
 

Add an item to the top of this stack.

Parameters:
item The object to be added.
Returns:
true on success, false otherwise.

void vtkObjectBaseStack::ReportReferences vtkGarbageCollector *   )  [protected]
 

void vtkObjectBaseStack::SetSizeLimit vtkIdType  limit  ) 
 

Get/Set stack size limit (-1 == unlimited).

virtual int vtkObjectBaseStack::Swap vtkObjectBaseStack container  )  [virtual]
 

Swaps items of this container with those of the specified container.

Returns:
true on success, otherwise false.

vtkObjectBase * vtkObjectBaseStack::Top void   )  const [inline, virtual]
 

Returns the first item in this stack on success, NULL otherwise.

Reimplemented in vtkObjectStack.

Definition at line 164 of file vtkObjectBaseStack.h.

References vtkContainer::Back().

vtkObjectBaseStack::vtkTypeRevisionMacro vtkObjectBaseStack  ,
vtkAdaptorContainer 
 


The documentation for this class was generated from the following file:
Generated on Thu Jul 14 14:40:02 2005 for vtkContainers by doxygen 1.3.6