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

vtkObjectBaseHashMap Class Reference

#include <vtkObjectBaseHashMap.h>

Inheritance diagram for vtkObjectBaseHashMap:

Inheritance graph
[legend]
Collaboration diagram for vtkObjectBaseHashMap:

Collaboration graph
[legend]
List of all members.

Detailed Description

A hash map object for objects.

A hash map is a Hashed Associative Container that associates a key string with objects. It is also a Unique Associative Container, meaning that no two items have keys that compare equal.

Looking up an item in a hash map by its key is efficient, so a hash map is useful for "dictionaries" where the order of items is irrelevant. If it is important for the items to be in a particular order, however, then map is more appropriate.

Author:
Sean McInerney
Version:
Revision
1.3
Date:
Date
2005/06/24 23:17:16

Definition at line 40 of file vtkObjectBaseHashMap.h.

Public Member Functions

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

virtual int Copy (vtkObjectBaseHashMap *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.

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.

vtkObjectBaseHashMapIteratorCreateIterator (void)
 Create an iterator.

int GetCheckUnique (void) const
 Toggle enforcement of uniqueness among key strings (default: true).

void SetCheckUnique (int a)
 Toggle enforcement of uniqueness among key strings (default: true).

int GetCheckCase (void) const
 Toggle matching of upper/lower case characters in keys (default: true).

void SetCheckCase (int a)
 Toggle matching of upper/lower case characters in keys (default: true).

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

vtkObjectBaseHashMapNew (void)

Protected Member Functions

 vtkObjectBaseHashMap (void)
 ~vtkObjectBaseHashMap ()
void ReportReferences (vtkGarbageCollector *)

Friends

class vtkObjectBaseHashMapIterator


Constructor & Destructor Documentation

vtkObjectBaseHashMap::vtkObjectBaseHashMap void   )  [protected]
 

vtkObjectBaseHashMap::~vtkObjectBaseHashMap  )  [protected]
 


Member Function Documentation

virtual int vtkObjectBaseHashMap::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* vtkObjectBaseHashMap::Back void   )  const [virtual]
 

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectHashMap.

virtual int vtkObjectBaseHashMap::Clear void   )  [virtual]
 

Erase ALL items in the container.

Returns:
true on success, false otherwise.

Implements vtkContainer.

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

Copy all items from the specified container into this container.

Returns:
true on success, otherwise false.

vtkObjectBaseHashMapIterator* vtkObjectBaseHashMap::CreateIterator void   )  [virtual]
 

Create an iterator.

Implements vtkAssociativeContainer.

Reimplemented in vtkObjectHashMap.

int vtkObjectBaseHashMap::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* vtkObjectBaseHashMap::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 vtkObjectHashMap.

const char* vtkObjectBaseHashMap::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* vtkObjectBaseHashMap::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 vtkObjectBaseHashMap::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* vtkObjectBaseHashMap::Front void   )  const [virtual]
 

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

Reimplemented from vtkContainer.

Reimplemented in vtkObjectHashMap.

vtkIdType vtkObjectBaseHashMap::GetCapacity void   )  const [virtual]
 

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

Reimplemented from vtkAssociativeContainer.

int vtkObjectBaseHashMap::GetCheckCase void   )  const [virtual]
 

Toggle matching of upper/lower case characters in keys (default: true).

Reimplemented from vtkAssociativeContainer.

int vtkObjectBaseHashMap::GetCheckUnique void   )  const [virtual]
 

Toggle enforcement of uniqueness among key strings (default: true).

Reimplemented from vtkAssociativeContainer.

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

Returns the maximum size of this container.

Reimplemented from vtkContainer.

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

Returns the number of items in the container.

Reimplemented from vtkContainer.

int vtkObjectBaseHashMap::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 vtkObjectBaseHashMap::IsEmpty void   )  const [virtual]
 

Returns true if this container is empty.

Reimplemented from vtkContainer.

vtkObjectBaseHashMap* vtkObjectBaseHashMap::New void   )  [static]
 

Reimplemented from vtkObject.

Reimplemented in vtkObjectHashMap.

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

Reimplemented from vtkAssociativeContainer.

Reimplemented in vtkObjectHashMap.

void vtkObjectBaseHashMap::ReportReferences vtkGarbageCollector *   )  [protected]
 

void vtkObjectBaseHashMap::SetCheckCase int  a  )  [virtual]
 

Toggle matching of upper/lower case characters in keys (default: true).

Reimplemented from vtkAssociativeContainer.

void vtkObjectBaseHashMap::SetCheckUnique int  a  )  [virtual]
 

Toggle enforcement of uniqueness among key strings (default: true).

Reimplemented from vtkAssociativeContainer.

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

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

Returns:
true on success, otherwise false.

vtkObjectBaseHashMap::vtkTypeRevisionMacro vtkObjectBaseHashMap  ,
vtkAssociativeContainer 
 


Friends And Related Function Documentation

friend class vtkObjectBaseHashMapIterator [friend]
 

Definition at line 180 of file vtkObjectBaseHashMap.h.


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