[an error occurred while processing this directive]

Table Module Client Specifications


Purpose

The Table module provides storage and random access retrieval and removal of data associated with character string keys.

Client Data Model

A Table is create by calling newTable(). Entries can be added by calling add(), specifying the key and data as parameters. Entries with duplicate keys are not permitted. Entries can be retrieved or removed with dataFor() or remove(). All entries can be removed by calling clear().

You can check if there is an entry with a specified key by calling isKey(). The returned value is a precondition for add(), dataFor(), and remove(). When a Table is no longer needed, its memory resources can be released by calling freeTable().

This module has a submodule that provides iterator functions for stepping through the entries in a Table. See TableIterator Module ClientSpecifications.

Error handling policy
All precondition violations result in an error message followed by program termination.

Importing Information

Use of the Table module requires the following include.
#include "Descriptor.h"
#include "Table.h"
If the Table module is configured to use a data types other than Descriptor then different includes may be required. See Table Configuration.

Public Data Types

Table Configuration

The Table module is initially configured to use char * keys for retrieving Descriptor data. It can be configured for a different data type by redefining type Data in Table.h. If the new type is declared in another header file then includes for that header file and other header files that it requires should replace the include for Descriptor.h in Table.C and any other code file that includes Table.h. These includes should appear before to the include for Table.h

Public Functions

Creation and Release
Data Retrieval
Data Modification
Iteration
[an error occurred while processing this directive]