Accesses a place containing an interface pointer, maintaining reference counts.
com
interface-ref iptr-place => iptr
setf (interface-ref iptr-place) iptr => iptr
iptr-place⇩ |
A place containing a COM interface pointer or nil . |
iptr⇩ |
A COM interface pointer or nil . |
iptr⇩ |
A COM interface pointer or nil . |
The accessor interface-ref
is useful when manipulating a place containing an interface pointer.
The setf form increments the reference count, as if by add-ref, of iptr, unless it is nil
. It then decrements the reference count, as if by release, of the existing value in iptr-place, unless this is nil
. Note that this order is important in the case that the new value is the same as the current value. Finally the value of place iptr-place is set to iptr.
The reader interface-ref
simply returns the interface pointer stored in iptr-place and does no reference counting. It may be useful in a form which both reads and writes a place like incf.
COM/Automation User Guide and Reference Manual - 01 Dec 2021 19:38:38