Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id DC39A200BCA for ; Mon, 21 Nov 2016 16:39:59 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id DAFBD160B1C; Mon, 21 Nov 2016 15:39:59 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 52B84160AF9 for ; Mon, 21 Nov 2016 16:39:59 +0100 (CET) Received: (qmail 19011 invoked by uid 500); 21 Nov 2016 15:39:58 -0000 Mailing-List: contact commits-help@celix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@celix.apache.org Delivered-To: mailing list commits@celix.apache.org Received: (qmail 18995 invoked by uid 500); 21 Nov 2016 15:39:58 -0000 Delivered-To: apmail-incubator-celix-commits@incubator.apache.org Received: (qmail 18983 invoked by uid 99); 21 Nov 2016 15:39:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Nov 2016 15:39:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 563242C0AFA for ; Mon, 21 Nov 2016 15:39:58 +0000 (UTC) Date: Mon, 21 Nov 2016 15:39:58 +0000 (UTC) From: "Pepijn Noltes (JIRA)" To: celix-commits@incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Created] (CELIX-386) C++ Object with mutiple services not working MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 21 Nov 2016 15:40:00 -0000 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(d); B2 *b2 = static_cast(d); For more info see: https://en.wikipedia.org/wiki/Virtual_method_table -- This message was sent by Atlassian JIRA (v6.3.4#6332)