[fpc-devel] Tests of observer feature [was: Considerations about observer]

Sven Barth pascaldragon at googlemail.com
Thu Nov 29 16:17:39 CET 2012


Am 29.11.2012 10:44, schrieb michael.vancanneyt at wisa.be:
>
>
> On Thu, 29 Nov 2012, Sven Barth wrote:
>
>> Am 29.11.2012 03:59, schrieb luiz americo pereira camara:
>>> As is today, if you have a reference to a IFPObserver is not possible
>>> to use it to attach to, e.g., child objects. This occurs because AFAIK
>>> you can't get a TObject from a interface reference.
>>
>> At least for COM interfaces "as" and "is" with a class type on the 
>> right side is supported. The corresponding code for Corba interfaces 
>> is not implemented (yet). This feature exists at least since 2.6.0.
>
> Well. I did not know of this feature. I should document it :-)

It's also supported by newer Delphi versions (I don't know from when on 
though...)

> interfaces: What routine needs to be implemented to do this for Corba 
> interfaces ?
After thinking this through a bit I don't think that this will be 
possible... the "intf as class" and "intf is class" code relies no the 
existence of the QueryInterface function which is not supported by CORBA 
interfaces. It's also not possible to cast a CORBA interfaces to a 
another CORBA interface (or even a COM interface) exactly because of this.

Nevertheless the corresponding RTL code is located in rtl/inc/objpas.inc 
from ~ line 110 to ~ line 270 (these are the compilerprocs which are 
used by the compiler). Of course compiler code would be needed as well...

Regards,
Sven



More information about the fpc-devel mailing list