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

vtkObjectBaseList Class Reference

#include <vtkObjectBaseList.h>

Inheritance diagram for vtkObjectBaseList:

Inheritance graph
[legend]
Collaboration diagram for vtkObjectBaseList:

Collaboration graph
[legend]
List of all members.

Detailed Description

A list container for objects.

A list is a doubly linked list. That is, it is a Sequence that supports both forward and backward traversal, and (amortized) constant time insertion and removal of items at the beginning or the end, or in the middle. Lists have the important property that insertion and splicing do not invalidate iterators to list items, and that even removal invalidates only the iterators that point to the items that are removed. The ordering of iterators may be changed (that is, a given iterator might have a different predecessor or successor after a list operation than it did before), but the iterators themselves will not be invalidated or made to point to different items unless that invalidation or mutation is explicit.

Author:
Sean McInerney
Version:
Revision
1.4
Date:
Date
2005/06/24 23:17:16
See also:
vtkObjectBase

Definition at line 45 of file vtkObjectBaseList.h.

Public Member Functions

 vtkTypeRevisionMacro (vtkObjectBaseList, vtkSequenceContainer)
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 (vtkObjectBaseList *container)
 Swaps items of this container with those of the specified container.

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

vtkObjectBaseListIteratorCreateIterator (void)
 Create an iterator.

List Operations
virtual int Insert (vtkIdType position, vtkObjectBase *item)
 Inserts an item into this sequence at the specified position.

virtual int Insert (vtkIdType position, vtkObjectBaseList *sequence)
 Inserts copies of all items in the source sequence into this sequence at the specified position.

virtual int Insert (vtkIdType position, vtkObjectBaseList *sequence, vtkIdType seqBeg, vtkIdType seqEnd)
 Inserts copies of the range [srcBeg ..

virtual int Assign (vtkIdType position, vtkObjectBase *item)
 Assigns item to the specified position replacing the existant item.

virtual int PushFront (vtkObjectBase *item)
 Add an item to the front of this sequence.

int PopFront (void)
 Removes the first item of this sequence.

virtual int PushBack (vtkObjectBase *item)
 Add an item to the end of this sequence.

int PopBack (void)
 Removes the last item of the sequence.

int Erase (vtkIdType position)
 Remove the item at the given position.

int Erase (vtkIdType pos1, vtkIdType pos2)
 Remove the items in the given range [pos1 ..

int Reverse (void)
 Reverse the sequence ordering.

int Reverse (vtkIdType pos1, vtkIdType pos2)
 Reverse the sequence ordering in the given range [pos1 ..

int Sort (void)
 Sort the sequence items by address with operator <.

int Unique (void)
 Removes subsequent duplicates of sequence items so that each item contains a different value than the following item.

virtual int Splice (vtkIdType dstPos, vtkObjectBaseList *src)
 Moves all items of the source list src into this list and inserts them at position dstPos.

virtual int Splice (vtkIdType dstPos, vtkObjectBaseList *src, vtkIdType srcPos)
 Moves the item at position srcPos of the source list src into this list and inserts it at position dstPos.

virtual int Splice (vtkIdType dstPos, vtkObjectBaseList *src, vtkIdType srcBeg, vtkIdType srcEnd)
 Moves the items of the range [srcBeg, srcEnd] of the source list src into this list and inserts them at position dstPos.

virtual int Merge (vtkObjectBaseList *src)
 The items of list src are merged with this list.

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

int Erase (vtkObjectBase *item)
 Remove the first occurence of the given item from the sequence.

int Clear (vtkObjectBase *item)
 Remove all occurrences of the given item from the sequence.

vtkIdType Find (vtkObjectBase *item) const
 Find the first occurence of an item in the sequence.

int Rotate (vtkIdType index)
 Rotates the items in this sequence so that index is the new first element after the call.

int Shuffle (void)
 Shuffles the order of the items in this sequence using a uniform distribution random number generator.

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

vtkObjectBaseBack (void) const
 Returns the last item in the container, or null if the container is empty.


Static Public Member Functions

vtkObjectBaseListNew (void)

Protected Member Functions

 vtkObjectBaseList (void)
 ~vtkObjectBaseList ()
void ReportReferences (vtkGarbageCollector *)

Friends

class vtkObjectBaseListIterator


Constructor & Destructor Documentation

vtkObjectBaseList::vtkObjectBaseList void   )  [protected]
 

vtkObjectBaseList::~vtkObjectBaseList  )  [protected]
 


Member Function Documentation

virtual int vtkObjectBaseList::Assign vtkIdType  position,
vtkObjectBase item
[virtual]
 

Assigns item to the specified position replacing the existant item.

Returns:
true if the item can be set, otherwise false.

Implements vtkSequenceContainer.

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

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

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

Reimplemented from vtkSequenceContainer.

Reimplemented in vtkObjectList.

vtkObjectBase* vtkObjectBaseList::Back void   )  const [virtual]
 

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectList.

int vtkObjectBaseList::Clear vtkObjectBase item  )  [virtual]
 

Remove all occurrences of the given item from the sequence.

Returns:
true if an item was removed, otherwise false.

Implements vtkSequenceContainer.

virtual int vtkObjectBaseList::Clear void   )  [virtual]
 

Erase ALL items in the container.

Returns:
true on success, false otherwise.

Implements vtkContainer.

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

Copy all items from the specified container into this container.

Returns:
true on success, otherwise false.

vtkObjectBaseListIterator* vtkObjectBaseList::CreateIterator void   )  [virtual]
 

Create an iterator.

Implements vtkSequenceContainer.

Reimplemented in vtkObjectList.

int vtkObjectBaseList::Erase vtkObjectBase item  )  [virtual]
 

Remove the first occurence of the given item from the sequence.

Returns:
true if an item was removed, otherwise false.

Implements vtkSequenceContainer.

int vtkObjectBaseList::Erase vtkIdType  pos1,
vtkIdType  pos2
[virtual]
 

Remove the items in the given range [pos1 ..

pos2] of positions.

Returns:
true if an item was removed, otherwise false.

Implements vtkSequenceContainer.

int vtkObjectBaseList::Erase vtkIdType  position  )  [virtual]
 

Remove the item at the given position.

Returns:
true if an item was removed, otherwise false.

Implements vtkSequenceContainer.

vtkIdType vtkObjectBaseList::Find vtkObjectBase item  )  const [virtual]
 

Find the first occurence of an item in the sequence.

Returns:
the item index if found, otherwise -1.

Reimplemented from vtkSequenceContainer.

vtkObjectBase* vtkObjectBaseList::Front void   )  const [virtual]
 

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectList.

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

Returns the maximum size of this container.

Reimplemented from vtkContainer.

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

Returns the number of items in the container.

Reimplemented from vtkContainer.

virtual int vtkObjectBaseList::Insert vtkIdType  position,
vtkObjectBaseList sequence,
vtkIdType  seqBeg,
vtkIdType  seqEnd
[virtual]
 

Inserts copies of the range [srcBeg ..

srcEnd] in the source sequence into this sequence at the specified position.

Parameters:
position An index into the sequence.
sequence A source sequence to be inserted.
seqBeg The index of the first item to copy.
seqEnd The index of the last item to copy.
Note:
Any items in the sequence at a location greater than or equal to position will be shifted by number of items in the source sequence to make room for the inserted items.

This should not invalidate iterators.

Returns:
true on success, false otherwise.

virtual int vtkObjectBaseList::Insert vtkIdType  position,
vtkObjectBaseList sequence
[virtual]
 

Inserts copies of all items in the source sequence into this sequence at the specified position.

Parameters:
position An index into the sequence.
sequence A source sequence to be inserted.
Note:
Any items in the sequence at a location greater than or equal to position will be shifted by number of items in the source sequence to make room for the inserted items.

This should not invalidate iterators.

Returns:
true on success, false otherwise.

virtual int vtkObjectBaseList::Insert vtkIdType  position,
vtkObjectBase item
[virtual]
 

Inserts an item into this sequence at the specified position.

Parameters:
position An index into the sequence.
item Data to be inserted.
Note:
Any items in the sequence at a location greater than or equal to position will be shifted by one position to make room for the inserted item.

This should not invalidate iterators.

Returns:
true on success, false otherwise.

Implements vtkSequenceContainer.

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

Returns true if this container is empty.

Reimplemented from vtkContainer.

virtual int vtkObjectBaseList::Merge vtkObjectBaseList src  )  [virtual]
 

The items of list src are merged with this list.

Both lists are sorted on entry to the internal merge method and the resulting list is also sorted.

Note:
The source list src is empty after the call.
Returns:
true on success, otherwise false.

vtkObjectBaseList* vtkObjectBaseList::New void   )  [static]
 

Reimplemented from vtkObject.

Reimplemented in vtkObjectList.

int vtkObjectBaseList::PopBack void   )  [virtual]
 

Removes the last item of the sequence.

Note:
No data is returned. If the last item is needed, it should be retrieved before calling PopBack.

Implements vtkSequenceContainer.

int vtkObjectBaseList::PopFront void   )  [virtual]
 

Removes the first item of this sequence.

Note:
No data is returned. If the first item is needed, it should be retrieved before calling PopFront.

Implements vtkSequenceContainer.

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

Reimplemented from vtkSequenceContainer.

Reimplemented in vtkObjectList.

virtual int vtkObjectBaseList::PushBack vtkObjectBase item  )  [virtual]
 

Add an item to the end of this sequence.

Parameters:
item the object to be added.

Implements vtkSequenceContainer.

virtual int vtkObjectBaseList::PushFront vtkObjectBase item  )  [virtual]
 

Add an item to the front of this sequence.

Parameters:
item the object to be added.

Implements vtkSequenceContainer.

void vtkObjectBaseList::ReportReferences vtkGarbageCollector *   )  [protected]
 

int vtkObjectBaseList::Reverse vtkIdType  pos1,
vtkIdType  pos2
[virtual]
 

Reverse the sequence ordering in the given range [pos1 ..

pos2] of positions.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

int vtkObjectBaseList::Reverse void   )  [virtual]
 

Reverse the sequence ordering.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

int vtkObjectBaseList::Rotate vtkIdType  index  )  [virtual]
 

Rotates the items in this sequence so that index is the new first element after the call.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

int vtkObjectBaseList::Shuffle void   )  [virtual]
 

Shuffles the order of the items in this sequence using a uniform distribution random number generator.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

int vtkObjectBaseList::Sort void   )  [virtual]
 

Sort the sequence items by address with operator <.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

virtual int vtkObjectBaseList::Splice vtkIdType  dstPos,
vtkObjectBaseList src,
vtkIdType  srcBeg,
vtkIdType  srcEnd
[virtual]
 

Moves the items of the range [srcBeg, srcEnd] of the source list src into this list and inserts them at position dstPos.

Warning:
If the source list src and this list are identical, the destination position dstPos must not be within the moved range.
Note:
If the source list src and this list are identical, the items are moved inside this list, otherwise the source list contains less items after this operation.
Returns:
true on success, otherwise false.

virtual int vtkObjectBaseList::Splice vtkIdType  dstPos,
vtkObjectBaseList src,
vtkIdType  srcPos
[virtual]
 

Moves the item at position srcPos of the source list src into this list and inserts it at position dstPos.

Note:
If the source list src and this list are identical, the item is moved inside this list, otherwise the source list contains one less item after this operation.
Returns:
true on success, otherwise false.

virtual int vtkObjectBaseList::Splice vtkIdType  dstPos,
vtkObjectBaseList src
[virtual]
 

Moves all items of the source list src into this list and inserts them at position dstPos.

Warning:
If the source list src and this list are identical, the internal splice method is undefined and results in failure.
Note:
The source list src is empty after the call.
Returns:
true on success, otherwise false.

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

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

Returns:
true on success, otherwise false.

int vtkObjectBaseList::Unique void   )  [virtual]
 

Removes subsequent duplicates of sequence items so that each item contains a different value than the following item.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

vtkObjectBaseList::vtkTypeRevisionMacro vtkObjectBaseList  ,
vtkSequenceContainer 
 


Friends And Related Function Documentation

friend class vtkObjectBaseListIterator [friend]
 

Definition at line 333 of file vtkObjectBaseList.h.


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