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

vtkObjectBaseMap Class Reference

#include <vtkObjectBaseMap.h>

Inheritance diagram for vtkObjectBaseMap:

Inheritance graph
[legend]
Collaboration diagram for vtkObjectBaseMap:

Collaboration graph
[legend]
List of all members.

Detailed Description

A map container for objects.

Map is a Sorted Associative Container that associates key strings with objects. It is also a Unique Associative Container, meaning that no two items have the same key.

Map has the important property that inserting a new item into a map does not invalidate iterators that point to existing items. Erasing an item from a map also does not invalidate any iterators, except, of course, for iterators that actually point to the item that is being erased.

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

Definition at line 43 of file vtkObjectBaseMap.h.

Public Member Functions

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

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

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

vtkObjectBaseFind (const char *key) const
 Find the item in the table with the given key string.

virtual int Insert (const char *key, vtkObjectBase *item)
 Insert an item into the table paired with a key string.

int Erase (const char *key)
 Erase the entry matching a given key string.

const char * FindKey (const vtkObjectBase *item)
 Find the first key in the map associated with an item.

const char * FindNextKey (void)
 Find the next key in the map associated with the item specified in a previous call to FindKey.

vtkObjectBaseMapIteratorCreateIterator (void)
 Create an iterator.

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

virtual int Front (const char *&key, vtkObjectBase *&item) const
 Gets the first key - item association in the map.

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

virtual int Back (const char *&key, vtkObjectBase *&item) const
 Gets the last key - item association in the map.


Static Public Member Functions

vtkObjectBaseMapNew (void)

Protected Member Functions

 vtkObjectBaseMap (void)
 ~vtkObjectBaseMap ()
void ReportReferences (vtkGarbageCollector *)

Friends

class vtkObjectBaseMapIterator


Constructor & Destructor Documentation

vtkObjectBaseMap::vtkObjectBaseMap void   )  [protected]
 

vtkObjectBaseMap::~vtkObjectBaseMap  )  [protected]
 


Member Function Documentation

virtual int vtkObjectBaseMap::Back const char *&  key,
vtkObjectBase *&  item
const [virtual]
 

Gets the last key - item association in the map.

Returns:
false if the map is empty, otherwise true.

Reimplemented from vtkAssociativeContainer.

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

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectMap.

virtual int vtkObjectBaseMap::Clear void   )  [virtual]
 

Erase ALL items in the container.

Returns:
true on success, false otherwise.

Implements vtkContainer.

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

Copy all items from the specified container into this container.

Returns:
true on success, otherwise false.

vtkObjectBaseMapIterator* vtkObjectBaseMap::CreateIterator void   )  [virtual]
 

Create an iterator.

Implements vtkAssociativeContainer.

Reimplemented in vtkObjectMap.

int vtkObjectBaseMap::Erase const char *  key  )  [virtual]
 

Erase the entry matching a given key string.

Parameters:
key A unique string serving as the map key.
Returns:
true for successful removal from the map or false when attempting to remove empty or non-existant strings.
Note:
The table is not changed if the specified key is empty or cannot be found.

Implements vtkAssociativeContainer.

vtkObjectBase* vtkObjectBaseMap::Find const char *  key  )  const [virtual]
 

Find the item in the table with the given key string.

Parameters:
key A unique string serving as the map key.
Returns:
The item associated with the specified key if found or NULL if the key is removed, empty, or non-existant.

Reimplemented from vtkAssociativeContainer.

Reimplemented in vtkObjectMap.

const char* vtkObjectBaseMap::FindKey const vtkObjectBase item  )  [virtual]
 

Find the first key in the map associated with an item.

Returns:
true on success, false otherwise.

Implements vtkAssociativeContainer.

const char* vtkObjectBaseMap::FindNextKey void   )  [virtual]
 

Find the next key in the map associated with the item specified in a previous call to FindKey.

Returns:
true on success, false otherwise.

Implements vtkAssociativeContainer.

virtual int vtkObjectBaseMap::Front const char *&  key,
vtkObjectBase *&  item
const [virtual]
 

Gets the first key - item association in the map.

Returns:
false if the map is empty, otherwise true.

Reimplemented from vtkAssociativeContainer.

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

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectMap.

vtkIdType vtkObjectBaseMap::GetCapacity void   )  const [virtual]
 

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

Reimplemented from vtkAssociativeContainer.

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

Returns the maximum size of this container.

Reimplemented from vtkContainer.

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

Returns the number of items in the container.

Reimplemented from vtkContainer.

virtual int vtkObjectBaseMap::Insert const char *  key,
vtkObjectBase item
[virtual]
 

Insert an item into the table paired with a key string.

Parameters:
key A unique string serving as the map key.
item An object to be associated with the key.
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.

Implements vtkAssociativeContainer.

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

Returns true if this container is empty.

Reimplemented from vtkContainer.

vtkObjectBaseMap* vtkObjectBaseMap::New void   )  [static]
 

Reimplemented from vtkObject.

Reimplemented in vtkObjectMap.

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

Reimplemented from vtkAssociativeContainer.

Reimplemented in vtkObjectMap.

void vtkObjectBaseMap::ReportReferences vtkGarbageCollector *   )  [protected]
 

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

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

Returns:
true on success, otherwise false.

vtkObjectBaseMap::vtkTypeRevisionMacro vtkObjectBaseMap  ,
vtkAssociativeContainer 
 


Friends And Related Function Documentation

friend class vtkObjectBaseMapIterator [friend]
 

Definition at line 161 of file vtkObjectBaseMap.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