WWC snapshot of http://www.alw.nih.gov/Docs/NIHCL/nihcl_5.html taken on Sat Jun 10 19:13:33 1995

Go to the previous, next section.

AssocInt--Association of Object Pointer with Integer

SYNOPSIS

#include <nihcl/AssocInt.h>

BASE CLASS

LookupKey

DERIVED CLASSES

None

RELATED CLASSES

Dictionary, IdentDict, Integer

DESCRIPTION

Class AssocInt is derived from class LookupKey, and provides an instance of class Integer as the value object of an association. Class Assoc implements the value() virtual functions, declared in class LookupKey, to access and change the Integer value object.

Class AssocInt eliminates the overhead of allocating memory for a separate Integer value object for an Assoc.

CONSTRUCTORS

AssocInt(Object& newKey =*nil, int newValue =0)
Constructs an AssocInt between the key object newKey and the integer value newValue.

ACCESSING ASSOCINTS

virtual Object* value()
virtual const Object* value() const
Returns a pointer to the value object of this AssocInt.

virtual Object* value(Object& newValue)
Sets the value object member of this AssocInt to newValue, which must be of class Integer, and returns a pointer to this value object. Raises an NIHCL_BADARGCLM exception if newValue is not a kind of Integer.

COPYING ASSOCINTS

virtual void deepenShallowCopy()
Converts this shallow copy to a deep copy by applying deepCopy() to the key object pointer of this AssocInt, replacing the key object pointer by the pointer to its copy, and applying deepenShallowCopy() to the Integer value object member of this AssocInt.

PROTECTED MEMBERS

Object I/O

virtual void storer(OIOofd& fd) const
virtual void storer(OIOout& strm) const
Stores the key and value objects of this LookupKey to fd or strm by applying storeOn() to the key object and writing out the integer value of the Integer value object member.

EXCEPTIONS RAISED

NIHCL_BADARGCLM

Go to the previous, next section.