Go to the previous, next section.
#include <nihcl/AssocInt.h>
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
.
AssocInt(Object&
newKey
=*nil, int
newValue
=0)
AssocInt
between the key object
newKey
and the integer value
newValue.
virtual Object* value()
virtual const Object* value() const
AssocInt
.
virtual Object* value(Object&
newValue)
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
.
virtual void deepenShallowCopy()
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
.
virtual void storer(OIOofd&
fd) const
virtual void storer(OIOout&
strm) const
LookupKey
to
fd
or
strm
by applying
storeOn()
to the key object and writing out the integer value of the
Integer
value object member.
NIHCL_BADARGCLM
Go to the previous, next section.