Pepijn Noltes created CELIX-386:
-----------------------------------

             Summary: 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)

Reply via email to