On Sun, Jun 14, 2015 at 11:47 AM, Liviu Ionescu <i...@livius.net> wrote:
>
>> On 13 Jun 2015, at 12:29, Peter Crosthwaite <peter.crosthwa...@xilinx.com> 
>> wrote:
>>
>> There is a way :). Check object_class_get_parent. qdev.c uses it to
>> implement device properties on multiple levels without overriding. You
>> still need to explicit call to superclass in each child class but that
>> is normal of OO syntaxes.
>
> there is a way, but there is a catch, it must be applied to the explicit 
> class of the current level, not of the current device object, since this 
> might be the class of the child class.
>
> so the detailed syntax to call the parent realize() is:
>
>         
> DEVICE_CLASS(object_class_get_parent(object_class_by_name(CURRENT_CLASS_TYPE_NAME)))->realize(dev,
>  &local_err);
>

Yes. We did actually come up with some macros to make this less
verbose at one stage.

Regards,
Peter

>
> regards,
>
> Liviu
>
>
>

Reply via email to