"Last updated" date removed from the files that had them as they aren't being maintained.
Consistent use of 'proxy' rather than 'shadow' throughout git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6211 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
f2f49e600a
commit
959136284a
26 changed files with 43 additions and 93 deletions
|
|
@ -454,8 +454,5 @@ Most well-structured C codes will find an exact match on the first attempt, prov
|
||||||
As a rule of thumb, C++ programs require somewhat more processing than C programs, but this seems to be avoidable. Also, keep in mind that performance penalties in the type-checker don't necessarily translate into big penalties in the overall application. Performance is most greatly affected by the efficiency of the target scripting language and the types of operations your C code is performing.
|
As a rule of thumb, C++ programs require somewhat more processing than C programs, but this seems to be avoidable. Also, keep in mind that performance penalties in the type-checker don't necessarily translate into big penalties in the overall application. Performance is most greatly affected by the efficiency of the target scripting language and the types of operations your C code is performing.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : July 9, 2004</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -447,7 +447,5 @@ constraint, the <tt>%clear</tt> directive can be used :</p>
|
||||||
%clear Vector *;
|
%clear Vector *;
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
<hr>
|
|
||||||
<address>SWIG 1.3 - Last Modified : October 13, 2002</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -139,7 +139,6 @@ then <tt>ilrun runme</tt> (Portable.NET C# compiler) or <tt>mono runme</tt> (Mon
|
||||||
Windows users can also get the examples working using a
|
Windows users can also get the examples working using a
|
||||||
<a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> environment for automatic configuration of the example makefiles.
|
<a href="http://www.cygwin.com">Cygwin</a> or <a href="http://www.mingw.org">MinGW</a> environment for automatic configuration of the example makefiles.
|
||||||
Any one of the three C# compilers (Portable.NET, Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path.
|
Any one of the three C# compilers (Portable.NET, Mono or Microsoft) can be detected from within a Cygwin or Mingw environment if installed in your path.
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -541,5 +541,6 @@
|
||||||
<ul>
|
<ul>
|
||||||
<li>No exception handling.</li>
|
<li>No exception handling.</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -91,7 +91,7 @@
|
||||||
<li><a href="Scripting.html#Scripting_nn5">Variable linking</a>
|
<li><a href="Scripting.html#Scripting_nn5">Variable linking</a>
|
||||||
<li><a href="Scripting.html#Scripting_nn6">Constants</a>
|
<li><a href="Scripting.html#Scripting_nn6">Constants</a>
|
||||||
<li><a href="Scripting.html#Scripting_nn7">Structures and classes</a>
|
<li><a href="Scripting.html#Scripting_nn7">Structures and classes</a>
|
||||||
<li><a href="Scripting.html#Scripting_nn8">Shadow classes</a>
|
<li><a href="Scripting.html#Scripting_nn8">Proxy classes</a>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="Scripting.html#Scripting_nn9">Building scripting language extensions</a>
|
<li><a href="Scripting.html#Scripting_nn9">Building scripting language extensions</a>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -501,7 +501,7 @@
|
||||||
<li><a href="Guile.html#Guile_nn17">Exception Handling</a>
|
<li><a href="Guile.html#Guile_nn17">Exception Handling</a>
|
||||||
<li><a href="Guile.html#Guile_nn18">Procedure documentation</a>
|
<li><a href="Guile.html#Guile_nn18">Procedure documentation</a>
|
||||||
<li><a href="Guile.html#Guile_nn19">Procedures with setters</a>
|
<li><a href="Guile.html#Guile_nn19">Procedures with setters</a>
|
||||||
<li><a href="Guile.html#Guile_nn20">GOOPS Shadow Classes</a>
|
<li><a href="Guile.html#Guile_nn20">GOOPS Proxy Classes</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Guile.html#Guile_nn21">Naming Issues</a>
|
<li><a href="Guile.html#Guile_nn21">Naming Issues</a>
|
||||||
<li><a href="Guile.html#Guile_nn22">Linking</a>
|
<li><a href="Guile.html#Guile_nn22">Linking</a>
|
||||||
|
|
@ -787,8 +787,9 @@
|
||||||
<li><a href="Perl5.html#Perl5_nn41">Structure and class wrappers</a>
|
<li><a href="Perl5.html#Perl5_nn41">Structure and class wrappers</a>
|
||||||
<li><a href="Perl5.html#Perl5_nn42">Object Ownership</a>
|
<li><a href="Perl5.html#Perl5_nn42">Object Ownership</a>
|
||||||
<li><a href="Perl5.html#Perl5_nn43">Nested Objects</a>
|
<li><a href="Perl5.html#Perl5_nn43">Nested Objects</a>
|
||||||
<li><a href="Perl5.html#Perl5_nn44">Shadow Functions</a>
|
<li><a href="Perl5.html#Perl5_nn44">Proxy Functions</a>
|
||||||
<li><a href="Perl5.html#Perl5_nn45">Inheritance</a>
|
<li><a href="Perl5.html#Perl5_nn45">Inheritance</a>
|
||||||
|
<li><a href="Perl5.html#Perl5_nn46">Modifying the proxy methods</a>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
@ -807,7 +808,7 @@
|
||||||
<li><a href="Php.html#Php_nn8">Pointers </a>
|
<li><a href="Php.html#Php_nn8">Pointers </a>
|
||||||
<li><a href="Php.html#Php_nn9">Structures and C++ classes</a>
|
<li><a href="Php.html#Php_nn9">Structures and C++ classes</a>
|
||||||
<li><a href="Php.html#Php_nn10">Constants</a>
|
<li><a href="Php.html#Php_nn10">Constants</a>
|
||||||
<li><a href="Php.html#Php_nn11">Shadow classes</a>
|
<li><a href="Php.html#Php_nn11">Proxy classes</a>
|
||||||
<li><a href="Php.html#Php_nn12">Constructors and Destructers</a>
|
<li><a href="Php.html#Php_nn12">Constructors and Destructers</a>
|
||||||
<li><a href="Php.html#Php_nn13">Static Member Variables</a>
|
<li><a href="Php.html#Php_nn13">Static Member Variables</a>
|
||||||
<li><a href="Php.html#Php_nn14">PHP4 Pragmas</a>
|
<li><a href="Php.html#Php_nn14">PHP4 Pragmas</a>
|
||||||
|
|
@ -1058,7 +1059,7 @@
|
||||||
<li><a href="Tcl.html#Tcl_nn43">Turning a SWIG module into a Tcl Package.</a>
|
<li><a href="Tcl.html#Tcl_nn43">Turning a SWIG module into a Tcl Package.</a>
|
||||||
<li><a href="Tcl.html#Tcl_nn44">Building new kinds of Tcl interfaces (in Tcl)</a>
|
<li><a href="Tcl.html#Tcl_nn44">Building new kinds of Tcl interfaces (in Tcl)</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="Tcl.html#Tcl_nn45">Shadow classes</a>
|
<li><a href="Tcl.html#Tcl_nn45">Proxy classes</a>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
|
||||||
|
|
@ -238,8 +238,5 @@ release.
|
||||||
Contract support was implemented by Songyan (Tiger) Feng and first appeared
|
Contract support was implemented by Songyan (Tiger) Feng and first appeared
|
||||||
in SWIG-1.3.20.
|
in SWIG-1.3.20.
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : November 12, 2003</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -671,8 +671,5 @@ public:
|
||||||
|
|
||||||
Further details of <tt>%feature</tt> usage is described in the documentation for specific language modules.
|
Further details of <tt>%feature</tt> usage is described in the documentation for specific language modules.
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : June 28, 2004</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -2460,8 +2460,8 @@ void Language::main(int argc, char *argv[]) {
|
||||||
} else {
|
} else {
|
||||||
Swig_arg_error();
|
Swig_arg_error();
|
||||||
}
|
}
|
||||||
} else if ((strcmp(argv[i],"-shadow") == 0) || ((strcmp(argv[i],"-proxy") == 0))) {
|
} else if ( (strcmp(argv[i],"-proxy") == 0)) {
|
||||||
shadow = 1;
|
proxy_flag = 1;
|
||||||
Swig_mark_arg(i);
|
Swig_mark_arg(i);
|
||||||
} else if (strcmp(argv[i],"-keyword") == 0) {
|
} else if (strcmp(argv[i],"-keyword") == 0) {
|
||||||
use_kw = 1;
|
use_kw = 1;
|
||||||
|
|
@ -3198,8 +3198,5 @@ extern "X" { ... } declaration.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : January 22, 2002</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
<li><a href="#Guile_nn17">Exception Handling</a>
|
<li><a href="#Guile_nn17">Exception Handling</a>
|
||||||
<li><a href="#Guile_nn18">Procedure documentation</a>
|
<li><a href="#Guile_nn18">Procedure documentation</a>
|
||||||
<li><a href="#Guile_nn19">Procedures with setters</a>
|
<li><a href="#Guile_nn19">Procedures with setters</a>
|
||||||
<li><a href="#Guile_nn20">GOOPS Shadow Classes</a>
|
<li><a href="#Guile_nn20">GOOPS Proxy Classes</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#Guile_nn21">Naming Issues</a>
|
<li><a href="#Guile_nn21">Naming Issues</a>
|
||||||
<li><a href="#Guile_nn22">Linking</a>
|
<li><a href="#Guile_nn22">Linking</a>
|
||||||
|
|
@ -537,7 +537,7 @@ struct members, the procedures <code>(<var>struct</var>-<var>member</var>-get
|
||||||
pointer)</code> and <code>(<var>struct-member</var>-set pointer
|
pointer)</code> and <code>(<var>struct-member</var>-set pointer
|
||||||
value)</code> are <em>not</em> generated.
|
value)</code> are <em>not</em> generated.
|
||||||
|
|
||||||
<H2><a name="Guile_nn20"></a>18.10 GOOPS Shadow Classes</H2>
|
<H2><a name="Guile_nn20"></a>18.10 GOOPS Proxy Classes</H2>
|
||||||
|
|
||||||
|
|
||||||
<p>SWIG can also generate classes and generic functions for use with
|
<p>SWIG can also generate classes and generic functions for use with
|
||||||
|
|
@ -548,7 +548,7 @@ System (CLOS).
|
||||||
<p>GOOPS support is
|
<p>GOOPS support is
|
||||||
only available with the new SCM interface (enabled with the
|
only available with the new SCM interface (enabled with the
|
||||||
<code>-scm</code> command-line option of SWIG). To enable GOOPS
|
<code>-scm</code> command-line option of SWIG). To enable GOOPS
|
||||||
support, pass the <code>-shadow</code> argument to
|
support, pass the <code>-proxy</code> argument to
|
||||||
swig. This will export the GOOPS wrapper definitions into the
|
swig. This will export the GOOPS wrapper definitions into the
|
||||||
<code><i>module</i>.scm</code> file in the directory specified by -outdir or the
|
<code><i>module</i>.scm</code> file in the directory specified by -outdir or the
|
||||||
current directory. GOOPS support requires either passive or module linkage.</p>
|
current directory. GOOPS support requires either passive or module linkage.</p>
|
||||||
|
|
@ -816,6 +816,5 @@ Currently, SWIG does not automatically export this line; it must be included in
|
||||||
directive of <code>mod2</code>. Maybe in the future SWIG can detect dependencies and export this line.
|
directive of <code>mod2</code>. Maybe in the future SWIG can detect dependencies and export this line.
|
||||||
(how do other language modules handle this problem?)</p>
|
(how do other language modules handle this problem?)</p>
|
||||||
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -367,7 +367,5 @@ of the programmer's way----the last thing any developer wants to do is
|
||||||
to spend their time debugging the output of a tool that relies on
|
to spend their time debugging the output of a tool that relies on
|
||||||
non-portable or unreliable programming features.
|
non-portable or unreliable programming features.
|
||||||
|
|
||||||
<hr>
|
|
||||||
<address>SWIG 1.3 - Last Modified : August 10, 2002</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1424,7 +1424,5 @@ For example:
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
|
|
||||||
<hr>
|
|
||||||
<address>SWIG 1.3 - Last Modified : May 29, 2002</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -218,8 +218,5 @@ Normally wrappers are generated for both methods, whereas this command line opti
|
||||||
Normal polymorphic behaviour remains as <tt>Derived::method</tt> will still be called should you have
|
Normal polymorphic behaviour remains as <tt>Derived::method</tt> will still be called should you have
|
||||||
a <tt>Derived</tt> instance and call the wrapper for <tt>Base::method</tt>.
|
a <tt>Derived</tt> instance and call the wrapper for <tt>Base::method</tt>.
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : July 9, 2004</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -941,5 +941,6 @@ values will read zero, and struct or object returns have undefined results.
|
||||||
Catching exceptions is now supported using SWIG's %exception feature. A simple
|
Catching exceptions is now supported using SWIG's %exception feature. A simple
|
||||||
but not too useful example is provided by the throw_exception testcase in
|
but not too useful example is provided by the throw_exception testcase in
|
||||||
Examples/test-suite. You can provide your own exceptions, too.
|
Examples/test-suite. You can provide your own exceptions, too.
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
<li><a href="#Php_nn8">Pointers </a>
|
<li><a href="#Php_nn8">Pointers </a>
|
||||||
<li><a href="#Php_nn9">Structures and C++ classes</a>
|
<li><a href="#Php_nn9">Structures and C++ classes</a>
|
||||||
<li><a href="#Php_nn10">Constants</a>
|
<li><a href="#Php_nn10">Constants</a>
|
||||||
<li><a href="#Php_nn11">Shadow classes</a>
|
<li><a href="#Php_nn11">Proxy classes</a>
|
||||||
<li><a href="#Php_nn12">Constructors and Destructers</a>
|
<li><a href="#Php_nn12">Constructors and Destructers</a>
|
||||||
<li><a href="#Php_nn13">Static Member Variables</a>
|
<li><a href="#Php_nn13">Static Member Variables</a>
|
||||||
<li><a href="#Php_nn14">PHP4 Pragmas</a>
|
<li><a href="#Php_nn14">PHP4 Pragmas</a>
|
||||||
|
|
@ -43,9 +43,9 @@ still under development so some of the features below may not work properly
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
The PHP4 module has undergone a lot of changes recently affecting the
|
The PHP4 module has undergone a lot of changes recently affecting the
|
||||||
way shadow classes are implemented so you should read this document even
|
way proxy classes are implemented so you should read this document even
|
||||||
if you thought you were familiar with what it said. The major change is
|
if you thought you were familiar with what it said. The major change is
|
||||||
that shadow classes are implemented inside the php module in C++ instead
|
that proxy classes are implemented inside the php module in C++ instead
|
||||||
of in the generated .php file in php.
|
of in the generated .php file in php.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -292,7 +292,7 @@ Vector_magnitude($obj);
|
||||||
|
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
To use the class, simply use these functions. However, SWIG also has a mechanism
|
To use the class, simply use these functions. However, SWIG also has a mechanism
|
||||||
for creating shadow classes that hides these functions and uses an object
|
for creating proxy classes that hides these functions and uses an object
|
||||||
oriented interface instead - see <a href="n7">below</a>
|
oriented interface instead - see <a href="n7">below</a>
|
||||||
|
|
||||||
<H3><a name="Php_nn10"></a>24.2.7 Constants</H3>
|
<H3><a name="Php_nn10"></a>24.2.7 Constants</H3>
|
||||||
|
|
@ -404,27 +404,27 @@ both point to the same value, without the case test taking place.
|
||||||
( Apologies, this paragraph needs rewritting to make some sense. )
|
( Apologies, this paragraph needs rewritting to make some sense. )
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Php_nn11"></a>24.2.8 Shadow classes</H3>
|
<H3><a name="Php_nn11"></a>24.2.8 Proxy classes</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To avoid having to call the various accessor function to get at structures or
|
To avoid having to call the various accessor function to get at structures or
|
||||||
class members, we can turn C structs and C++ classes into PHP classes that
|
class members, we can turn C structs and C++ classes into PHP classes that
|
||||||
can be be used directly in PHP scripts as objects and object methods. This is done by writing additional PHP code that builds PHP classes on top of the low-level SWIG interface. These PHP classes "shadow" an underlying C/C++ class.
|
can be be used directly in PHP scripts as objects and object methods. This is done by writing additional PHP code that builds PHP classes on top of the low-level SWIG interface. These PHP classes shadow or proxy an underlying C/C++ class.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
To have SWIG create shadow classes, use the <tt>-shadow</tt> option :
|
To have SWIG create proxy classes, use the <tt>-proxy</tt> option :
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
% swig -php4 -shadow tbc.i
|
% swig -php4 -proxy tbc.i
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
This will produce the same files as before except that the final module
|
This will produce the same files as before except that the final module
|
||||||
will declare internal PHP classes with the same names as the classes in
|
will declare internal PHP classes with the same names as the classes in
|
||||||
your .i file. No longer are the shadow classes defined in
|
your .i file. No longer are the proxy classes defined in
|
||||||
the <tt>.php</tt> file, it will not contain significantly more support PHP
|
the <tt>.php</tt> file, it will not contain significantly more support PHP
|
||||||
code.
|
code.
|
||||||
</p>
|
</p>
|
||||||
|
|
|
||||||
|
|
@ -206,3 +206,6 @@ SWIG will generate a <tt>Shape_print()</tt> method that invokes the static
|
||||||
<tt>Shape::print()</tt> member function, as well as a pair of methods,
|
<tt>Shape::print()</tt> member function, as well as a pair of methods,
|
||||||
<tt>Shape_nshapes_get()</tt> and <tt>Shape_nshapes_set()</tt>, to get and set
|
<tt>Shape_nshapes_get()</tt> and <tt>Shape_nshapes_set()</tt>, to get and set
|
||||||
the value of <tt>Shape::nshapes</tt>.
|
the value of <tt>Shape::nshapes</tt>.
|
||||||
|
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,5 @@ core dump occurred), corresponding portions of the SWIG interface file
|
||||||
used, and any important pieces of the SWIG generated wrapper code. We
|
used, and any important pieces of the SWIG generated wrapper code. We
|
||||||
can only fix bugs if we know about them.
|
can only fix bugs if we know about them.
|
||||||
|
|
||||||
<hr>
|
|
||||||
<address>SWIG 1.3 - Last Modified : March 9, 2003</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -335,8 +335,5 @@ Instead the results after the preprocessor has run are displayed.
|
||||||
This might be useful as an aid to debugging and viewing the results of macro expansions.
|
This might be useful as an aid to debugging and viewing the results of macro expansions.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : March 9, 2003</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -1782,7 +1782,7 @@ These wrappers can be found in the low-level extension module (e.g., <tt>_exampl
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Using these wrappers, SWIG generates a high-level Python proxy class like this (shown
|
Using these wrappers, SWIG generates a high-level Python proxy class (also known as a shadow class) like this (shown
|
||||||
for Python 2.2):
|
for Python 2.2):
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -3847,14 +3847,11 @@ if ((SWIG_ConvertPtr($input,(void **) &$1, $descriptor(Foo *),
|
||||||
|
|
||||||
Although the pointer handling functions are primarily intended for
|
Although the pointer handling functions are primarily intended for
|
||||||
manipulating low-level pointers, both functions are fully aware of
|
manipulating low-level pointers, both functions are fully aware of
|
||||||
Python shadow classes (described shortly). Specifically,
|
Python proxy classes. Specifically,
|
||||||
<tt>SWIG_ConvertPtr()</tt> will retrieve a pointer from any object
|
<tt>SWIG_ConvertPtr()</tt> will retrieve a pointer from any object
|
||||||
that has a <tt>this</tt> attribute. In addition,
|
that has a <tt>this</tt> attribute. In addition,
|
||||||
<tt>SWIG_NewPointerObj()</tt> can automatically generate a shadow
|
<tt>SWIG_NewPointerObj()</tt> can automatically generate a proxy
|
||||||
class object (if applicable).
|
class object (if applicable).
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : August 7, 2002</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -81,7 +81,6 @@
|
||||||
|
|
||||||
|
|
||||||
<p>This chapter describes SWIG's support of Ruby. </p>
|
<p>This chapter describes SWIG's support of Ruby. </p>
|
||||||
<hr><a name="n2"></a>
|
|
||||||
<H2><a name="Ruby_nn2"></a>27.1 Preliminaries</H2>
|
<H2><a name="Ruby_nn2"></a>27.1 Preliminaries</H2>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -273,7 +272,7 @@ into your extension, e.g.
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>require 'mkmf'<br>$libs = append_library($libs, "supc++")<br>create_makefile('example')<br></pre>
|
<pre>require 'mkmf'<br>$libs = append_library($libs, "supc++")<br>create_makefile('example')<br></pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<hr>
|
|
||||||
<H2><a name="Ruby_nn9"></a>27.2 Building Ruby Extensions under Windows 95/NT</H2>
|
<H2><a name="Ruby_nn9"></a>27.2 Building Ruby Extensions under Windows 95/NT</H2>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -390,7 +389,6 @@ Foo = 3.0
|
||||||
</pre>
|
</pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
|
|
||||||
<hr><a name="n11"></a>
|
|
||||||
<H2><a name="Ruby_nn11"></a>27.3 The Ruby-to-C/C++ Mapping</H2>
|
<H2><a name="Ruby_nn11"></a>27.3 The Ruby-to-C/C++ Mapping</H2>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1058,7 +1056,6 @@ using the <tt>rb_rescue2()</tt> function from Ruby's C API. If any
|
||||||
Ruby exception
|
Ruby exception
|
||||||
is raised, it will be caught here and a C++ exception is raised in its
|
is raised, it will be caught here and a C++ exception is raised in its
|
||||||
place.
|
place.
|
||||||
<hr><a name="n27"></a>
|
|
||||||
<H2><a name="Ruby_nn27"></a>27.4 Input and output parameters</H2>
|
<H2><a name="Ruby_nn27"></a>27.4 Input and output parameters</H2>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1133,7 +1130,6 @@ In Ruby:
|
||||||
<blockquote>
|
<blockquote>
|
||||||
<pre>r, c = Example.get_dimensions(m)<br></pre>
|
<pre>r, c = Example.get_dimensions(m)<br></pre>
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<hr>
|
|
||||||
<H2><a name="Ruby_nn28"></a>27.5 Simple exception handling </H2>
|
<H2><a name="Ruby_nn28"></a>27.5 Simple exception handling </H2>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1188,7 +1184,6 @@ the standard
|
||||||
Ruby exception classes, consult a Ruby reference such as <a
|
Ruby exception classes, consult a Ruby reference such as <a
|
||||||
href="http://www.rubycentral.com/book"><em>Programming Ruby</em></a>.
|
href="http://www.rubycentral.com/book"><em>Programming Ruby</em></a>.
|
||||||
</p>
|
</p>
|
||||||
<hr><a name="n29"></a>
|
|
||||||
<H2><a name="Ruby_nn29"></a>27.6 Typemaps</H2>
|
<H2><a name="Ruby_nn29"></a>27.6 Typemaps</H2>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1789,7 +1784,6 @@ wraps that pointer with <tt>Data_Wrap_Struct()</tt> as above.
|
||||||
from the data object
|
from the data object
|
||||||
<i>obj</i> and assigns that pointer to <i>ptr</i>.
|
<i>obj</i> and assigns that pointer to <i>ptr</i>.
|
||||||
</blockquote>
|
</blockquote>
|
||||||
<hr>
|
|
||||||
<H2><a name="ruby_operator_overloading"></a>27.7 Operator overloading</H2>
|
<H2><a name="ruby_operator_overloading"></a>27.7 Operator overloading</H2>
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -2232,7 +2226,6 @@ matching
|
||||||
rules used for other kinds of features apply (see the chapter on
|
rules used for other kinds of features apply (see the chapter on
|
||||||
<a href="Customization.html#Customization">"Customization Features"</a>)
|
<a href="Customization.html#Customization">"Customization Features"</a>)
|
||||||
for more details).
|
for more details).
|
||||||
<hr>
|
|
||||||
<address>SWIG 1.3 - Last Modified : $Date$</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -2130,7 +2130,7 @@ You can make a <tt>Vector</tt> look alot like a class by writing a SWIG interfac
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
Now, when used with shadow classes in Python, you can do things like
|
Now, when used with proxy classes in Python, you can do things like
|
||||||
this :</p>
|
this :</p>
|
||||||
|
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
|
|
@ -2345,7 +2345,7 @@ double Object_intRep_dvalue_get(Object_intRep *o) {
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
Although this process is a little hairy, it works like you would expect in the
|
Although this process is a little hairy, it works like you would expect in the
|
||||||
target scripting language--especially when shadow classes are used. For instance, in Perl:
|
target scripting language--especially when proxy classes are used. For instance, in Perl:
|
||||||
|
|
||||||
<blockquote><pre>
|
<blockquote><pre>
|
||||||
# Perl5 script for accessing nested member
|
# Perl5 script for accessing nested member
|
||||||
|
|
@ -2764,8 +2764,5 @@ is a side effect of the symbol binding mechanism used in the dynamic linker.
|
||||||
The bottom line: don't do this.
|
The bottom line: don't do this.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : August 7, 2003</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -3864,8 +3864,5 @@ If you're wrapping serious C++ code, you might want to pick up a copy
|
||||||
of "The Annotated C++ Reference Manual" by Ellis and Stroustrup. This
|
of "The Annotated C++ Reference Manual" by Ellis and Stroustrup. This
|
||||||
is the reference document we use to guide a lot of SWIG's C++ support.
|
is the reference document we use to guide a lot of SWIG's C++ support.
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : April 3, 2003</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
<li><a href="#Scripting_nn5">Variable linking</a>
|
<li><a href="#Scripting_nn5">Variable linking</a>
|
||||||
<li><a href="#Scripting_nn6">Constants</a>
|
<li><a href="#Scripting_nn6">Constants</a>
|
||||||
<li><a href="#Scripting_nn7">Structures and classes</a>
|
<li><a href="#Scripting_nn7">Structures and classes</a>
|
||||||
<li><a href="#Scripting_nn8">Shadow classes</a>
|
<li><a href="#Scripting_nn8">Proxy classes</a>
|
||||||
</ul>
|
</ul>
|
||||||
<li><a href="#Scripting_nn9">Building scripting language extensions</a>
|
<li><a href="#Scripting_nn9">Building scripting language extensions</a>
|
||||||
<ul>
|
<ul>
|
||||||
|
|
@ -267,15 +267,15 @@ internals of an object, the interpreter does not need to know anything
|
||||||
about the actual representation of a <tt>Vector</tt>.
|
about the actual representation of a <tt>Vector</tt>.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Scripting_nn8"></a>4.2.5 Shadow classes</H3>
|
<H3><a name="Scripting_nn8"></a>4.2.5 Proxy classes</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
In certain cases, it is possible to use the low-level accessor functions
|
In certain cases, it is possible to use the low-level accessor functions
|
||||||
to create something known as a "shadow" class.
|
to create a proxy class, also known as a shadow class.
|
||||||
A "shadow class" is a special kind of object that gets created
|
A proxy class is a special kind of object that gets created
|
||||||
in a scripting language to access a C/C++ class (or struct) in a way
|
in a scripting language to access a C/C++ class (or struct) in a way
|
||||||
that looks like the original structure (that is, it "shadows" the real
|
that looks like the original structure (that is, it proxies the real
|
||||||
C++ class). For example, if you
|
C++ class). For example, if you
|
||||||
have the following C definition :</p>
|
have the following C definition :</p>
|
||||||
|
|
||||||
|
|
@ -289,7 +289,7 @@ public:
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
A shadow classing mechanism would allow you to access the structure in
|
A proxy classing mechanism would allow you to access the structure in
|
||||||
a more natural manner from the interpreter. For example, in Python, you might want to do this:
|
a more natural manner from the interpreter. For example, in Python, you might want to do this:
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|
@ -322,7 +322,7 @@ v configure -x 3 -y 4 -z 13
|
||||||
</pre></blockquote>
|
</pre></blockquote>
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
When shadow classes are used, two objects are at really work--one in
|
When proxy classes are used, two objects are at really work--one in
|
||||||
the scripting language, and an underlying C/C++ object. Operations
|
the scripting language, and an underlying C/C++ object. Operations
|
||||||
affect both objects equally and for all practical purposes, it appears
|
affect both objects equally and for all practical purposes, it appears
|
||||||
as if you are simply manipulating a C/C++ object.
|
as if you are simply manipulating a C/C++ object.
|
||||||
|
|
@ -453,7 +453,5 @@ extensions. In fact, there are very few practical reasons for doing this--consi
|
||||||
using shared libraries instead.
|
using shared libraries instead.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
|
||||||
<address>SWIG 1.3 - Last Modified : July 16, 2001</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
<li><a href="#Tcl_nn43">Turning a SWIG module into a Tcl Package.</a>
|
<li><a href="#Tcl_nn43">Turning a SWIG module into a Tcl Package.</a>
|
||||||
<li><a href="#Tcl_nn44">Building new kinds of Tcl interfaces (in Tcl)</a>
|
<li><a href="#Tcl_nn44">Building new kinds of Tcl interfaces (in Tcl)</a>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="#Tcl_nn45">Shadow classes</a>
|
<li><a href="#Tcl_nn45">Proxy classes</a>
|
||||||
</ul>
|
</ul>
|
||||||
</ul>
|
</ul>
|
||||||
<!-- INDEX -->
|
<!-- INDEX -->
|
||||||
|
|
@ -3062,11 +3062,12 @@ danger of blowing something up (although it is easily accomplished
|
||||||
with an out of bounds array access).
|
with an out of bounds array access).
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<H3><a name="Tcl_nn45"></a>28.9.1 Shadow classes</H3>
|
<H3><a name="Tcl_nn45"></a>28.9.1 Proxy classes</H3>
|
||||||
|
|
||||||
|
|
||||||
<p>
|
<p>
|
||||||
A similar approach can be applied to shadow classes. The following
|
A similar approach can be applied to proxy classes (also known as
|
||||||
|
shadow classes). The following
|
||||||
example is provided by Erik Bierwagen and Paul Saxe. To use it, run
|
example is provided by Erik Bierwagen and Paul Saxe. To use it, run
|
||||||
SWIG with the <tt>-noobject</tt> option (which disables the builtin
|
SWIG with the <tt>-noobject</tt> option (which disables the builtin
|
||||||
object oriented interface). When running Tcl, simply source this
|
object oriented interface). When running Tcl, simply source this
|
||||||
|
|
@ -3182,8 +3183,5 @@ short, but clever Tcl script can be combined with SWIG to do many
|
||||||
interesting things.
|
interesting things.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : May 28, 2002</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -3184,8 +3184,5 @@ for how to define typemaps of your own.
|
||||||
Some of the language modules support additional typemaps and further
|
Some of the language modules support additional typemaps and further
|
||||||
information is available in the individual chapters for each target language.
|
information is available in the individual chapters for each target language.
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : July 2 , 2004</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -845,8 +845,5 @@ Also, be aware of the platform dependencies and reliability issues that
|
||||||
this will introduce. Good luck.
|
this will introduce. Good luck.
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<hr>
|
|
||||||
|
|
||||||
<address>SWIG 1.3 - Last Modified : March 24, 2002</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
|
|
@ -453,7 +453,5 @@ These numbers can be used by your own application.
|
||||||
|
|
||||||
The ability to control warning messages was first added to SWIG-1.3.12.
|
The ability to control warning messages was first added to SWIG-1.3.12.
|
||||||
|
|
||||||
<hr>
|
|
||||||
<address>SWIG 1.3 - Last Modified : June 28, 2003</address>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue