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

vtkContainer Class Reference

#include <vtkContainer.h>

Inheritance diagram for vtkContainer:

Inheritance graph
[legend]
Collaboration diagram for vtkContainer:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract container for objects.

A Container is an object that stores other objects (its items), and that has methods for accessing its items. In particular, every type that is a model of Container has an associated iterator type that can be used to iterate through the Container's items.

There is no guarantee that the items of a Container are stored in any definite order; the order might, in fact, be different upon each iteration through the Container. Nor is there a guarantee that more than one iterator into a Container may be active at any one time. (Specific types of Containers, such as Forward Container, do provide such guarantees.)

A Container "owns" its items: the reference of an item stored in a container is incremented on addition to the container and decremented on its removal or destruction of the container itself.

Author:
Sean McInerney
Version:
Revision
1.5
Date:
Date
2005/07/11 23:18:48

Definition at line 48 of file vtkContainer.h.

Public Member Functions

 vtkTypeRevisionMacro (vtkContainer, vtkObject)
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)=0
 Erase ALL items in the container.

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

virtual int Copy (vtkContainer *container)=0
 Copy all items from the specified container into this container.

virtual vtkIterator * CreateIterator (void)=0
 Create an iterator.

void Register (vtkObjectBase *)
 Increase the reference count (mark as used by another object).

void UnRegister (vtkObjectBase *)
 Decrease the reference count (release by another object).

Data Access Methods
virtual vtkObjectBase * Front (void) const
 Returns the first item in the container, or null if the container is empty.

virtual vtkObjectBase * Back (void) const
 Returns the last item in the container, or null if the container is empty.


Protected Member Functions

 vtkContainer (void)
 ~vtkContainer ()


Constructor & Destructor Documentation

vtkContainer::vtkContainer (  void   )  [protected]
 

vtkContainer::~vtkContainer (   )  [protected]
 


Member Function Documentation

virtual vtkObjectBase* vtkContainer::Back (  void   )  const [virtual]
 

Returns the last item in the container, or null if the container is empty.

Reimplemented in vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBaseQueue, vtkObjectBaseSet, vtkObjectBaseVector, vtkObjectDeque, vtkObjectHashMap, vtkObjectList, vtkObjectMap, vtkObjectQueue, vtkObjectSet, and vtkObjectVector.

Referenced by vtkObjectBaseStack::Top().

virtual int vtkContainer::Clear (  void   )  [pure virtual]
 

Erase ALL items in the container.

Returns:
true on success, false otherwise.

Implemented in vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBasePriorityQueue, vtkObjectBaseQueue, vtkObjectBaseSet, vtkObjectBaseStack, and vtkObjectBaseVector.

virtual int vtkContainer::Copy (  vtkContainer *  container  )  [pure virtual]
 

Copy all items from the specified container into this container.

Returns:
true on success, otherwise false.

virtual vtkIterator* vtkContainer::CreateIterator (  void   )  [pure virtual]
 

Create an iterator.

Implemented in vtkAssociativeContainer, vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBaseSet, vtkObjectBaseVector, vtkObjectDeque, vtkObjectHashMap, vtkObjectList, vtkObjectMap, vtkObjectSet, vtkObjectVector, and vtkSequenceContainer.

virtual vtkObjectBase* vtkContainer::Front (  void   )  const [virtual]
 

Returns the first item in the container, or null if the container is empty.

Reimplemented in vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBaseQueue, vtkObjectBaseSet, vtkObjectBaseVector, vtkObjectDeque, vtkObjectHashMap, vtkObjectList, vtkObjectMap, vtkObjectQueue, vtkObjectSet, and vtkObjectVector.

Referenced by vtkObjectBasePriorityQueue::Top().

virtual vtkIdType vtkContainer::GetMaxSize (  void   )  const [virtual]
 

Returns the maximum size of this container.

Reimplemented in vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBasePriorityQueue, vtkObjectBaseQueue, vtkObjectBaseSet, vtkObjectBaseStack, and vtkObjectBaseVector.

virtual vtkIdType vtkContainer::GetSize (  void   )  const [virtual]
 

Returns the number of items in the container.

Reimplemented in vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBasePriorityQueue, vtkObjectBaseQueue, vtkObjectBaseSet, vtkObjectBaseStack, and vtkObjectBaseVector.

virtual int vtkContainer::IsEmpty (  void   )  const [virtual]
 

Returns true if this container is empty.

Reimplemented in vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBasePriorityQueue, vtkObjectBaseQueue, vtkObjectBaseSet, vtkObjectBaseStack, and vtkObjectBaseVector.

void vtkContainer::PrintSelf (  ostream &  ,
vtkIndent 
)  [virtual]
 

Reimplemented from vtkObject.

Reimplemented in vtkAdaptorContainer, vtkAssociativeContainer, vtkObjectBaseDeque, vtkObjectBaseHashMap, vtkObjectBaseList, vtkObjectBaseMap, vtkObjectBasePriorityQueue, vtkObjectBaseQueue, vtkObjectBaseSet, vtkObjectBaseStack, vtkObjectBaseVector, vtkObjectDeque, vtkObjectHashMap, vtkObjectList, vtkObjectMap, vtkObjectPriorityQueue, vtkObjectQueue, vtkObjectSet, vtkObjectStack, vtkObjectVector, and vtkSequenceContainer.

void vtkContainer::Register (  vtkObjectBase *   )  [virtual]
 

Increase the reference count (mark as used by another object).

Reimplemented from vtkObject.

virtual int vtkContainer::Swap (  vtkContainer *  container  )  [pure virtual]
 

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

Returns:
true on success, otherwise false.

void vtkContainer::UnRegister (  vtkObjectBase *   )  [virtual]
 

Decrease the reference count (release by another object).

Reimplemented from vtkObject.

vtkContainer::vtkTypeRevisionMacro (  vtkContainer  ,
vtkObject 
) 
 


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