136 lines
6.2 KiB
HTML
136 lines
6.2 KiB
HTML
<html>
|
|
<head>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
|
|
<title>Extractor</title>
|
|
<link rel="stylesheet" href="../../boostbook.css" type="text/css">
|
|
<meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
|
|
<link rel="home" href="../index.html" title="Boost.Python Reference Manual">
|
|
<link rel="up" href="../concepts.html" title="Chapter 1. Concepts">
|
|
<link rel="prev" href="dereferenceable.html" title="Dereferenceable">
|
|
<link rel="next" href="holdergenerator.html" title="HolderGenerator">
|
|
</head>
|
|
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
|
|
<table cellpadding="2" width="100%"><tr><td valign="top"><img alt="" width="" height="" src="../../images/boost.png"></td></tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="dereferenceable.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="holdergenerator.html"><img src="../../images/next.png" alt="Next"></a>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
|
|
<a name="concepts.extractor"></a><a class="link" href="extractor.html" title="Extractor">Extractor</a>
|
|
</h2></div></div></div>
|
|
<div class="toc"><dl class="toc">
|
|
<dt><span class="section"><a href="extractor.html#concepts.extractor.introduction">Introduction</a></span></dt>
|
|
<dt><span class="section"><a href="extractor.html#concepts.extractor.concept_requirements">Concept Requirements</a></span></dt>
|
|
<dt><span class="section"><a href="extractor.html#concepts.extractor.notes">Notes</a></span></dt>
|
|
</dl></div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h3 class="title">
|
|
<a name="concepts.extractor.introduction"></a><a class="link" href="extractor.html#concepts.extractor.introduction" title="Introduction">Introduction</a>
|
|
</h3></div></div></div>
|
|
<p>
|
|
An Extractor is a class which Boost.Python can use to extract C++ objects
|
|
from Python objects, and is typically used by facilities that define <code class="computeroutput"><span class="identifier">from_python</span></code> conversions for "traditional"
|
|
Python extension types.
|
|
</p>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h3 class="title">
|
|
<a name="concepts.extractor.concept_requirements"></a><a class="link" href="extractor.html#concepts.extractor.concept_requirements" title="Concept Requirements">Concept Requirements</a>
|
|
</h3></div></div></div>
|
|
<p>
|
|
In the table below, <code class="computeroutput"><span class="identifier">X</span></code> denotes
|
|
a model of <code class="computeroutput"><span class="identifier">Extractor</span></code> and
|
|
<code class="computeroutput"><span class="identifier">a</span></code> denotes an instance of
|
|
a Python object type.
|
|
</p>
|
|
<div class="informaltable"><table class="table">
|
|
<colgroup>
|
|
<col>
|
|
<col>
|
|
<col>
|
|
</colgroup>
|
|
<thead><tr>
|
|
<th>
|
|
<p>
|
|
Expression
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
Type
|
|
</p>
|
|
</th>
|
|
<th>
|
|
<p>
|
|
Semantics
|
|
</p>
|
|
</th>
|
|
</tr></thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
<code class="computeroutput"><span class="identifier">X</span><span class="special">::</span><span class="identifier">execute</span><span class="special">(</span><span class="identifier">a</span><span class="special">)</span></code>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
non-void
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
Returns the C++ object being extracted. The execute function
|
|
must not be overloaded.
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>
|
|
<p>
|
|
<code class="computeroutput"><span class="special">&</span><span class="identifier">a</span><span class="special">.</span><span class="identifier">ob_type</span></code>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
<code class="computeroutput"><span class="identifier">PyTypeObject</span><span class="special">**</span></code>
|
|
</p>
|
|
</td>
|
|
<td>
|
|
<p>
|
|
Points to the <code class="computeroutput"><span class="identifier">ob_type</span></code>
|
|
field of an object which is layout-compatible with <code class="computeroutput"><span class="identifier">PyObject</span></code>
|
|
</p>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table></div>
|
|
</div>
|
|
<div class="section">
|
|
<div class="titlepage"><div><div><h3 class="title">
|
|
<a name="concepts.extractor.notes"></a><a class="link" href="extractor.html#concepts.extractor.notes" title="Notes">Notes</a>
|
|
</h3></div></div></div>
|
|
<p>
|
|
Informally, an Extractor's execute member must be a non-overloaded static
|
|
function whose single argument is a Python object type. Acceptable Python
|
|
object types include those publicly (and unambiguously) derived from PyObject,
|
|
and POD types which are layout-compatible with PyObject.
|
|
</p>
|
|
</div>
|
|
</div>
|
|
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
|
|
<td align="left"></td>
|
|
<td align="right"><div class="copyright-footer">Copyright © 2002-2005, 2015 David Abrahams, Stefan Seefeld<p>
|
|
Distributed under the Boost Software License, Version 1.0. (See accompanying
|
|
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>
|
|
</p>
|
|
</div></td>
|
|
</tr></table>
|
|
<hr>
|
|
<div class="spirit-nav">
|
|
<a accesskey="p" href="dereferenceable.html"><img src="../../images/prev.png" alt="Prev"></a><a accesskey="u" href="../concepts.html"><img src="../../images/up.png" alt="Up"></a><a accesskey="h" href="../index.html"><img src="../../images/home.png" alt="Home"></a><a accesskey="n" href="holdergenerator.html"><img src="../../images/next.png" alt="Next"></a>
|
|
</div>
|
|
</body>
|
|
</html>
|