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

vtkUniqueCollection Class Reference

#include <vtkUniqueCollection.h>

Inheritance diagram for vtkUniqueCollection:

Inheritance graph
[legend]
Collaboration diagram for vtkUniqueCollection:

Collaboration graph
[legend]
List of all members.

Detailed Description

A collection of unique items.

vtkUniqueCollection represents and provides methods to manipulate a list of items (i.e., vtkObject and subclasses). The list is unsorted, but does prevent duplicate entries. If items are being appended, prepended, inserted or replacing, they are first removed from any previously occupied position in the collection.

Author:
Sean McInerney
Version:
Revision
1.7
Date:
Date
2004/08/10 07:37:21
See also:
vtkCollection vtkObject

Definition at line 41 of file vtkUniqueCollection.h.

Public Member Functions

 vtkTypeRevisionMacro (vtkUniqueCollection, vtkCollection)
void PrintSelf (ostream &, vtkIndent)
void AddItem (vtkObject *item)
 Add a node to the list.

int IndexOf (vtkObject *item)
 Returns the index of the node in the list or -1 if not found.

vtkObjectGetNextItem (void)
 Get the next node in the list.

vtkObjectGetItem (int i)
 Get the i'th node in the list.

vtkObjectGetFirstItem (void)
 Get the first node in the list.

vtkObjectGetLastItem (void)
 Get the last node in the list.

int PrependItem (vtkObject *item)
 Insert a node to the front of the list.

int AppendItem (vtkObject *item)
 Append a node to the end of the list.

int InsertItemAt (vtkObject *item, int i)
 Insert node at the i'th position.

int GetNumberOfItemsByType (const char *type)
 Return number of objects in the list that are derived from type.

vtkObjectInitTraversalByType (const char *type)
 Initialize traversal over items derived from type, returning first.

vtkObjectGetNthItemByType (int n, const char *type)
 Return n'th item in the list derived from type.

vtkObjectGetNextItemByType (const char *type)
 Return next item in the list derived from type.

virtual unsigned long GetMTime (void)
 Override standard GetMTime() to check for modified times of the nodes.

virtual void SetCheckUnique (int)
 Toggle enforcement of uniquity among collection items (default is TRUE).

virtual int GetCheckUnique ()
 Toggle enforcement of uniquity among collection items (default is TRUE).

virtual void CheckUniqueOn ()
 Toggle enforcement of uniquity among collection items (default is TRUE).

virtual void CheckUniqueOff ()
 Toggle enforcement of uniquity among collection items (default is TRUE).

void ReplaceItem (int i, vtkObject *item, vtkObject **ret)
 Replace the i'th node in the list with item.

void ReplaceItem (int i, vtkObject *item)
 Replace the i'th node in the list with item.

void RemoveItem (int i, vtkObject **ret)
 Remove the i'th item in the list.

void RemoveItem (int i)
 Remove the i'th item in the list.

void RemoveItem (vtkObject *item, vtkObject **ret)
 Remove item from the list.

void RemoveItem (vtkObject *item)
 Remove item from the list.

void RemoveLastItem (vtkObject **removed)
 Remove the last node in the list (like a stack pop).

void RemoveLastItem (void)
 Remove the last node in the list (like a stack pop).


Static Public Member Functions

vtkUniqueCollectionNew (void)

Protected Member Functions

 vtkUniqueCollection (void)
 ~vtkUniqueCollection ()
vtkCollectionElementFindCollectionElementAt (int i)

Protected Attributes

int CheckUnique


Constructor & Destructor Documentation

vtkUniqueCollection::vtkUniqueCollection void   )  [inline, protected]
 

Definition at line 167 of file vtkUniqueCollection.h.

vtkUniqueCollection::~vtkUniqueCollection  )  [inline, protected]
 

Definition at line 168 of file vtkUniqueCollection.h.


Member Function Documentation

void vtkUniqueCollection::AddItem vtkObject item  )  [inline]
 

Add a node to the list.

Reimplemented from vtkCollection.

Definition at line 193 of file vtkUniqueCollection.h.

References AddItem(), and CheckUnique.

Referenced by AddItem().

int vtkUniqueCollection::AppendItem vtkObject item  )  [inline]
 

Append a node to the end of the list.

Definition at line 348 of file vtkUniqueCollection.h.

References AppendItem(), IndexOf(), vtkCollectionElement::Item, vtkObject::Modified(), vtkCollectionElement::Next, PrependItem(), vtkObject::Register(), RemoveItem(), VTK_ERROR, and VTK_OK.

Referenced by AppendItem(), and InsertItemAt().

virtual void vtkUniqueCollection::CheckUniqueOff  )  [virtual]
 

Toggle enforcement of uniquity among collection items (default is TRUE).

virtual void vtkUniqueCollection::CheckUniqueOn  )  [virtual]
 

Toggle enforcement of uniquity among collection items (default is TRUE).

vtkCollectionElement * vtkUniqueCollection::FindCollectionElementAt int  i  )  [inline, protected]
 

Definition at line 402 of file vtkUniqueCollection.h.

References FindCollectionElementAt(), and vtkCollectionElement::Next.

Referenced by FindCollectionElementAt(), and InsertItemAt().

virtual int vtkUniqueCollection::GetCheckUnique  )  [virtual]
 

Toggle enforcement of uniquity among collection items (default is TRUE).

vtkObject * vtkUniqueCollection::GetFirstItem void   )  [inline]
 

Get the first node in the list.

Reimplemented in vtkExtensionsObjectCollection.

Definition at line 279 of file vtkUniqueCollection.h.

References vtkCollectionElement::Item.

vtkObject * vtkUniqueCollection::GetItem int  i  )  [inline]
 

Get the i'th node in the list.

Returns:
A pointer to the specified item or null if i is out of range.

Reimplemented in vtkExtensionsObjectCollection.

Definition at line 274 of file vtkUniqueCollection.h.

References GetItem().

Referenced by GetItem(), and RemoveItem().

vtkObject * vtkUniqueCollection::GetLastItem void   )  [inline]
 

Get the last node in the list.

Reimplemented in vtkExtensionsObjectCollection.

Definition at line 284 of file vtkUniqueCollection.h.

References vtkCollectionElement::Item.

unsigned long vtkUniqueCollection::GetMTime void   )  [inline, virtual]
 

Override standard GetMTime() to check for modified times of the nodes.

Reimplemented from vtkObject.

Definition at line 559 of file vtkUniqueCollection.h.

References vtkObject::GetMTime(), GetNextItem(), and vtkCollection::InitTraversal().

vtkObject * vtkUniqueCollection::GetNextItem void   )  [inline]
 

Get the next node in the list.

Returns:
A pointer to the next object or null when the collection is exhausted.

Reimplemented in vtkExtensionsObjectCollection.

Definition at line 269 of file vtkUniqueCollection.h.

References vtkCollection::GetNextItemAsObject().

Referenced by GetMTime().

vtkObject * vtkUniqueCollection::GetNextItemByType const char *  type  )  [inline]
 

Return next item in the list derived from type.

Definition at line 506 of file vtkUniqueCollection.h.

References GetNextItemByType(), vtkObject::IsA(), vtkCollectionElement::Item, and vtkCollectionElement::Next.

Referenced by GetNextItemByType().

vtkObject * vtkUniqueCollection::GetNthItemByType int  n,
const char *  type
[inline]
 

Return n'th item in the list derived from type.

Definition at line 540 of file vtkUniqueCollection.h.

References GetNthItemByType(), vtkObject::IsA(), vtkCollectionElement::Item, and vtkCollectionElement::Next.

Referenced by GetNthItemByType().

int vtkUniqueCollection::GetNumberOfItemsByType const char *  type  )  [inline]
 

Return number of objects in the list that are derived from type.

Definition at line 491 of file vtkUniqueCollection.h.

References GetNumberOfItemsByType(), vtkObject::IsA(), vtkCollectionElement::Item, and vtkCollectionElement::Next.

Referenced by GetNumberOfItemsByType().

int vtkUniqueCollection::IndexOf vtkObject item  )  [inline]
 

Returns the index of the node in the list or -1 if not found.

Definition at line 264 of file vtkUniqueCollection.h.

References IndexOf().

Referenced by AppendItem(), IndexOf(), InsertItemAt(), and PrependItem().

vtkObject * vtkUniqueCollection::InitTraversalByType const char *  type  )  [inline]
 

Initialize traversal over items derived from type, returning first.

Definition at line 524 of file vtkUniqueCollection.h.

References InitTraversalByType(), vtkObject::IsA(), vtkCollectionElement::Item, and vtkCollectionElement::Next.

Referenced by InitTraversalByType().

int vtkUniqueCollection::InsertItemAt vtkObject item,
int  i
[inline]
 

Insert node at the i'th position.

Definition at line 420 of file vtkUniqueCollection.h.

References AppendItem(), FindCollectionElementAt(), IndexOf(), InsertItemAt(), vtkCollectionElement::Item, vtkObject::Modified(), vtkCollectionElement::Next, PrependItem(), vtkObject::Register(), RemoveItem(), VTK_ERROR, and VTK_OK.

Referenced by InsertItemAt().

vtkUniqueCollection* vtkUniqueCollection::New void   )  [static]
 

Reimplemented from vtkCollection.

Reimplemented in vtkExtensionsObjectCollection.

int vtkUniqueCollection::PrependItem vtkObject item  )  [inline]
 

Insert a node to the front of the list.

Definition at line 294 of file vtkUniqueCollection.h.

References IndexOf(), vtkCollectionElement::Item, vtkObject::Modified(), vtkCollectionElement::Next, PrependItem(), vtkObject::Register(), RemoveItem(), VTK_ERROR, and VTK_OK.

Referenced by AppendItem(), InsertItemAt(), and PrependItem().

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

Reimplemented from vtkCollection.

Reimplemented in vtkExtensionsObjectCollection.

void vtkUniqueCollection::RemoveItem vtkObject item  )  [inline]
 

Remove item from the list.

Removes the first object found, not all occurrences. If no object found, list is unaffected. See warning in description of RemoveItem(int).

Note:
The removed item may be returned in optional second call parameter.

Reimplemented from vtkCollection.

Definition at line 102 of file vtkUniqueCollection.h.

void vtkUniqueCollection::RemoveItem vtkObject item,
vtkObject **  ret
[inline]
 

Remove item from the list.

Removes the first object found, not all occurrences. If no object found, list is unaffected. See warning in description of RemoveItem(int).

Note:
The removed item may be returned in optional second call parameter.

Definition at line 250 of file vtkUniqueCollection.h.

References vtkObject::Register(), and RemoveItem().

void vtkUniqueCollection::RemoveItem int  i  )  [inline]
 

Remove the i'th item in the list.

Warning:
Be careful if using this function during traversal of the list using GetNextItem. The list WILL be shortened if a valid index is given!
Note:
The removed item may be returned in optional second call parameter.

Reimplemented from vtkCollection.

Reimplemented in vtkExtensionsObjectCollection.

Definition at line 85 of file vtkUniqueCollection.h.

void vtkUniqueCollection::RemoveItem int  i,
vtkObject **  ret
[inline]
 

Remove the i'th item in the list.

Warning:
Be careful if using this function during traversal of the list using GetNextItem. The list WILL be shortened if a valid index is given!
Note:
The removed item may be returned in optional second call parameter.

Definition at line 234 of file vtkUniqueCollection.h.

References GetItem(), vtkObject::Register(), and RemoveItem().

Referenced by AppendItem(), InsertItemAt(), PrependItem(), RemoveItem(), and RemoveLastItem().

void vtkUniqueCollection::RemoveLastItem void   )  [inline]
 

Remove the last node in the list (like a stack pop).

Note:
The removed item may be returned in optional call parameter, removed.

Reimplemented in vtkExtensionsObjectCollection.

Definition at line 138 of file vtkUniqueCollection.h.

Referenced by vtkExtensionsObjectCollection::RemoveLastItem().

void vtkUniqueCollection::RemoveLastItem vtkObject **  removed  )  [inline]
 

Remove the last node in the list (like a stack pop).

Note:
The removed item may be returned in optional call parameter, removed.

Definition at line 289 of file vtkUniqueCollection.h.

References RemoveItem().

void vtkUniqueCollection::ReplaceItem int  i,
vtkObject item
[inline]
 

Replace the i'th node in the list with item.

Note:
The replaced item may be returned in optional third call parameter.

Reimplemented from vtkCollection.

Definition at line 68 of file vtkUniqueCollection.h.

void vtkUniqueCollection::ReplaceItem int  i,
vtkObject item,
vtkObject **  ret
[inline]
 

Replace the i'th node in the list with item.

Note:
The replaced item may be returned in optional third call parameter.

Definition at line 203 of file vtkUniqueCollection.h.

References CheckUnique, vtkObject::Register(), and ReplaceItem().

Referenced by ReplaceItem().

virtual void vtkUniqueCollection::SetCheckUnique int   )  [virtual]
 

Toggle enforcement of uniquity among collection items (default is TRUE).

vtkUniqueCollection::vtkTypeRevisionMacro vtkUniqueCollection  ,
vtkCollection 
 


Member Data Documentation

int vtkUniqueCollection::CheckUnique [protected]
 

Definition at line 170 of file vtkUniqueCollection.h.

Referenced by AddItem(), and ReplaceItem().


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