mirror of
https://github.com/boostorg/python.git
synced 2026-01-22 17:32:55 +00:00
143 lines
4.7 KiB
HTML
143 lines
4.7 KiB
HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
|
<link rel="stylesheet" type="text/css" href="../boost.css">
|
|
|
|
<title>Boost.Python - <boost/python/opaque_pointer_converter.hpp></title>
|
|
</head>
|
|
|
|
<body>
|
|
<table border="0" cellpadding="7" cellspacing="0" width="100%" summary=
|
|
"header">
|
|
<tr>
|
|
<td valign="top" width="300">
|
|
<h3><a href="../../../../index.htm"><img height="86" width="277"
|
|
alt="C++ Boost" src="../../../../boost.png" border="0"></a></h3>
|
|
</td>
|
|
|
|
<td valign="top">
|
|
<h1 align="center"><a href="../index.html">Boost.Python</a></h1>
|
|
|
|
<h2 align="center">Header
|
|
<boost/python/opaque_pointer_converter.hpp></h2>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<hr>
|
|
|
|
<h2>Contents</h2>
|
|
|
|
<dl class="page-index">
|
|
<dt><a href="#classes">Classes</a></dt>
|
|
|
|
<dd>
|
|
<dl class="page-index">
|
|
<dt><a href="#opaque_pointer_converter-spec">Class template
|
|
<code>opaque_pointer_converter<P></code></a></dt>
|
|
|
|
<dd>
|
|
<dl class="page-index">
|
|
<dt><a href="#opaque_pointer_converter-spec-synopsis">Class template
|
|
<code>opaque_pointer_converter</code> synopsis</a></dt>
|
|
</dl>
|
|
</dd>
|
|
</dl>
|
|
</dd>
|
|
|
|
<dt><a href="#macros">Macros</a></dt>
|
|
<dd>
|
|
<dl class="page-index">
|
|
<dt><a href="#BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID-spec">Macro
|
|
<code>BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID</code></a></dt>
|
|
</dl>
|
|
</dd>
|
|
|
|
<dt><a href="#examples">Example</a></dt>
|
|
|
|
<dt><a href="#see-also">See Also</a></dt>
|
|
</dl>
|
|
<hr>
|
|
|
|
<h2><a name="classes"></a>Classes</h2>
|
|
|
|
<h3><a name="opaque_pointer_converter-spec"></a>Class template
|
|
<code>opaque_pointer_converter<P></code></h3>
|
|
|
|
<p><code>opaque_pointer_converter<></code> is derived from
|
|
<a href="to_python_converter.html#to_python_converter-spec">
|
|
<code>to_python_converter</code></a>
|
|
and registers itself as an
|
|
<a href="lvalue_from_pytype.html#lvalue_from_pytype-spec">
|
|
<code>lvalue_from_pytype</code></a> converter from Python objects
|
|
into pointers to undefined types.
|
|
Thus it may be used as a converter from opaque pointers into
|
|
Python objects and vice versa.</p>
|
|
|
|
<h4><a name="opaque_pointer_converter-spec-synopsis"></a>Class template
|
|
<code>opaque_pointer_converter</code> synopsis</h4>
|
|
<pre>
|
|
namespace boost { namespace python
|
|
{
|
|
template<class Pointer>
|
|
struct opaque_pointer_converter
|
|
: to_python_converter<
|
|
Pointer, opaque_pointer_converter<Pointer> >
|
|
{
|
|
explicit opaque_pointer_converter(char const* name);
|
|
};
|
|
}}
|
|
</pre>
|
|
|
|
<h4><a name="opaque_pointer_converter-spec-constructor"></a>Class template
|
|
<code>opaque_pointer_converter</code> constructor</h4>
|
|
<pre>
|
|
explicit opaque_pointer_converter(char const* name);
|
|
</pre>
|
|
|
|
<dl class="function-semantics">
|
|
<dt><b>Effects:</b>
|
|
<p>Registers the instance as a
|
|
<a href="lvalue_from_pytype.html#lvalue_from_pytype-spec">
|
|
<code>lvalue_from_pytype</code></a> converter from Python objects
|
|
into opaque pointers.</p>
|
|
<p>The name is used for the type of the Python Objects created;
|
|
it should be printable but needn't be an
|
|
<a href="definitions.html#ntbs">ntbs</a> because the object type is
|
|
not supposed to be user constructible within python scripts.</p>
|
|
</dt>
|
|
</dl>
|
|
|
|
<h2><a name="macros"></a>Macros</h2>
|
|
|
|
<h3><a name="BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID-spec"></a>
|
|
Macro BOOST_PYTHON_OPAQUE_SPECIALIZED_TYPE_ID(Pointee)</h3>
|
|
<p>This macro must be used to define specializations of the
|
|
<a href="type_id.html#type_id-spec">type_id</a> function
|
|
which can't be instantiated for incomplete types.</p>
|
|
<h4>Note</h4>
|
|
<p>In order for this to work in a cross-module environment the macro must
|
|
be invoked in every translation unit which uses the
|
|
opaque_pointer_converter.</p>
|
|
|
|
<h2><a name="examples"></a>Example</h2>
|
|
|
|
please see example for <a href="return_opaque_pointer.html#examples">
|
|
return_opaque_pointer</a>.
|
|
|
|
<h2><a name="see-also"></a>See Also</h2>
|
|
<p>
|
|
<a href="return_opaque_pointer.html">return_opaque_pointer</a>
|
|
</p>
|
|
|
|
<p>Revised
|
|
10 March, 2003
|
|
</p>
|
|
|
|
<p><i>© Copyright 2003 Haufe Mediengruppe. All Rights
|
|
Reserved.</i></p>
|
|
</body>
|
|
</html>
|
|
|