NAME

cxDataRefDec - decrement reference count of IRIS Explorer data type

C SPECIFICATION

#include <cx/DataOps.h>

void cxDataRefDec(void *data)

FORTRAN SPECIFICATION

subroutine cxDataRefDec(data)
integer data

PARAMETERS

data
Pointer to any reference counted IRIS Explorer data type.

DESCRIPTION

cxDataRefDec decrements the reference count of the IRIS Explorer data type pointed to by data. If the reference count becomes 0 or -1, the data's type-specific deletion routine is called. (All type-specific deletion routines are hidden from the user, because they must only be called when the reference count is less than 1.)

If, when data is deleted, it contains references to other IRIS Explorer data types (for instance, a cxLattice may contain pointers to a cxData or cxCoord), the reference counts of the data it contains are also decremented. The contained data is not deleted directly, this allows one cxData to be shared by multiple instances of cxLattice.

A module does not normally need to call cxDataRefDec. The reference counts of the data present on input or output ports are managed automatically when the module sends or receives data. If the module creates a temporary IRIS Explorer data type that is not output to another module, it must call cxDataRefDec to delete the data.

See Appendix B of the IRIS Explorer Module Writer's Guide for more information on reference counting.

SEE ALSO

cxDataRefInc(3E)
Last modified: Mon Nov 18 13:48:16 GMT 1996
[ Documentation Home ]
© The Numerical Algorithms Group Ltd, Oxford UK. 1996