| 1 |
<html><head> |
|---|
| 2 |
<META http-equiv="content-type" content="text/html; charset=utf-8"> |
|---|
| 3 |
<title>pyd.class_wrap</title> |
|---|
| 4 |
</head><body> |
|---|
| 5 |
<h1>pyd.class_wrap</h1> |
|---|
| 6 |
<!-- Generated by Ddoc from pyd\class_wrap.d --> |
|---|
| 7 |
<br><br> |
|---|
| 8 |
<dl><dt><big>struct <u>wrapped_class_object</u>; |
|---|
| 9 |
</big></dt> |
|---|
| 10 |
<dd>The class object, a subtype of PyObject |
|---|
| 11 |
<br><br> |
|---|
| 12 |
|
|---|
| 13 |
<dl></dl> |
|---|
| 14 |
</dd> |
|---|
| 15 |
<dt><big>template wrapped_class_type(T)</big></dt> |
|---|
| 16 |
<dd><br><br> |
|---|
| 17 |
<dl><dt><big>PyTypeObject <u>wrapped_class_type</u>; |
|---|
| 18 |
</big></dt> |
|---|
| 19 |
<dd>The type object, an instance of PyType_Type |
|---|
| 20 |
<br><br> |
|---|
| 21 |
|
|---|
| 22 |
</dd> |
|---|
| 23 |
</dl> |
|---|
| 24 |
</dd> |
|---|
| 25 |
<dt><big>template wrapped_methods(T)</big></dt> |
|---|
| 26 |
<dd>Various wrapped methods |
|---|
| 27 |
<br><br> |
|---|
| 28 |
|
|---|
| 29 |
<dl><dt><big>PyObject* <u>wrapped_new</u>(PyTypeObject* <i>type</i>, PyObject* <i>args</i>, PyObject* <i>kwds</i>); |
|---|
| 30 |
</big></dt> |
|---|
| 31 |
<dd>The generic "_new__" method |
|---|
| 32 |
<br><br> |
|---|
| 33 |
|
|---|
| 34 |
</dd> |
|---|
| 35 |
<dt><big>void <u>wrapped_dealloc</u>(PyObject* <i>_self</i>); |
|---|
| 36 |
</big></dt> |
|---|
| 37 |
<dd>The generic dealloc method. |
|---|
| 38 |
<br><br> |
|---|
| 39 |
|
|---|
| 40 |
</dd> |
|---|
| 41 |
</dl> |
|---|
| 42 |
</dd> |
|---|
| 43 |
<dt><big>template wrapped_init(T)</big></dt> |
|---|
| 44 |
<dd><br><br> |
|---|
| 45 |
<dl><dt><big>int <u>init</u>(PyObject* <i>self</i>, PyObject* <i>args</i>, PyObject* <i>kwds</i>); |
|---|
| 46 |
</big></dt> |
|---|
| 47 |
<dd>The default init method calls the class's zero-argument constructor. |
|---|
| 48 |
<br><br> |
|---|
| 49 |
|
|---|
| 50 |
</dd> |
|---|
| 51 |
</dl> |
|---|
| 52 |
</dd> |
|---|
| 53 |
<dt><big>template wrapped_get(T,alias Fn)</big></dt> |
|---|
| 54 |
<dd><br><br> |
|---|
| 55 |
<dl><dt><big>PyObject* <u>func</u>(PyObject* <i>self</i>, void* <i>closure</i>); |
|---|
| 56 |
</big></dt> |
|---|
| 57 |
<dd>A generic wrapper around a "getter" property. |
|---|
| 58 |
<br><br> |
|---|
| 59 |
|
|---|
| 60 |
</dd> |
|---|
| 61 |
</dl> |
|---|
| 62 |
</dd> |
|---|
| 63 |
<dt><big>template wrapped_set(T,alias Fn)</big></dt> |
|---|
| 64 |
<dd><br><br> |
|---|
| 65 |
<dl><dt><big>int <u>func</u>(PyObject* <i>self</i>, PyObject* <i>value</i>, void* <i>closure</i>); |
|---|
| 66 |
</big></dt> |
|---|
| 67 |
<dd>A generic wrapper around a "setter" property. |
|---|
| 68 |
<br><br> |
|---|
| 69 |
|
|---|
| 70 |
</dd> |
|---|
| 71 |
</dl> |
|---|
| 72 |
</dd> |
|---|
| 73 |
<dt><big>template is_wrapped(T)</big></dt> |
|---|
| 74 |
<dd>A useful check for whether a given class has been wrapped. Mainly used by |
|---|
| 75 |
the conversion functions (see make_object.d), but possibly useful elsewhere. |
|---|
| 76 |
|
|---|
| 77 |
<br><br> |
|---|
| 78 |
|
|---|
| 79 |
<dl></dl> |
|---|
| 80 |
</dd> |
|---|
| 81 |
<dt><big>struct <u>wrapped_class</u>; |
|---|
| 82 |
</big></dt> |
|---|
| 83 |
<dd>This struct wraps a D class. Its member functions are the primary way of |
|---|
| 84 |
wrapping the specific parts of the class. |
|---|
| 85 |
|
|---|
| 86 |
<br><br> |
|---|
| 87 |
|
|---|
| 88 |
<dl><dt><big>template def(alias fn,char[] name,fn_t = typeof(&fn),uint MIN_ARGS = MIN_ARGS!(fn))</big></dt> |
|---|
| 89 |
<dd>Wraps a member function of the class. |
|---|
| 90 |
<br><br> |
|---|
| 91 |
<b>Params:</b><br> |
|---|
| 92 |
<table><tr><td>name</td> |
|---|
| 93 |
<td>The name of the function as it will appear in Python.</td></tr> |
|---|
| 94 |
<tr><td>fn</td> |
|---|
| 95 |
<td>The member function to wrap.</td></tr> |
|---|
| 96 |
<tr><td>MIN_ARGS</td> |
|---|
| 97 |
<td>The minimum number of arguments this function can accept.</td></tr> |
|---|
| 98 |
<tr><td>fn_t</td> |
|---|
| 99 |
<td>The type of the function. It is only useful to specify this |
|---|
| 100 |
if more than one function has the same name as this one.</td></tr> |
|---|
| 101 |
</table><br> |
|---|
| 102 |
|
|---|
| 103 |
<dl></dl> |
|---|
| 104 |
</dd> |
|---|
| 105 |
<dt><big>template prop(alias fn,char[] name,bool RO = false)</big></dt> |
|---|
| 106 |
<dd>Wraps a property of the class. |
|---|
| 107 |
<br><br> |
|---|
| 108 |
<b>Params:</b><br> |
|---|
| 109 |
<table><tr><td>name</td> |
|---|
| 110 |
<td>The name of the property as it will appear in Python.</td></tr> |
|---|
| 111 |
<tr><td>fn</td> |
|---|
| 112 |
<td>The property to wrap.</td></tr> |
|---|
| 113 |
<tr><td>RO</td> |
|---|
| 114 |
<td>Whether this is a read-only property.</td></tr> |
|---|
| 115 |
</table><br> |
|---|
| 116 |
|
|---|
| 117 |
<dl></dl> |
|---|
| 118 |
</dd> |
|---|
| 119 |
<dt><big>template init(C1 = Void,C2 = Void,C3 = Void,C4 = Void,C5 = Void,C6 = Void,C7 = Void,C8 = Void,C9 = Void,C10 = Void)</big></dt> |
|---|
| 120 |
<dd>Wraps the constructors of the class. |
|---|
| 121 |
<br><br> |
|---|
| 122 |
This template takes a series of specializations of the ctor template |
|---|
| 123 |
(see ctor_wrap.d), each of which describes a different constructor |
|---|
| 124 |
that the class supports. The default constructor need not be |
|---|
| 125 |
specified, and will always be available if the class supports it. |
|---|
| 126 |
|
|---|
| 127 |
<br><br> |
|---|
| 128 |
<font color=red>BUGS:</font><br> |
|---|
| 129 |
This currently does not support having multiple constructors with |
|---|
| 130 |
the same number of arguments. |
|---|
| 131 |
|
|---|
| 132 |
<br><br> |
|---|
| 133 |
|
|---|
| 134 |
<dl></dl> |
|---|
| 135 |
</dd> |
|---|
| 136 |
</dl> |
|---|
| 137 |
</dd> |
|---|
| 138 |
</dl> |
|---|
| 139 |
|
|---|
| 140 |
<hr><small>Page generated by <a href="http://www.digitalmars.com/d/ddoc.html">Ddoc</a>. </small> |
|---|
| 141 |
</body></html> |
|---|