C++ wrapper: add a method on each class in order to get the associated C object pointer

This commit is contained in:
François Grisez 2017-06-01 10:59:11 +02:00
parent 10055ddd96
commit 9aa350c402
2 changed files with 9 additions and 0 deletions

View file

@ -37,6 +37,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
{{/isfactory}}{{/_class}}
{{#_class}}
{{#isNotListener}}
struct {{{privCClassName}}};
{{/isNotListener}}
{{/_class}}
namespace linphone {
{{#priorDeclarations}}
@ -68,6 +75,7 @@ namespace linphone {
LINPHONECXX_PUBLIC ~{{{className}}}();
LINPHONECXX_PUBLIC const void *c_struct() const {return mPrivPtr;}
{{/isnotrefcountable}}
LINPHONECXX_PUBLIC {{{privCClassName}}} *cPtr() {return ({{{privCClassName}}} *)mPrivPtr;}
{{/isNotListener}}
{{#ismonolistenable}}

View file

@ -85,6 +85,7 @@ class CppTranslator(object):
'isVcard' : (_class.name.to_c() == 'LinphoneVcard'),
'className' : CppTranslator.translate_class_name(_class.name),
'cClassName' : '::' + _class.name.to_c(),
'privCClassName' : '_' + _class.name.to_c(),
'parentClassName' : 'Object' if _class.refcountable else None,
'methods' : [],
'staticMethods' : [],