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

vtkObjectBaseVector Class Reference

#include <vtkObjectBaseVector.h>

Inheritance diagram for vtkObjectBaseVector:

Inheritance graph
[legend]
Collaboration diagram for vtkObjectBaseVector:

Collaboration graph
[legend]
List of all members.

Detailed Description

A vector container for objects.

A vector is a Sequence that supports random access to items, constant time insertion and removal of items at the end, and linear time insertion and removal of items at the beginning or in the middle. The number of items in a vector may vary dynamically; memory management is automatic. Vector is the simplest of the container classes, and in many cases the most efficient.

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

Definition at line 40 of file vtkObjectBaseVector.h.

Public Member Functions

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

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

vtkObjectBaseVectorIterator * CreateIterator (void)
 Create an iterator.

Vector Operations
virtual vtkObjectBase * At (vtkIdType position) const
 Provides access by index to the objects contained in this sequence.

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

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

virtual int Insert (vtkIdType position, vtkObjectBaseVector *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 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 ..

void Reserve (vtkIdType capacity)
 Enlarge the capacity of this vector.

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

int PopFront (void)
 Removes the first item of the 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 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.

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
vtkObjectBase * Front (void) const
 Returns the first item in the container, or null if the container is empty.

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


Static Public Member Functions

vtkObjectBaseVector * New (void)

Protected Member Functions

 vtkObjectBaseVector (void)
 ~vtkObjectBaseVector ()
void ReportReferences (vtkGarbageCollector *)

Friends

class vtkObjectBaseVectorIterator


Constructor & Destructor Documentation

vtkObjectBaseVector::vtkObjectBaseVector (  void   )  [protected]
 

vtkObjectBaseVector::~vtkObjectBaseVector (   )  [protected]
 


Member Function Documentation

virtual int vtkObjectBaseVector::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* vtkObjectBaseVector::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 vtkObjectVector.

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

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectVector.

int vtkObjectBaseVector::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 vtkObjectBaseVector::Clear (  void   )  [virtual]
 

Erase ALL items in the container.

Returns:
true on success, false otherwise.

Implements vtkContainer.

virtual int vtkObjectBaseVector::Copy (  vtkObjectBaseVector *  container  )  [virtual]
 

Copy all items from the specified container into this container.

Returns:
true on success, otherwise false.

vtkObjectBaseVectorIterator* vtkObjectBaseVector::CreateIterator (  void   )  [virtual]
 

Create an iterator.

Implements vtkSequenceContainer.

Reimplemented in vtkObjectVector.

int vtkObjectBaseVector::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 vtkObjectBaseVector::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 vtkObjectBaseVector::Erase (  vtkIdType  position  )  [virtual]
 

Remove the item at the given position.

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

Implements vtkSequenceContainer.

vtkIdType vtkObjectBaseVector::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* vtkObjectBaseVector::Front (  void   )  const [virtual]
 

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectVector.

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

Returns the maximum size of this container.

Reimplemented from vtkContainer.

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

Returns the number of items in the container.

Reimplemented from vtkContainer.

virtual int vtkObjectBaseVector::Insert (  vtkIdType  position,
vtkObjectBaseVector *  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.
Warning:
This may invalidate iterators.
Returns:
true on success, false otherwise.

virtual int vtkObjectBaseVector::Insert (  vtkIdType  position,
vtkObjectBaseVector *  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.
Warning:
This may invalidate iterators.
Returns:
true on success, false otherwise.

virtual int vtkObjectBaseVector::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.
Warning:
This may invalidate iterators.
Returns:
true on success, false otherwise.

Implements vtkSequenceContainer.

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

Returns true if this container is empty.

Reimplemented from vtkContainer.

vtkObjectBaseVector* vtkObjectBaseVector::New (  void   )  [static]
 

Reimplemented from vtkObject.

Reimplemented in vtkObjectVector.

int vtkObjectBaseVector::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 vtkObjectBaseVector::PopFront (  void   )  [virtual]
 

Removes the first item of the sequence.

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

This is NOT a typical vector operation. The function is implemented as an item erase at the front of the sequence and is very inefficient compared to a list or deque.

Implements vtkSequenceContainer.

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

Reimplemented from vtkSequenceContainer.

Reimplemented in vtkObjectVector.

virtual int vtkObjectBaseVector::PushBack (  vtkObjectBase *  item  )  [virtual]
 

Add an item to the end of this sequence.

Parameters:
item the object to be added.

Implements vtkSequenceContainer.

virtual int vtkObjectBaseVector::PushFront (  vtkObjectBase *  item  )  [virtual]
 

Add an item to the front of this sequence.

Parameters:
item the object to be added.
Note:
This is NOT a typical vector operation. The function is implemented as an item insertion at the front of the sequence and is very inefficient compared to a list or deque.

Implements vtkSequenceContainer.

void vtkObjectBaseVector::ReportReferences (  vtkGarbageCollector *   )  [protected]
 

void vtkObjectBaseVector::Reserve (  vtkIdType  capacity  ) 
 

Enlarge the capacity of this vector.

int vtkObjectBaseVector::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 vtkObjectBaseVector::Reverse (  void   )  [virtual]
 

Reverse the sequence ordering.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

int vtkObjectBaseVector::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 vtkObjectBaseVector::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 vtkObjectBaseVector::Sort (  void   )  [virtual]
 

Sort the sequence items by address with operator <.

Returns:
true on success, otherwise false.

Implements vtkSequenceContainer.

virtual int vtkObjectBaseVector::Swap (  vtkObjectBaseVector *  container  )  [virtual]
 

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

Returns:
true on success, otherwise false.

int vtkObjectBaseVector::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.

vtkObjectBaseVector::vtkTypeRevisionMacro (  vtkObjectBaseVector  ,
vtkSequenceContainer 
) 
 


Friends And Related Function Documentation

friend class vtkObjectBaseVectorIterator [friend]
 

Definition at line 284 of file vtkObjectBaseVector.h.


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