November 2019
Beginner to intermediate
674 pages
15h
English
The second part of the solution creates an adapter that can be used with the Process function that expects a IProducer interface. The existing code, which can be found in the Adapter.Example.Composition unit, however, implements an IIncompatible interface. Both the original interface and the adapter are shown here:
type IIncompatible = interface ['{4422CF75-2CBE-4F7D-9C14-89DC160CD3C7}'] function NextElement: integer; end; TIncompatible = class(TInterfacedObject, IIncompatible) function NextElement: integer; end; TProducerAdapter = class(TInterfacedObject, IProducer) strict private FWrapped: IIncompatible; public constructor Create(const wrapped: IIncompatible); function NextData: TValue; end;
In this solution, the adapter ...
Read now
Unlock full access