Add a few comments about the smart pointer implementation
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@11828 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f112e4bac1
commit
1de9c8b27f
6 changed files with 27 additions and 4 deletions
|
|
@ -6,18 +6,23 @@
|
|||
#define SHARED_PTR_DISOWN 0
|
||||
#endif
|
||||
|
||||
// Language specific macro implementing all the customisations for handling the smart pointer
|
||||
%define SWIG_SHARED_PTR_TYPEMAPS(PROXYCLASS, CONST, TYPE...)
|
||||
|
||||
// %naturalvar is as documented for member variables
|
||||
%naturalvar TYPE;
|
||||
%naturalvar SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< CONST TYPE >;
|
||||
|
||||
// destructor mods
|
||||
// destructor wrapper customisation
|
||||
%feature("unref") TYPE
|
||||
//"if (debug_shared) { cout << \"deleting use_count: \" << (*smartarg1).use_count() << \" [\" << (boost::get_deleter<SWIG_null_deleter>(*smartarg1) ? std::string(\"CANNOT BE DETERMINED SAFELY\") : ( (*smartarg1).get() ? (*smartarg1)->getValue() : std::string(\"NULL PTR\") )) << \"]\" << endl << flush; }\n"
|
||||
"(void)arg1; delete smartarg1;"
|
||||
|
||||
// Feature to adapt the code generated in the swigregister functions for smart pointers
|
||||
%feature("smartptr", noblock=1) TYPE { SWIG_SHARED_PTR_QNAMESPACE::shared_ptr< TYPE > }
|
||||
|
||||
// Typemap customisations...
|
||||
|
||||
// plain value
|
||||
%typemap(in) CONST TYPE (void *argp, int res = 0) {
|
||||
int newmem = 0;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue