System.Classes.GetUltimateOwner

From RAD Studio API Documentation
Jump to: navigation, search

Delphi

function GetUltimateOwner(const ACollectionItem: TCollectionItem): TPersistent;
function GetUltimateOwner(const ACollection: TCollection): TPersistent;
function GetUltimateOwner(const APersistent: TPersistent): TPersistent;

C++

extern DELPHI_PACKAGE TPersistent* __fastcall GetUltimateOwner(TCollectionItem* const ACollectionItem)/* overload */;

Properties

Type Visibility Source Unit Parent
function public
System.Classes.pas
System.Classes.hpp
System.Classes System.Classes

Description

Returns the top-level owner of a specified persistent object.

Call GetUltimateOwner to obtain the ultimate owner of a persistent object. GetUltimateOwner traverses the ownership hierarchy, finding first the Owner, and then that Owner's Owner, and so on, until there are no more owners.

The ultimate owner is typically the form or data module that contains the object instance. However, if one of the Owners (other than a form or data module) does not have an Owner, GetUltimateOwner returns nil (Delphi) or NULL (C++).

See Also