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

vtkAbstractSequence Class Reference

#include <vtkAbstractSequence.h>

Inheritance diagram for vtkAbstractSequence:

Inheritance graph
[legend]
Collaboration diagram for vtkAbstractSequence:

Collaboration graph
[legend]
List of all members.

Detailed Description

Abstract sequence object for objects.

Calls Register when objects are inserted into the sequence and UnRegister when the object is removed.

Author:
Sean McInerney
Version:
Revision
1.2
Date:
Date
2004/06/03 18:58:28
See also:
vtkContainer vtkObjectBase

Definition at line 36 of file vtkAbstractSequence.h.

Public Types

typedef int(* CompareFunction )(const vtkObjectBase *&a1, const vtkObjectBase *&a2)

Public Member Functions

 vtkTypeRevisionMacro (vtkAbstractSequence, vtkContainer)
void PrintSelf (ostream &, vtkIndent)
virtual int Swap (vtkAbstractSequence *container)=0
 Swaps elements of this object with those of the specified container.

virtual vtkIdType GetCapacity (void) const
 Returns the total number of elements that the map can hold before needing to allocate more memory.

virtual int SetCapacity (vtkIdType capacity)=0
 Set the capacity of the sequence.

virtual vtkObjectBaseAt (vtkIdType position) const
 Provides access to the data contained in this sequence.

virtual vtkIdType Find (const vtkObjectBase *object) const
 Find an object in the sequence.

virtual vtkIdType Find (const vtkObjectBase *object, CompareFunction comparison) const
 Find an object in the sequence using a comparison routine.

virtual int IsPresent (const vtkObjectBase *object) const
 Find an object in the vector.

virtual int Insert (vtkIdType position, vtkObjectBase *object)=0
 Inserts a pointer to an object into before the specified position.

virtual int Insert (vtkIdType position, vtkAbstractSequence *sequence)
 Insert a sequence at the specific position in this sequence.

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

int PopFront (void)
 Removes the first element of the sequence.

virtual int PushBack (vtkObjectBase *object)=0
 Add a pointer to an object to the end of this sequence.

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

virtual int PushBack (vtkAbstractSequence *sequence)
 Append a sequence to the end of this sequence.

virtual int Assign (vtkIdType position, vtkObjectBase *object)=0
 Sets the object at the specific position to a new value.

virtual int Erase (vtkIdType position)=0
 Remove element at the given position.

void DebugSequence (ostream &stream)
 Display the contents of the sequence.

virtual vtkAbstractSequenceIteratorCreateIterator (void)=0
 Create an iterator.


Protected Member Functions

 vtkAbstractSequence (void)
 ~vtkAbstractSequence ()


Member Typedef Documentation

typedef int(* vtkAbstractSequence::CompareFunction)(const vtkObjectBase *&a1, const vtkObjectBase *&a2)
 

Definition at line 44 of file vtkAbstractSequence.h.


Constructor & Destructor Documentation

vtkAbstractSequence::vtkAbstractSequence void   )  [inline, protected]
 

Definition at line 202 of file vtkAbstractSequence.h.

vtkAbstractSequence::~vtkAbstractSequence  )  [inline, protected]
 

Definition at line 203 of file vtkAbstractSequence.h.


Member Function Documentation

virtual int vtkAbstractSequence::Assign vtkIdType  position,
vtkObjectBase object
[pure virtual]
 

Sets the object at the specific position to a new value.

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

Implemented in vtkObjectBaseVector.

vtkObjectBase * vtkAbstractSequence::At vtkIdType  position  )  const [inline, virtual]
 

Provides access to the data contained in this sequence.

Parameters:
position The element index for which data should be accessed.
Returns:
A Read/write pointer to the object if position is a valid index, otherwise null.

Reimplemented in vtkExtensionsObjectVector, vtkObjectBaseVector, and vtkObjectVector.

Definition at line 233 of file vtkAbstractSequence.h.

References At().

Referenced by At(), Insert(), and PushBack().

virtual vtkAbstractSequenceIterator* vtkAbstractSequence::CreateIterator void   )  [pure virtual]
 

Create an iterator.

Implements vtkContainer.

Implemented in vtkExtensionsObjectVector, vtkObjectBaseVector, and vtkObjectVector.

void vtkAbstractSequence::DebugSequence ostream &  stream  ) 
 

Display the contents of the sequence.

virtual int vtkAbstractSequence::Erase vtkIdType  position  )  [pure virtual]
 

Remove element at the given position.

Parameters:
position An index to the element to be erased.
This function will erase the element at the given position and thus shorten the sequence by one.

Implemented in vtkObjectBaseVector.

Referenced by Insert(), PopBack(), and PopFront().

vtkIdType vtkAbstractSequence::Find const vtkObjectBase object,
CompareFunction  comparison
const [inline, virtual]
 

Find an object in the sequence using a comparison routine.

Returns:
true if it was found, false if it was not found.

Reimplemented in vtkObjectBaseVector.

Definition at line 245 of file vtkAbstractSequence.h.

References Find().

vtkIdType vtkAbstractSequence::Find const vtkObjectBase object  )  const [inline, virtual]
 

Find an object in the sequence.

Returns:
The position if it was found, -1 if it was not found.

Reimplemented in vtkObjectBaseVector.

Definition at line 239 of file vtkAbstractSequence.h.

References Find().

Referenced by Find(), and IsPresent().

vtkIdType vtkAbstractSequence::GetCapacity void   )  const [inline, virtual]
 

Returns the total number of elements that the map can hold before needing to allocate more memory.

Reimplemented in vtkObjectBaseVector.

Definition at line 227 of file vtkAbstractSequence.h.

int vtkAbstractSequence::Insert vtkIdType  position,
vtkAbstractSequence sequence
[inline, virtual]
 

Insert a sequence at the specific position in this sequence.

Any objects in the vector at a location greater than position will be shifted by the size of the sequence to make room for the inserted elements.

Parameters:
position An index into the vector.
sequence The sequence containing data to be inserted.
Warning:
This can not be used with SetCapacity() because there will be no room for the additional elements.
Returns:
true on success, false otherwise.

Definition at line 258 of file vtkAbstractSequence.h.

References At(), Erase(), vtkContainer::GetSize(), Insert(), VTK_FALSE, and VTK_TRUE.

virtual int vtkAbstractSequence::Insert vtkIdType  position,
vtkObjectBase object
[pure virtual]
 

Inserts a pointer to an object into before the specified position.

Any objects in the sequence at a location greater than position will be shifted by one position to make room for the inserted object.

Parameters:
position An index into the sequence.
object Data to be inserted.
Warning:
This can not be used with SetCapacity() because there will be no room for the additional object.
Returns:
true on success, false otherwise.

Implemented in vtkObjectBaseVector.

Referenced by Insert(), and PushFront().

int vtkAbstractSequence::IsPresent const vtkObjectBase object  )  const [inline, virtual]
 

Find an object in the vector.

Returns:
true if it was found, otherwise false.

Definition at line 252 of file vtkAbstractSequence.h.

References Find(), IsPresent(), VTK_FALSE, and VTK_TRUE.

Referenced by IsPresent().

int vtkAbstractSequence::PopBack void   )  [inline]
 

Removes the last element of the sequence.

This is a typical stack operation. It shrinks the sequence by one.

Note:
No data is returned, and if the last element's data is needed, it should be retrieved before PopBack() is called.

Definition at line 289 of file vtkAbstractSequence.h.

References Erase().

Referenced by PushBack().

int vtkAbstractSequence::PopFront void   )  [inline]
 

Removes the first element of the sequence.

This is a typical stack operation. It shrinks the sequence by one.

Note:
No data is returned, and if the first element's data is needed, it should be retrieved before PopFront() is called.

Definition at line 283 of file vtkAbstractSequence.h.

References Erase().

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectBaseVector.

int vtkAbstractSequence::PushBack vtkAbstractSequence sequence  )  [inline, virtual]
 

Append a sequence to the end of this sequence.

Parameters:
sequence The sequence containing data to be appended.
Warning:
This can not be used with SetCapacity() because there will be no room for the additional elements.
Returns:
true on success, false otherwise.

Definition at line 295 of file vtkAbstractSequence.h.

References At(), vtkContainer::GetSize(), PopBack(), PushBack(), VTK_FALSE, and VTK_TRUE.

virtual int vtkAbstractSequence::PushBack vtkObjectBase object  )  [pure virtual]
 

Add a pointer to an object to the end of this sequence.

Parameters:
object Data to be added.
This is a typical stack operation. The function creates an element at the end of the sequence and assigns the given pointer to it.

Implemented in vtkObjectBaseVector.

Referenced by PushBack().

int vtkAbstractSequence::PushFront vtkObjectBase object  )  [inline, virtual]
 

Add a pointer to an object to the front of this sequence.

Parameters:
object Data to be added.
This is a typical stack operation. The function creates an element at the front of the sequence and assigns the given data to it.

Definition at line 277 of file vtkAbstractSequence.h.

References Insert(), and PushFront().

Referenced by PushFront().

virtual int vtkAbstractSequence::SetCapacity vtkIdType  capacity  )  [pure virtual]
 

Set the capacity of the sequence.

Returns:
true if successful, false otherwise.
Note:
If capacity is set, the sequence will no longer automatically resize.

Implemented in vtkObjectBaseVector.

virtual int vtkAbstractSequence::Swap vtkAbstractSequence container  )  [pure virtual]
 

Swaps elements of this object with those of the specified container.

Returns:
true on success, otherwise false.

vtkAbstractSequence::vtkTypeRevisionMacro vtkAbstractSequence  ,
vtkContainer 
 


The documentation for this class was generated from the following file:
Generated on Tue Aug 10 03:41:57 2004 for vtkExtensions by doxygen 1.3.7