fixes for new flag attribute convention

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@7605 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
Marcelo Matus 2005-10-07 13:19:06 +00:00
commit 54ba818937
7 changed files with 53 additions and 45 deletions

View file

@ -194,6 +194,7 @@ CPP_TEST_CASES += \
protected_rename \
pure_virtual \
redefined \
refcount \
reference_global_vars \
register_par \
rename_scope \

View file

@ -62,7 +62,7 @@
%typemap(doc) int a "a: special comment for parameter a";
%typemap(doc) int b "b: another special comment for parameter b";
%pythoncallback(1) func_cb;
%callback(1) func_cb;
%inline {

View file

@ -1,11 +1,11 @@
%module nondynamic
/*
Use the "static" feature to make the wrapped class a static one,
ie, a python class that doesn't dynamically add new attributes.
Hence, for the class
Use the %pythonnondynamic directuve to make the wrapped class a
nondynamic one, ie, a python class that doesn't dynamically add new
attributes. Hence, for the class
%feature("static") A;
%pythonnondynamic A;
struct A
{
int a;
@ -19,11 +19,11 @@
aa.b = 1 # Ok
aa.c = 3 # error
Since "static" is a feature, if you use
Since "nondynamic" is a feature, if you use
%feature("static");
%pythonnondynamic;
it will make all the wrapped class static ones.
it will make all the wrapped class nondynamic ones.
The implementation is based on the recipe:
@ -35,9 +35,8 @@
//%pythonnondynamic(1);
%pythonnondynamic(1) A;
%pythonnondynamic(0) C;
%pythonnondynamic A;
%pythondynamic C;
%inline %{

View file

@ -1,6 +1,6 @@
%module refcount
#warnfilter(362);
%warnfilter(362);
%{
#include <iostream>
@ -33,8 +33,8 @@ RefCount(B);
// using the ref/unref features you can active the ref. counting
// for RCObj and all its descendents at once
//
%feature("ref") RCObj "$this->ref();"
%feature("unref") RCObj "$this->unref();"
%refobject RCObj "$this->ref();"
%unrefobject RCObj "$this->unref();"
#endif
@ -108,7 +108,7 @@ RefCount(B);
/* Other ref/unref uses:
// deactive the refcounting for A1 and its descendents
%feature("noref") A1;
%feature("nounref") A1;
%noref A1;
%nounref A1;
*/