typemap name changes:
inv => directorin outv => directorout argoutv => directorargout git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@5137 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
1b117a880a
commit
69d79e0674
24 changed files with 500 additions and 501 deletions
|
|
@ -99,7 +99,7 @@
|
|||
<li><a href="#n66">What are directors?</a>
|
||||
<li><a href="#n67">Director-specific typemaps</a>
|
||||
<ul>
|
||||
<li><a href="#n68">%typemap(inv)</a>
|
||||
<li><a href="#n68">%typemap(directorin)</a>
|
||||
<li><a href="#n69">%typemap(javadirectorin)</a>
|
||||
<li><a href="#n70">%typemap(javadirectorout)</a>
|
||||
</ul>
|
||||
|
|
@ -4159,21 +4159,21 @@ public class director_derived extends director_example
|
|||
|
||||
<p>
|
||||
The Java directors feature requires the <a
|
||||
href="#java_directors_inv"><code>%typemap(inv)</code></a>, the <a
|
||||
href="#java_directors_inv"><code>%typemap(directorin)</code></a>, the <a
|
||||
href="#java_directors_din"><code>%typemap(javadirectorin)</code></a> and the <a
|
||||
href="#java_directors_dout"><code>%typemap(javadirectorout)</code></a> type maps in
|
||||
order to work properly.
|
||||
</p>
|
||||
|
||||
<a name="n68"></a><H4>15.9.2.1 %typemap(inv)</H4>
|
||||
<a name="n68"></a><H4>15.9.2.1 %typemap(directorin)</H4>
|
||||
|
||||
|
||||
<p>
|
||||
The <code>%typemap(inv)</code> type map is used for converting arguments
|
||||
The <code>%typemap(directorin)</code> type map is used for converting arguments
|
||||
in the C++ director class to the appropriate JNI type before the upcall
|
||||
to Java. This typemap also specifies the JNI field descriptor for the
|
||||
type. For example, integers are converted as follows:
|
||||
<pre>%typemap(inv,parse="I") int "$input = (jint) $1;"</pre>
|
||||
<pre>%typemap(directorin,parse="I") int "$input = (jint) $1;"</pre>
|
||||
<code>$input</code> is the SWIG name of the JNI temporary variable passed to
|
||||
Java in the upcall. The <code>parse="I"</code> will put an <code>I</code>
|
||||
into the JNI field descriptor that identifies the Java method that will be
|
||||
|
|
@ -4183,7 +4183,7 @@ order to work properly.
|
|||
<p>
|
||||
A typemap for C character strings is:
|
||||
<br>
|
||||
<pre>%typemap(inv,parse="Ljava/lang/String;") char *
|
||||
<pre>%typemap(directorin,parse="Ljava/lang/String;") char *
|
||||
%{ $input = jenv->NewStringUTF($1); %}</pre>
|
||||
</p>
|
||||
<p>
|
||||
|
|
|
|||
|
|
@ -43,10 +43,10 @@
|
|||
<li><a href="#n25">Overriding Methods in Ocaml</a>
|
||||
<li><a href="#n26">Director Usage Example</a>
|
||||
<li><a href="#n27">Creating director objects</a>
|
||||
<li><a href="#n28">Typemaps for directors, <tt>inv, outv, argoutv</tt></a>
|
||||
<li><a href="#n29"><tt>inv</tt> typemap</a>
|
||||
<li><a href="#n30"><tt>outv</tt> typemap</a>
|
||||
<li><a href="#n31"><tt>argoutv</tt> typemap</a>
|
||||
<li><a href="#n28">Typemaps for directors, <tt>directorin, directorout, directorargout</tt></a>
|
||||
<li><a href="#n29"><tt>directorin</tt> typemap</a>
|
||||
<li><a href="#n30"><tt>directorout</tt> typemap</a>
|
||||
<li><a href="#n31"><tt>directorargout</tt> typemap</a>
|
||||
</ul>
|
||||
<li><a href="#n32">Exceptions</a>
|
||||
</ul>
|
||||
|
|
@ -839,51 +839,51 @@ consequently trigger an exception when any method is called on the object
|
|||
after that point (the actual raise is from an inner function used by
|
||||
new_derived_object, and throws NotObject).
|
||||
|
||||
<a name="n28"></a><H4>16.2.5.5 Typemaps for directors, <tt>inv, outv, argoutv</tt></H4>
|
||||
<a name="n28"></a><H4>16.2.5.5 Typemaps for directors, <tt>directorin, directorout, directorargout</tt></H4>
|
||||
|
||||
|
||||
<p>
|
||||
Special typemaps exist for use with directors, the <tt>inv, outv, argoutv</tt>
|
||||
Special typemaps exist for use with directors, the <tt>directorin, directorout, directorargout</tt>
|
||||
are used in place of <tt>in, out, argout</tt> typemaps, except that their
|
||||
direction is reversed. They provide for you to provide argout values, as
|
||||
well as a function return value in the same way you provide function arguments,
|
||||
and to receive arguments the same way you normally receive function returns.
|
||||
</P>
|
||||
<a name="n29"></a><H4>16.2.5.6 <tt>inv</tt> typemap</H4>
|
||||
<a name="n29"></a><H4>16.2.5.6 <tt>directorin</tt> typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
The <tt>inv</tt> typemap is used when you will receive arguments from a call
|
||||
The <tt>directorin</tt> typemap is used when you will receive arguments from a call
|
||||
made by C++ code to you, therefore, values will be translated from C++ to
|
||||
ocaml. You must provide some valid C_obj value. This is the value your ocaml
|
||||
code receives when you are called. In general, a simple <tt>inv</tt> typemap
|
||||
code receives when you are called. In general, a simple <tt>directorin</tt> typemap
|
||||
can use the same body as a simple <tt>out</tt> typemap.
|
||||
</p>
|
||||
|
||||
<a name="n30"></a><H4>16.2.5.7 <tt>outv</tt> typemap</H4>
|
||||
<a name="n30"></a><H4>16.2.5.7 <tt>directorout</tt> typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
The <tt>outv</tt> typemap is used when you will send an argument from your
|
||||
code back to the C++ caller. That is; outv specifies a function return
|
||||
The <tt>directorout</tt> typemap is used when you will send an argument from your
|
||||
code back to the C++ caller. That is; directorout specifies a function return
|
||||
conversion. You can usually use the same body as an <tt>in</tt> typemap
|
||||
for the same type, except when there are special requirements for object
|
||||
ownership, etc.
|
||||
</p>
|
||||
|
||||
<a name="n31"></a><H4>16.2.5.8 <tt>argoutv</tt> typemap</H4>
|
||||
<a name="n31"></a><H4>16.2.5.8 <tt>directorargout</tt> typemap</H4>
|
||||
|
||||
|
||||
<p>
|
||||
C++ allows function arguments which are by pointer (*) and by reference (&)
|
||||
to receive a value from the called function, as well as sending one there.
|
||||
Sometimes, this is the main purpose of the argument given. <tt>argoutv</tt>
|
||||
Sometimes, this is the main purpose of the argument given. <tt>directorargout</tt>
|
||||
typemaps allow your caml code to emulate this by specifying additional return
|
||||
values to be put into the output parameters. The SWIG ocaml module is a bit
|
||||
loose in order to make code eaiser to write. In this case, your return to
|
||||
the caller must be a list containing the normal function return first, followed
|
||||
by any argout values in order. These argout values will be taken from the
|
||||
list and assigned to the values to be returned to C++ through argoutv typemaps.
|
||||
list and assigned to the values to be returned to C++ through directorargout typemaps.
|
||||
In the event that you don't specify all of the necessary values, integral
|
||||
values will read zero, and struct or object returns have undefined results.
|
||||
</p>
|
||||
|
|
@ -895,4 +895,4 @@ 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
|
||||
Examples/test-suite. You can provide your own exceptions, too.
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -2223,7 +2223,7 @@ Python.
|
|||
Typemaps for input and output of most of the basic types from director
|
||||
classes have been written. These are roughly the reverse of the usual
|
||||
input and output typemaps used by the wrapper code. The typemap
|
||||
operation names are 'inv', 'outv', and 'argoutv'. The director code does
|
||||
operation names are 'directorin', 'directorout', and 'directorargout'. The director code does
|
||||
not use any of the other kinds of typemaps yet. It is not clear at this
|
||||
point which kinds are appropriate and need to be supported.
|
||||
<p>
|
||||
|
|
@ -3645,4 +3645,4 @@ class object (if applicable).
|
|||
|
||||
<address>SWIG 1.3 - Last Modified : August 7, 2002</address>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue