Loading...
 

UnWrapObject

UnwrapObject

UnwrapObject

Stack
Stack Description
Stack(In) an 'enveloped' object
Stack(Out) the object (without cover)

expects an object of the class CX_DESCRIPTIVE_REF, CX_OVERWRITING_REF or CX_COND_WRAPPER on the stack and replaces it with the object referenced by it. The wrapper object is (logically) deleted, the reference to the wrapped object remains in the wrapper. The operation

       object UnwrapObject 

corresponds to the instruction sequence

       object Dup Get(_object) Swap DeleteObject 

Conditioned wrappers are an exception: In this case not the wrapped object is put back on the stack (which would be nonsensical, since there can be several objects), but a copy of the contained Conditioned Bag. The original Conditioned Bag is handed over to the Garbage Collection. If the conditioned wrapper is persistent, a persistent copy of the wrapper is returned.

If an object was passed on the stack that is not derived from CX_DESCRIPTIVE_REF , then UnwrapObject does nothing and puts the passed object back on the stack. In this case, no error is output. This also applies to CX_LAZY_CREATOR objects that have not yet been instantiated.