Defines the RefCount.TRefCount class that implements the IUnknown interface for its owner by delegation (using the implements keyword). The TRefCount class makes it easy to quickly make a class to implement the IUnknown interface without descending from TInterfacedObject, TComponent or similar class.
|
Name
|
Description
|
|
TComponentNexus
|
Defines an object that can listen for free component notifications for a non-component object. This class allows non-TComponent descendants to use the automatic memory management of TComponent
|
|
TRefCount
|
The TRefCount class implements the IUnknown interface for an Owner object. The TRefCount class makes it easy to quickly make a class to implement the IUnknown interface by using delegation instead of descending from TInterfacedObject, TComponent or similar class. The Owner object just needs to declare a property of this type with the implements keyword and allocate (and free) the memory for the TRefCount class. For example,
Delphi
|
property RefCount: TRefCount read FRefCount implements IUnknown;
|
|
The TRefCount class will take care of reference counting for the Owner object and free the Owner when the reference count equals zero.
|
Top