From: abn Date: Mon, 23 Oct 2023 14:38:34 +0000 (+0200) Subject: New method: getHiddenCppPointerAsLongLong() X-Git-Tag: V9_12_0b1~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2Fabn%2Fcpp_ptr;p=tools%2Fmedcoupling.git New method: getHiddenCppPointerAsLongLong() + useful for mixed wrapping tools, for example mixing MEDCoupling's SWIG and PyBind11/Nanobind --- diff --git a/src/MEDCoupling_Swig/MEDCouplingCommon.i b/src/MEDCoupling_Swig/MEDCouplingCommon.i index 448d3e769..1fca14d4b 100644 --- a/src/MEDCoupling_Swig/MEDCouplingCommon.i +++ b/src/MEDCoupling_Swig/MEDCouplingCommon.i @@ -680,6 +680,14 @@ namespace MEDCoupling std::ostringstream oss; oss << "C++ Pointer address is : " << self; return oss.str(); } + + // Hack to allow retrieving of underlying C++ pointer whatever the situation + // This allows for example to mix different types of Python binding (SWIG and PyBind for example) + long long getHiddenCppPointerAsLongLong() const + { + return (long long) self; + } + } %extend MEDCouplingGaussLocalization