celix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Pepijn Noltes (JIRA)" <j...@apache.org>
Subject [jira] [Closed] (CELIX-386) C++ Object with mutiple services not working
Date Tue, 20 Dec 2016 19:23:58 GMT

     [ https://issues.apache.org/jira/browse/CELIX-386?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Pepijn Noltes closed CELIX-386.
-------------------------------
    Resolution: Fixed

> C++ Object with mutiple services not working
> --------------------------------------------
>
>                 Key: CELIX-386
>                 URL: https://issues.apache.org/jira/browse/CELIX-386
>             Project: Celix
>          Issue Type: Bug
>            Reporter: Pepijn Noltes
>            Assignee: Pepijn Noltes
>
> When providing multiple C++ services from a single object, the object first needs to
be cast before forwarding it as service to the C dep man. 
> This is because in most (all) implementations casting can result in pointers with an
offset.
> For example If D is a class extending  B1 and B2, depending on the inheritance order,
b1 or b1 will have a different pointer value.
> D  *d  = new D();
> B1 *b1 = static_cast<B1*>(d);
> B2 *b2 = static_cast<B2*>(d);
> For more info see:
> https://en.wikipedia.org/wiki/Virtual_method_table



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message