Owneds

 (Available in 00 TS Tools(Base) - TS_Tools_Root2)

Purpose

Get a list of objects owned

Syntax

aOwners:=oSomeClass:Owneds

Description

When this class is initialized with an owner, then the created object is registered at its owner as an 'owned' object. In this way a compleat object tree, containing owners and owneds, is created.

This behavior is especialy usefull for the static allocated classes by this meganism the 'SelfDestructOnUnRegisterOwner' property can be used to destroy the owned objects when the owner object is destroyed.

Example

ASend( SELF:Owneds, #SomeMethodName, ...  ; ...
...)

Source

ACCESS Owneds AS ARRAY PASCAL CLASS TS_Root2
LOCAL aOwneds AS ARRAY
   TSTrace Enter
   IF SELF:_Owneds<>NULL_ARRAY
      aOwneds:=AClone( SELF:_Owneds )
   ELSE
      aOwneds:=ArrayCreate( 0 )
   END
   TSTrace Leave
RETURN aOwneds