[fpc-devel] Function Redirection Problem in Interfaces

Leandro Conde leandor at gmail.com
Mon Mar 27 01:36:25 CEST 2006


Reproduction Procedure: 

	1) Define a IBase interface and put some methods int it (Base1,
Base2, Base3).
	2) Then define two more interfaces derived from IBas (IDerived1,
IDerived2).
	3) All the methods are called differently, so, is not a problem of
ambiguous overloading.
	4) Then make a class to implement the two derived interfaces
(TTestCase).
	5) Then in that class provide two sets for the IBase's methods, and
implement each of the interfaces redirecting it's methods to the respective
set.

For a real world example, see the code in:
http://cvs.sf.net/viewcvs.py/sil/152/

this [1, http://tinyurl.com/r2mzv]: 
	source/lib/SilLiDataType.pas

In that context is: 
	IBase == IDataTypecast, and 
	IDerived1 == IDataConvert, 
	IDerived2 = IDataAssing. 

All this are implemented in[2, http://tinyurl.com/r9w9n]: 
	source/lib/SilLiDataType.pas

And see[3, http://tinyurl.com/zrvow]: 

programs/
  demos/
    lib/
      framework/
        conversion/
          FmTestBaseFrameworkConversion.pas

for an example of how it is used.

Thanks, hope this helps.
Leandro.

[1] 	
http://cvs.sf.net/viewcvs.py/sil/152/source/lib/SilLiDataType.pas?rev=1.7&vi
ew=markup

[2] 
http://cvs.sf.net/viewcvs.py/sil/152/source/lib/SilLkDataHandler.pas?rev=1.9
&view=markup

[3]
http://cvs.sf.net/viewcvs.py/sil/152/programs/demos/lib/framework/conversion
/FmTestBaseFrameworkConversion.pas?view=markup
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FunctionRedirectionProblem.zip
Type: application/octet-stream
Size: 3615 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20060326/d088ddb8/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CompilerOutput.zip
Type: application/octet-stream
Size: 42826 bytes
Desc: not available
URL: <http://lists.freepascal.org/pipermail/fpc-devel/attachments/20060326/d088ddb8/attachment-0001.obj>


More information about the fpc-devel mailing list