Go to the first, previous, next, last section, table of contents.


CNKeyString -- Object Management via String Keys

SYNOPSIS

#include <CNCL/KeyString.h>

TYPE

CN_KEYSTRING

BASE CLASSES

CNKey

DERIVED CLASSES

None

RELATED CLASSES

CNKeyInt, CNHashTable, CNHashStatic, CNHashDynamic, CNHashIterator, CNManager

DESCRIPTION

CNKeyString is a class for managing CNCL compatible objects via CNString keys. Objects of this type can be stored in and retrieved from hash tables. Constructors:

CNKeyString(CNStringR key_string, CNObject *obj = NIL);
CNKeyString(CNParam *param);
Initializes CNKeyString. The supplied string key is used to calculate the hash table position. Therefore, the string key must be unique. Make sure, that the string key is valid during the whole lifetime of the respective key. Otherwise operations on this key are unpredictable.

In addition to the member functions required by CNCL, CNKeyString provides:

CNStringR get_key() const;
Returns the string key. Unlike the object the string key cannot be changed.
virtual unsigned long hash( unsigned long capacity, int par = 0) const;
Evaluates and returns the hash-table value. par is reserved for future use, any other value than zero will result in an fatal error.
virtual bool compare(CNKey *k) const;
virtual bool compare(CNKey &k) const;
Compares two CNKeys.


Go to the first, previous, next, last section, table of contents.