From: William F. <wsf...@us...> - 2006-02-03 22:06:19
|
Update of /cvsroot/swig/SWIG/Doc/Manual In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1747/Doc/Manual Modified Files: Customization.html Log Message: Update list of exceptions in the SWIG exception library Document allowexcept feature Index: Customization.html =================================================================== RCS file: /cvsroot/swig/SWIG/Doc/Manual/Customization.html,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** Customization.html 28 Jan 2006 18:58:18 -0000 1.21 --- Customization.html 3 Feb 2006 22:06:11 -0000 1.22 *************** *** 16,19 **** --- 16,20 ---- <li><a href="#Customization_nn4">Exception handling with longjmp()</a> <li><a href="#Customization_nn5">Handling C++ exceptions</a> + <li><a href="#Customization_allowexcept">Exception handlers for variables</a> <li><a href="#Customization_nn6">Defining different exception handlers</a> <li><a href="#Customization_nn7">Using The SWIG exception library</a> *************** *** 256,260 **** </div> ! <H3><a name="Customization_nn6"></a>11.1.4 Defining different exception handlers</H3> --- 257,286 ---- </div> ! <H3><a name="Customization_allowexcept"></a>11.1.4 Exception handlers for variables</H3> ! ! ! <p> ! By default all variables will ignore <tt>%exception</tt>, so it is effectively turned off for all variables wrappers. ! This applies to global variables, member variables and static member variables. ! The approach is certainly a logical one when wrapping variables in C. ! However, in C++, it is quite possible for an exception to be thrown while the variable is being assigned. ! To ensure <tt>%exception</tt> is used when wrapping variables, it needs to be 'turned on' using the <tt>%allowexception</tt> feature. ! Note that <tt>%allowexception</tt> is just a macro for <tt>%feature("allowexcept")</tt>, that is, it is a feature called "allowexcept". ! Any variable which has this feature attached to it, will then use the <tt>%exception</tt> feature, but of course, ! only if there is a <tt>%exception</tt> attached to the variable in the first place. ! The <tt>%allowexception</tt> feature works like any other feature and so can be used globally or for selective variables. ! </p> ! ! <div class="code"> ! <pre> ! %allowexception; // turn on globally ! %allowexception Klass::MyVar; // turn on for a specific variable ! ! %noallowexception Klass::MyVar; // turn off for a specific variable ! %noallowexception; // turn off globally ! </pre> ! </div> ! ! <H3><a name="Customization_nn6"></a>11.1.5 Defining different exception handlers</H3> *************** *** 393,397 **** </p> ! <H3><a name="Customization_nn7"></a>11.1.5 Using The SWIG exception library</H3> --- 419,423 ---- </p> ! <H3><a name="Customization_nn7"></a>11.1.6 Using The SWIG exception library</H3> *************** *** 429,433 **** <div class="diagram"><pre> ! SWIG_MemoryError SWIG_IOError SWIG_RuntimeError --- 455,459 ---- <div class="diagram"><pre> ! SWIG_UnknownError SWIG_IOError SWIG_RuntimeError *************** *** 439,443 **** SWIG_ValueError SWIG_SystemError ! SWIG_UnknownError </pre></div> --- 465,471 ---- SWIG_ValueError SWIG_SystemError ! SWIG_AttributeError ! SWIG_MemoryError ! SWIG_NullReferenceError </pre></div> *************** *** 566,570 **** should not attempt to deallocate it twice. This is similar to use the DISOWN typemap in the first method argument, and in fact, it also ! depends on the target language to implement the 'disown' mechanism properly. </p> --- 594,598 ---- should not attempt to deallocate it twice. This is similar to use the DISOWN typemap in the first method argument, and in fact, it also ! depends on the target language on implementing the 'disown' mechanism properly. </p> |