Felipe Magno de Almeida | 27 Oct 2011 23:45
Picon

Abstract Interface

Hello,

I'm trying the following IDL:

abstract interface DataView {
 [...]
};

valuetype ValueTypeDataView supports DataView {
 [...]
};

interface ILogFileDataView : DataView {
 [...]
};

interface IDataService {
  DataView getDataView();
  [...]
};

Then while using IDataService:

Given IDataService_ptr dataservice;

DataView_ptr dataview = dataservice->getDataView();

And this assert fails:

assert(dataview->_to_object() || dataview->_to_value());
(Continue reading)

Felipe Magno de Almeida | 6 Dec 2011 16:25
Picon

Re: Abstract Interface

Hello,

I'm attaching a patch which fixes the issue.
Debugging the problem, I found that though the stub is constructed
correctly for the abstract interface while returning both a data type
and an interface, the _downcast defined in the stub assumes a derived
stub is constructed. Which might not be the case, and it isn't with an
abstract interface since its derived type isn't yet known.

The fix is to return this on _to_object when the stub is constructed.
This doesn't break _to_object() == 0 for data types and fixes the
problem when returning a interface. In the patch I removed the
_to_object definition in the concrete stub since it makes the binding
ambiguous because of virtual inheritance, and is unecessary since the
base does the same thing.

Any comments are appretiated.
Regards,

On Thu, Oct 27, 2011 at 7:45 PM, Felipe Magno de Almeida
<eu <at> felipemagno.com.br> wrote:
> Hello,
>
> I'm trying the following IDL:
>
> abstract interface DataView {
>  [...]
> };
>
> valuetype ValueTypeDataView supports DataView {
(Continue reading)

Felipe Magno de Almeida | 6 Dec 2011 16:37
Picon

Re: Abstract Interface

And also the example that shows the problem.

On Tue, Dec 6, 2011 at 1:25 PM, Felipe Magno de Almeida
<eu <at> felipemagno.com.br> wrote:
> Hello,
>
> I'm attaching a patch which fixes the issue.
> Debugging the problem, I found that though the stub is constructed
> correctly for the abstract interface while returning both a data type
> and an interface, the _downcast defined in the stub assumes a derived
> stub is constructed. Which might not be the case, and it isn't with an
> abstract interface since its derived type isn't yet known.
>
> The fix is to return this on _to_object when the stub is constructed.
> This doesn't break _to_object() == 0 for data types and fixes the
> problem when returning a interface. In the patch I removed the
> _to_object definition in the concrete stub since it makes the binding
> ambiguous because of virtual inheritance, and is unecessary since the
> base does the same thing.
>
> Any comments are appretiated.
> Regards,
>
> On Thu, Oct 27, 2011 at 7:45 PM, Felipe Magno de Almeida
> <eu <at> felipemagno.com.br> wrote:
>> Hello,
>>
>> I'm trying the following IDL:
>>
>> abstract interface DataView {
(Continue reading)


Gmane