[Overview][Constants][Types][Classes][Procedures and functions][Variables][Index] Reference for unit 'System' (#rtl)

TAggregatedObject

[Properties (by Name)] [Methods (by Name)] [Events (by Name)]

Aggregated object

Declaration

Source position: objpash.inc line 289

type TAggregatedObject = class(TObject)

protected

  function QueryInterface();

  function _AddRef;

  function _Release;

public

  constructor Create();

  

Create a new instance of TAggregatedObject

  property Controller: IUnknown; [r]

  

Controlling instance

end;

Inheritance

TAggregatedObject

  

Aggregated object

|

TObject

  

Base class of all classes.

Description

TAggregatedObject implements an object whose lifetime is governed by an external object (or interface). It does not implement the IUnknown interface by itself, but delegates all methods to the controller object, as exposed in the Controller property. In effect, the reference count of the aggregated object is the same as that of it's controller, and additionally, all interfaces of the controller are exposed by the aggregated object.

Note that the aggregated object maintains a non-counted reference to the controller.

Aggregated objects should be used when using delegation to implement reference counted objects: the delegated interfaces can be implemented safely by TAggregatedObject descendents.

See also

Create

  

Create a new instance of TAggregatedObject

Controller

  

Controlling instance

The latest version of this document can be found at lazarus-ccr.sourceforge.net.