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

vtkStringEnumerator Class Reference

#include <vtkStringEnumerator.h>

Inheritance diagram for vtkStringEnumerator:

Inheritance graph
[legend]
Collaboration diagram for vtkStringEnumerator:

Collaboration graph
[legend]
List of all members.

Detailed Description

A character string hash table of paired integral values.

Note:
Strings are copied and stored UTF-16-encoded, but may be specified to the Insert, Erase, and Find methods as Latin-1-encoded C-strings (arrays of char), UTF-8-encoded strings (arrays of unsigned bytes), or UTF-16-encoded strings (arrays of 16-bit unsigned integers). Transcoding to UTF-16 is performed as necessary.
Author:
Sean McInerney
Version:
Revision
1.5
Date:
Date
2004/08/10 07:37:21

Definition at line 40 of file vtkStringEnumerator.h.

Public Member Functions

 vtkTypeRevisionMacro (vtkStringEnumerator, vtkExtensionsObject)
void PrintSelf (ostream &, vtkIndent)
vtkIdType GetSize (void) const
 Returns number of slots occupied, including those of removed items.

int IsEmpty (void) const
 Returns whether the map is empty or not.

void Clear (void)
 Erase all entries from the map.

vtkIdType GetCapacity (void) const
 Returns how many items the map can currently hold.

virtual void Swap (vtkStringEnumerator *object)
 Swaps the elements of this object with those of specified object.

virtual const vtkUTF16ChTypeFindKey (const vtkIdType value)
 Find the first key in the map associated with a value.

const vtkUTF16ChTypeFindNextKey (void)
 Find the next key in the map associated with the value specified in a previous call to FindKey.

virtual int GetCheckUnique ()
 Toggle enforcement of uniqueness among string entries (default: true).

virtual void SetCheckUnique (int)
 Toggle enforcement of uniqueness among string entries (default: true).

virtual void CheckUniqueOn ()
 Toggle enforcement of uniqueness among string entries (default: true).

virtual void CheckUniqueOff ()
 Toggle enforcement of uniqueness among string entries (default: true).

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

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

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

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

Methods for finding a table entry.
vtkIdType Find (const vtkUTF16ChType *key) const
 Find the entry in the table with a given key string.

vtkIdType Find (const vtkUTF8ChType *key) const
 Find the entry in the table with a given key string.

vtkIdType Find (const char *key) const
 Find the entry in the table with a given key string.

Methods for adding a string-value pair table entry.
int Insert (const vtkUTF16ChType *key, vtkIdType value)
 Insert the specified string to the table paired with an integral value.

int Insert (const vtkUTF8ChType *key, vtkIdType value)
 Insert the specified string to the table paired with an integral value.

int Insert (const char *key, vtkIdType value)
 Insert the specified string to the table paired with an integral value.

Methods for adding string-hash pair table entry.
int Insert (const vtkUTF16ChType *key)
 Insert the specified string to the table paired with its hash value.

int Insert (const vtkUTF8ChType *key)
 Insert the specified string to the table paired with its hash value.

int Insert (const char *key)
 Insert the specified string to the table paired with its hash value.

Methods for removing a table entry.
int Erase (const vtkUTF16ChType *key)
 Erase the entry matching a given key string.

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

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


Static Public Member Functions

vtkStringEnumeratorNew (void)

Protected Member Functions

 vtkStringEnumerator (void)
 ~vtkStringEnumerator ()


Constructor & Destructor Documentation

vtkStringEnumerator::vtkStringEnumerator void   )  [protected]
 

vtkStringEnumerator::~vtkStringEnumerator  )  [protected]
 


Member Function Documentation

virtual void vtkStringEnumerator::CheckCaseOff  )  [virtual]
 

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

virtual void vtkStringEnumerator::CheckCaseOn  )  [virtual]
 

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

virtual void vtkStringEnumerator::CheckUniqueOff  )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

virtual void vtkStringEnumerator::CheckUniqueOn  )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

void vtkStringEnumerator::Clear void   ) 
 

Erase all entries from the map.

Exceptions:
bad_alloc Allocation of new string could throw.

int vtkStringEnumerator::Erase const char *  key  )  [inline]
 

Erase the entry matching a given key string.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Erase method is exception-safe.
Returns:
true for successful removal from the table 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.

Definition at line 427 of file vtkStringEnumerator.h.

References Erase(), and LATIN1_TO_UTF16.

int vtkStringEnumerator::Erase const vtkUTF8ChType key  )  [inline]
 

Erase the entry matching a given key string.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Erase method is exception-safe.
Returns:
true for successful removal from the table 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.

Definition at line 420 of file vtkStringEnumerator.h.

References Erase(), and UTF8_TO_UTF16.

int vtkStringEnumerator::Erase const vtkUTF16ChType key  ) 
 

Erase the entry matching a given key string.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Erase method is exception-safe.
Returns:
true for successful removal from the table 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.

Referenced by Erase().

vtkIdType vtkStringEnumerator::Find const char *  key  )  const [inline]
 

Find the entry in the table with a given key string.

Parameters:
key A unique string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Find method is exception-safe.
Returns:
The integral value associated with the specified key if an entry matching the key is found within the table or 0 if the key is a removed, empty, or non-existant string.

Definition at line 382 of file vtkStringEnumerator.h.

References Find(), and LATIN1_TO_UTF16.

vtkIdType vtkStringEnumerator::Find const vtkUTF8ChType key  )  const [inline]
 

Find the entry in the table with a given key string.

Parameters:
key A unique string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Find method is exception-safe.
Returns:
The integral value associated with the specified key if an entry matching the key is found within the table or 0 if the key is a removed, empty, or non-existant string.

Definition at line 375 of file vtkStringEnumerator.h.

References Find(), and UTF8_TO_UTF16.

vtkIdType vtkStringEnumerator::Find const vtkUTF16ChType key  )  const
 

Find the entry in the table with a given key string.

Parameters:
key A unique string serving as the hash map key.
Exceptions:
bad_alloc If the specified key parameter must be transcoded to UTF-16, internal use of operator new may throw. If the key parameter is already a UTF-16 string, the Find method is exception-safe.
Returns:
The integral value associated with the specified key if an entry matching the key is found within the table or 0 if the key is a removed, empty, or non-existant string.

Referenced by Find().

virtual const vtkUTF16ChType* vtkStringEnumerator::FindKey const vtkIdType  value  )  [virtual]
 

Find the first key in the map associated with a value.

Returns:
The key string on success, null otherwise.

const vtkUTF16ChType* vtkStringEnumerator::FindNextKey void   ) 
 

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

Returns:
The key string on success, null otherwise.

vtkIdType vtkStringEnumerator::GetCapacity void   )  const
 

Returns how many items the map can currently hold.

Exceptions:
none. 

virtual int vtkStringEnumerator::GetCheckCase  )  [virtual]
 

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

virtual int vtkStringEnumerator::GetCheckUnique  )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

vtkIdType vtkStringEnumerator::GetSize void   )  const
 

Returns number of slots occupied, including those of removed items.

Exceptions:
none. 

int vtkStringEnumerator::Insert const char *  key  )  [inline]
 

Insert the specified string to the table paired with its hash value.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.
Note:
The input string is not paired with a user-defined value, but is instead paired with its own hash value.
Warning:
The paired value is the string's initial hash value, and, currently, does not change with changes to the table size. These paired values are, therefore, not guaranteed unique within the table. This behavior may be corrected in the future revisions.

Definition at line 412 of file vtkStringEnumerator.h.

References Insert(), and LATIN1_TO_UTF16.

int vtkStringEnumerator::Insert const vtkUTF8ChType key  )  [inline]
 

Insert the specified string to the table paired with its hash value.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.
Note:
The input string is not paired with a user-defined value, but is instead paired with its own hash value.
Warning:
The paired value is the string's initial hash value, and, currently, does not change with changes to the table size. These paired values are, therefore, not guaranteed unique within the table. This behavior may be corrected in the future revisions.

Definition at line 405 of file vtkStringEnumerator.h.

References Insert(), and UTF8_TO_UTF16.

int vtkStringEnumerator::Insert const vtkUTF16ChType key  ) 
 

Insert the specified string to the table paired with its hash value.

Parameters:
key A unique charactor string serving as the hash map key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.
Note:
The input string is not paired with a user-defined value, but is instead paired with its own hash value.
Warning:
The paired value is the string's initial hash value, and, currently, does not change with changes to the table size. These paired values are, therefore, not guaranteed unique within the table. This behavior may be corrected in the future revisions.

int vtkStringEnumerator::Insert const char *  key,
vtkIdType  value
[inline]
 

Insert the specified string to the table paired with an integral value.

Parameters:
key A unique charactor string serving as the hash map key.
value An integral value to be associated with the key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.

Definition at line 397 of file vtkStringEnumerator.h.

References Insert(), and LATIN1_TO_UTF16.

int vtkStringEnumerator::Insert const vtkUTF8ChType key,
vtkIdType  value
[inline]
 

Insert the specified string to the table paired with an integral value.

Parameters:
key A unique charactor string serving as the hash map key.
value An integral value to be associated with the key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.

Definition at line 390 of file vtkStringEnumerator.h.

References Insert(), and UTF8_TO_UTF16.

int vtkStringEnumerator::Insert const vtkUTF16ChType key,
vtkIdType  value
 

Insert the specified string to the table paired with an integral value.

Parameters:
key A unique charactor string serving as the hash map key.
value An integral value to be associated with the key.
Exceptions:
bad_alloc Internal use of operator new may throw.
overflow_error Thrown for requests to grow the table beyond its maximum capacity (~ 1<<31).
Returns:
true for successful additions to the table or false when attempting to insert empty or duplicate strings.

Referenced by Insert().

int vtkStringEnumerator::IsEmpty void   )  const
 

Returns whether the map is empty or not.

Exceptions:
none. 

vtkStringEnumerator* vtkStringEnumerator::New void   )  [static]
 

Reimplemented from vtkExtensionsObject.

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

Reimplemented from vtkExtensionsObject.

virtual void vtkStringEnumerator::SetCheckCase int   )  [virtual]
 

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

virtual void vtkStringEnumerator::SetCheckUnique int   )  [virtual]
 

Toggle enforcement of uniqueness among string entries (default: true).

virtual void vtkStringEnumerator::Swap vtkStringEnumerator object  )  [virtual]
 

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

vtkStringEnumerator::vtkTypeRevisionMacro vtkStringEnumerator  ,
vtkExtensionsObject 
 


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