From: Marcelo M. <mar...@us...> - 2005-10-25 15:51:27
|
Update of /cvsroot/swig/SWIG/Lib/typemaps In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17740/Lib/typemaps Modified Files: attribute.swg Log Message: use macros by default and cosmetic changes Index: attribute.swg =================================================================== RCS file: /cvsroot/swig/SWIG/Lib/typemaps/attribute.swg,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** attribute.swg 25 Oct 2005 13:20:50 -0000 1.1 --- attribute.swg 25 Oct 2005 15:51:16 -0000 1.2 *************** *** 80,84 **** */ ! #ifdef __cplusplus %define %_attribute(Class, Wrap, type, attr, getcode, setcode) %extend Class { --- 80,90 ---- */ ! // ! // Define SWIG_ATTRIBUTE_TEMPLATE if you want to use templates. ! // ! //#define SWIG_ATTRIBUTE_TEMPLATE ! ! ! #if defined(__cplusplus) && defined(SWIG_ATTRIBUTE_TEMPLATE) %define %_attribute(Class, Wrap, type, attr, getcode, setcode) %extend Class { *************** *** 116,129 **** // ! %define %attribute_T(Class, Wrap, type, attr, get, _Type...) %ignore Class::get; ! #if #_Type != "" ! %ignore Class::_Type; %_attribute(%arg(Class), Wrap, %arg(type), ! attr, _t->get(), _t->_Type(_val)) #else %_attribute(%arg(Class), Wrap, %arg(type), attr, _t->get(), ! fprintf(stderr,"'attr' is a read-only attribute")) #endif %enddef --- 122,135 ---- // ! %define %attribute_T(Class, Wrap, type, attr, get, set...) %ignore Class::get; ! #if #set != "" ! %ignore Class::set; %_attribute(%arg(Class), Wrap, %arg(type), ! attr, _t->get(), _t->set(_val)) #else %_attribute(%arg(Class), Wrap, %arg(type), attr, _t->get(), ! SWIG_exception(SWIG_AttributeError,"read-only 'attr' attribute");) #endif %enddef *************** *** 136,144 **** %enddef ! %define %attribute_ref_T(Class, Wrap, type, refname, _Type...) ! #if #_Type == "" %_attribute_ref_T(%arg(Class), Wrap, %arg(type), refname, refname) #else ! %_attribute_ref_T(%arg(Class), Wrap, %arg(type), refname, _Type) #endif %enddef --- 142,150 ---- %enddef ! %define %attribute_ref_T(Class, Wrap, type, refname, attr...) ! #if #attr == "" %_attribute_ref_T(%arg(Class), Wrap, %arg(type), refname, refname) #else ! %_attribute_ref_T(%arg(Class), Wrap, %arg(type), refname, attr) #endif %enddef *************** *** 148,153 **** // ! %define %attribute(Class, type, attr, get, _Type...) ! %attribute_T(%arg(Class), %mangle(Class), %arg(type), attr, get, _Type) %enddef --- 154,159 ---- // ! %define %attribute(Class, type, attr, get, set...) ! %attribute_T(%arg(Class), %mangle(Class), %arg(type), attr, get, set) %enddef |