6
6
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
8
<title>Annotations — SIP v4.8.2 Reference Guide</title>
8
<title>Annotations — SIP v4.9 Reference Guide</title>
9
9
<link rel="stylesheet" href="_static/default.css" type="text/css" />
10
10
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
11
11
<script type="text/javascript">
12
12
var DOCUMENTATION_OPTIONS = {
15
15
COLLAPSE_MODINDEX: false,
16
16
FILE_SUFFIX: '.html',
20
20
<script type="text/javascript" src="_static/jquery.js"></script>
21
21
<script type="text/javascript" src="_static/doctools.js"></script>
22
<link rel="top" title="SIP v4.8.2 Reference Guide" href="index.html" />
22
<link rel="top" title="SIP v4.9 Reference Guide" href="index.html" />
23
23
<link rel="next" title="C API for Handwritten Code" href="c_api.html" />
24
24
<link rel="prev" title="Directives" href="directives.html" />
39
39
<li class="right" >
40
40
<a href="directives.html" title="Directives"
41
41
accesskey="P">previous</a> |</li>
42
<li><a href="index.html">SIP v4.8.2 Reference Guide</a> »</li>
42
<li><a href="index.html">SIP v4.9 Reference Guide</a> »</li>
74
74
<dt><em>string</em></dt>
75
75
<dd>The value is a double quoted string.</dd>
76
<dt><em>API range</em></dt>
77
<dd><p class="first">The value is the name of an API (defined using the <a class="reference external" href="directives.html#directive-%API"><tt class="xref docutils literal"><span class="pre">%API</span></tt></a>
78
directive) separated by a range of version numbers with a colon.</p>
79
<p>The range of version numbers is a pair of numbers separated by a hyphen
80
specifying the lower and upper bounds of the range. A version number is
81
within the range if it is greater or equal to the lower bound and less
82
than the upper bound. Each bound can be omitted meaning that the range is
83
unbounded in that direction.</p>
85
<div class="last highlight-python"><pre># This is part of the PyQt4 API up to but excluding v2.
86
void hex() /API=PyQt4:-2/
88
# This is part of the PyQt4 API starting from v2.
89
void hex() /PyName=hex_, API=PyQt4:2-/</pre>
77
93
<p>The following example shows argument and function annotations:</p>
78
94
<div class="highlight-python"><pre>void exec(QWidget * /Transfer/) /ReleaseGIL, PyName=call_exec/;</pre>
92
108
<dl class="argument-annotation">
93
109
<dt id="aanno-Array">
94
110
<tt class="descname">Array</tt><a class="headerlink" href="#aanno-Array" title="Permalink to this definition">¶</a></dt>
95
<dd><p>This boolean annotation specifies that the corresponding argument (which
96
should be either <tt class="docutils literal"><span class="pre">char</span> <span class="pre">*</span></tt> or <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">char</span> <span class="pre">*</span></tt>) refers to an array
97
rather than a <tt class="docutils literal"><span class="pre">'\0'</span></tt> terminated string. There must be a corresponding
98
argument with the <a class="reference internal" href="#aanno-ArraySize"><tt class="xref docutils literal"><span class="pre">ArraySize</span></tt></a> annotation specified. The annotation
99
may only be specified once in a list of arguments.</p>
100
<p>The annotation also implies the <a class="reference internal" href="#aanno-Encoding"><tt class="xref docutils literal"><span class="pre">Encoding</span></tt></a> annotation with an
101
encoding of <tt class="docutils literal"><span class="pre">"None"</span></tt>.</p>
111
<dd><p>This boolean annotation specifies that the corresponding argument refers
113
<p>The argument should be either a pointer to a wrapped type, a <tt class="docutils literal"><span class="pre">char</span> <span class="pre">*</span></tt> or
114
a <tt class="docutils literal"><span class="pre">unsigned</span> <span class="pre">char</span> <span class="pre">*</span></tt>. If the argument is a character array then the
115
annotation also implies the <a class="reference internal" href="#aanno-Encoding"><tt class="xref docutils literal"><span class="pre">Encoding</span></tt></a> annotation with an encoding
116
of <tt class="docutils literal"><span class="pre">"None"</span></tt>.</p>
117
<p>There must be a corresponding argument with the <a class="reference internal" href="#aanno-ArraySize"><tt class="xref docutils literal"><span class="pre">ArraySize</span></tt></a>
118
annotation specified. The annotation may only be specified once in a list
104
122
<dl class="argument-annotation">
287
305
<dl class="class-annotation">
307
<tt class="descname">API</tt><a class="headerlink" href="#canno-API" title="Permalink to this definition">¶</a></dt>
309
<span class="versionmodified">New in version 4.9.</span></p>
310
<p>This API range annotation is used to specify an API and corresponding
311
range of version numbers that the class is enabled for.</p>
312
<p>If a class or mapped type has different implementations enabled for
313
different ranges of version numbers then those ranges must not overlap.</p>
314
<p>See <a class="reference external" href="using.html#ref-incompat-apis"><em>Managing Incompatible APIs</em></a> for more detail.</p>
317
<dl class="class-annotation">
288
318
<dt id="canno-DelayDtor">
289
319
<tt class="descname">DelayDtor</tt><a class="headerlink" href="#canno-DelayDtor" title="Permalink to this definition">¶</a></dt>
290
320
<dd><p>This boolean annotation is used to specify that the class’s destructor
399
429
<div class="section" id="mapped-type-annotations">
400
430
<span id="ref-mapped-type-annos"></span><h2>Mapped Type Annotations<a class="headerlink" href="#mapped-type-annotations" title="Permalink to this headline">¶</a></h2>
401
431
<dl class="mapped-type-annotation">
432
<dt id="manno-AllowNone">
433
<tt class="descname">AllowNone</tt><a class="headerlink" href="#manno-AllowNone" title="Permalink to this definition">¶</a></dt>
434
<dd>Normally when a Python object is converted to a C/C++ instance <tt class="xref docutils literal"><span class="pre">None</span></tt>
435
is handled automatically before the mapped type’s
436
<a class="reference external" href="directives.html#directive-%ConvertToTypeCode"><tt class="xref docutils literal"><span class="pre">%ConvertToTypeCode</span></tt></a> is called. This boolean annotation
437
specifies that the handling of <tt class="xref docutils literal"><span class="pre">None</span></tt> will be left to the
438
<a class="reference external" href="directives.html#directive-%ConvertToTypeCode"><tt class="xref docutils literal"><span class="pre">%ConvertToTypeCode</span></tt></a>.</dd></dl>
440
<dl class="mapped-type-annotation">
442
<tt class="descname">API</tt><a class="headerlink" href="#manno-API" title="Permalink to this definition">¶</a></dt>
444
<span class="versionmodified">New in version 4.9.</span></p>
445
<p>This API range annotation is used to specify an API and corresponding
446
range of version numbers that the mapped type is enabled for.</p>
447
<p>If a class or mapped type has different implementations enabled for
448
different ranges of version numbers then those ranges must not overlap.</p>
449
<p>See <a class="reference external" href="using.html#ref-incompat-apis"><em>Managing Incompatible APIs</em></a> for more detail.</p>
452
<dl class="mapped-type-annotation">
402
453
<dt id="manno-NoRelease">
403
454
<tt class="descname">NoRelease</tt><a class="headerlink" href="#manno-NoRelease" title="Permalink to this definition">¶</a></dt>
404
455
<dd>This boolean annotation is used to specify that the mapped type does not
435
486
<div class="section" id="function-annotations">
436
487
<span id="ref-function-annos"></span><h2>Function Annotations<a class="headerlink" href="#function-annotations" title="Permalink to this headline">¶</a></h2>
437
488
<dl class="function-annotation">
490
<tt class="descname">API</tt><a class="headerlink" href="#fanno-API" title="Permalink to this definition">¶</a></dt>
492
<span class="versionmodified">New in version 4.9.</span></p>
493
<p>This API range annotation is used to specify an API and corresponding
494
range of version numbers that the function is enabled for.</p>
495
<p>See <a class="reference external" href="using.html#ref-incompat-apis"><em>Managing Incompatible APIs</em></a> for more detail.</p>
498
<dl class="function-annotation">
438
499
<dt id="fanno-AutoGen">
439
500
<tt class="descname">AutoGen</tt><a class="headerlink" href="#fanno-AutoGen" title="Permalink to this definition">¶</a></dt>
440
501
<dd>This optional name annotation is used with class methods to specify that
484
545
<dl class="function-annotation">
485
546
<dt id="fanno-NoArgParser">
486
547
<tt class="descname">NoArgParser</tt><a class="headerlink" href="#fanno-NoArgParser" title="Permalink to this definition">¶</a></dt>
487
<dd>This boolean annotation is used with global functions to specify that the
488
supplied <a class="reference external" href="directives.html#directive-%MethodCode"><tt class="xref docutils literal"><span class="pre">%MethodCode</span></tt></a> will handle the parsing of the arguments.</dd></dl>
548
<dd>This boolean annotation is used with methods and global functions to
549
specify that the supplied <a class="reference external" href="directives.html#directive-%MethodCode"><tt class="xref docutils literal"><span class="pre">%MethodCode</span></tt></a> will handle the parsing
550
of the arguments.</dd></dl>
490
552
<dl class="function-annotation">
491
553
<dt id="fanno-NoDerived">
709
771
<li class="right" >
710
772
<a href="directives.html" title="Directives"
711
773
>previous</a> |</li>
712
<li><a href="index.html">SIP v4.8.2 Reference Guide</a> »</li>
774
<li><a href="index.html">SIP v4.9 Reference Guide</a> »</li>
715
777
<div class="footer">
716
778
© Copyright 2009, Riverbank Computing Limited.
717
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.2.
779
Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.3.
b'\\ No newline at end of file'