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


CNKey -- Abstract Base Class for Object Management via Keys

SYNOPSIS

#include <CNCL/Key.h>

TYPE

CN_KEY

BASE CLASSES

CNObject

DERIVED CLASSES

CNKeyString, CNKeyInt

RELATED CLASSES

CNHashTable, CNHashStatic, CNHashDynamic, CNHashIterator, CNManager

DESCRIPTION

CNKey is an abstract class for managing CNCL compatible objects via keys. Refer to the desription of the classes derived from CNKey for further information. Objects of this type can be stored in and retrieved from hash tables. Constructors:

CNKey(CNObject *obj = NIL);
CNKey(CNParam *param);
Initializes CNKey.

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

void set_object(CNObject *obj);
void set_object(CNObject &obj);
Stores a CNCL compatible object into the key. Normally, an object is stored in a key at creation time via the constructor.
CNObject *get_object() const;
Gets the object stored in the key. If an object is not available, NIL is returned.

The following virtual functions are to be defined by derived classes:

virtual unsigned long hash( unsigned long capacity, int par = 0) const = 0;
Function to evaluate the hash-table value.
virtual bool compare(CNKey *k) const = 0;
virtual bool compare(CNKey &k) const = 0;
Function to compare two CNKeys.


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