3
votes
Vote UpVote

Delphi interfaces without reference counting

The Programming Works – Any interface in Delphi inherits from IInterface (which is a nickname for IUnknown). It is nice for reference-counted interfaces, but sometimes we do not need reference counting at all. Consider the following example: unit IValues; interface type IValue = interface(IInterface) function GetValue: Integer; end; function GetIValue: IValue; implementation type TValueObject = class(TObject, IValue) protected FValue: Integer; function GetValue: Integer; public constructor Create(AValue: Integer); end; var FValueObject: TValueObject; function GetIValue: IValue; ...
Favorite? Off-Topic? Serg @ 2010-11-24 08:19

Statistics

Visits: 903
Votes: 3
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Alister Christie
Tier777
Zzzzz
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)