Skip to content

Commit 6fee43f

Browse files
author
Eric Niebler
committed
tests and docs for stl_input_iterator
[SVN r31514]
1 parent 6ec4387 commit 6fee43f

File tree

20 files changed

+2562
-1535
lines changed

20 files changed

+2562
-1535
lines changed

build/Jamfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ if [ check-python-config ]
5151
converter/builtin_converters.cpp
5252
converter/arg_to_python_base.cpp
5353
object/iterator.cpp
54+
object/stl_iterator.cpp
5455
object_protocol.cpp
5556
object_operators.cpp
5657
wrapper.cpp

build/Jamfile.v2

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ lib boost_python
5050
converter/builtin_converters.cpp
5151
converter/arg_to_python_base.cpp
5252
object/iterator.cpp
53+
object/stl_iterator.cpp
5354
object_protocol.cpp
5455
object_operators.cpp
5556
wrapper.cpp

build/VisualStudio/boost_python.dsp

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

doc/tutorial/doc/html/index.html

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,13 @@
2828
<div><div class="author"><h3 class="author">
2929
<span class="firstname">David</span> <span class="surname">Abrahams</span>
3030
</h3></div></div>
31-
<div><p class="copyright">Copyright © 2002-2005 Joel de Guzman, David Abrahams</p></div>
31+
<div><p class="copyright">Copyright © 2002-2005 Joel
32+
de Guzman, David Abrahams</p></div>
3233
<div><div class="legalnotice">
33-
<a name="id442427"></a><p>
34-
Distributed under the Boost Software License, Version 1.0.
35-
(See accompanying file LICENSE_1_0.txt or copy at
36-
<a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
37-
http://www.boost.org/LICENSE_1_0.txt
38-
</a>)
39-
34+
<a name="id427816"></a><p>
35+
Distributed under the Boost Software License, Version 1.0. (See accompanying
36+
file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">
37+
http://www.boost.org/LICENSE_1_0.txt </a>)
4038
</p>
4139
</div></div>
4240
</div></div>
@@ -85,47 +83,59 @@
8583
<div class="titlepage"><div><div><h2 class="title" style="clear: both">
8684
<a name="python.quickstart"></a>QuickStart</h2></div></div></div>
8785
<p>
88-
The Boost Python Library is a framework for interfacing Python and
89-
C++. It allows you to quickly and seamlessly expose C++ classes
90-
functions and objects to Python, and vice-versa, using no special
91-
tools -- just your C++ compiler. It is designed to wrap C++ interfaces
92-
non-intrusively, so that you should not have to change the C++ code at
93-
all in order to wrap it, making Boost.Python ideal for exposing
94-
3rd-party libraries to Python. The library's use of advanced
95-
metaprogramming techniques simplifies its syntax for users, so that
96-
wrapping code takes on the look of a kind of declarative interface
97-
definition language (IDL).</p>
86+
QuickStartThe Boost Python Library is a framework for interfacing Python and
87+
C++. It allows you to quickly and seamlessly expose C++ classes functions and
88+
objects to Python, and vice-versa, using no special tools -- just your C++
89+
compiler. It is designed to wrap C++ interfaces non-intrusively, so that you
90+
should not have to change the C++ code at all in order to wrap it, making Boost.Python
91+
ideal for exposing 3rd-party libraries to Python. The library's use of advanced
92+
metaprogramming techniques simplifies its syntax for users, so that wrapping
93+
code takes on the look of a kind of declarative interface definition language
94+
(IDL).
95+
</p>
9896
<a name="quickstart.hello_world"></a><h2>
99-
<a name="id372086"></a>Hello World</h2>
97+
<a name="id372244"></a>
98+
Hello World
99+
</h2>
100100
<p>
101-
Following C/C++ tradition, let's start with the "hello, world". A C++
102-
Function:</p>
103-
<pre class="programlisting"><tt class="literal"><span class="keyword">char</span><span class="keyword"> const</span><span class="special">*</span><span class="identifier"> greet</span><span class="special">()</span><span class="special">
104-
{</span><span class="keyword">
105-
return</span><span class="string"> "hello, world"</span><span class="special">;</span><span class="special">
106-
}</span></tt></pre>
101+
Following C/C++ tradition, let's start with the "hello, world". A
102+
C++ Function:
103+
</p>
104+
<pre class="programlisting">
105+
<span class="keyword">char</span> <span class="keyword">const</span><span class="special">*</span> <span class="identifier">greet</span><span class="special">()</span>
106+
<span class="special">{</span>
107+
<span class="keyword">return</span> <span class="string">"hello, world"</span><span class="special">;</span>
108+
<span class="special">}</span>
109+
</pre>
107110
<p>
108-
can be exposed to Python by writing a Boost.Python wrapper:</p>
109-
<pre class="programlisting"><tt class="literal"><span class="preprocessor">#include</span><span class="special"> &lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">python</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span><span class="keyword">
110-
using</span><span class="keyword"> namespace</span><span class="identifier"> boost</span><span class="special">::</span><span class="identifier">python</span><span class="special">;</span><span class="identifier">
111+
can be exposed to Python by writing a Boost.Python wrapper:
112+
</p>
113+
<pre class="programlisting">
114+
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">python</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
115+
<span class="keyword">using</span> <span class="keyword">namespace</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">python</span><span class="special">;</span>
111116

112-
BOOST_PYTHON_MODULE</span><span class="special">(</span><span class="identifier">hello</span><span class="special">)</span><span class="special">
113-
{</span><span class="identifier">
114-
def</span><span class="special">(</span><span class="string">"greet"</span><span class="special">,</span><span class="identifier"> greet</span><span class="special">);</span><span class="special">
115-
}</span></tt></pre>
117+
<span class="identifier">BOOST_PYTHON_MODULE</span><span class="special">(</span><span class="identifier">hello</span><span class="special">)</span>
118+
<span class="special">{</span>
119+
<span class="identifier">def</span><span class="special">(</span><span class="string">"greet"</span><span class="special">,</span> <span class="identifier">greet</span><span class="special">);</span>
120+
<span class="special">}</span>
121+
</pre>
116122
<p>
117-
That's it. We're done. We can now build this as a shared library. The
118-
resulting DLL is now visible to Python. Here's a sample Python session:</p>
123+
That's it. We're done. We can now build this as a shared library. The resulting
124+
DLL is now visible to Python. Here's a sample Python session:
125+
</p>
119126
<p></p>
120-
<pre class="programlisting"><tt class="literal"><span class="special">&gt;&gt;&gt;</span><span class="keyword"> import</span><span class="identifier"> hello</span><span class="special">
121-
&gt;&gt;&gt;</span><span class="keyword"> print</span><span class="identifier"> hello</span><span class="special">.</span><span class="identifier">greet</span><span class="special">()</span><span class="identifier">
122-
hello</span><span class="special">,</span><span class="identifier"> world</span></tt></pre>
127+
<pre class="programlisting">
128+
<span class="special">&gt;&gt;&gt;</span> <span class="keyword">import</span> <span class="identifier">hello</span>
129+
<span class="special">&gt;&gt;&gt;</span> <span class="keyword">print</span> <span class="identifier">hello</span><span class="special">.</span><span class="identifier">greet</span><span class="special">()</span>
130+
<span class="identifier">hello</span><span class="special">,</span> <span class="identifier">world</span>
131+
</pre>
123132
<p></p>
124-
<div class="blockquote"><blockquote class="blockquote"><p><span class="emphasis"><em><span class="bold"><b>Next stop... Building your Hello World module from start to finish...</b></span></em></span></p></blockquote></div>
133+
<div class="blockquote"><blockquote class="blockquote"><p><span class="emphasis"><em><span class="bold"><b>Next stop... Building your Hello World module
134+
from start to finish...</b></span></em></span></p></blockquote></div>
125135
</div>
126136
</div>
127137
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
128-
<td align="left"><small><p>Last revised: July 12, 2005 at 07:50:43 GMT</p></small></td>
138+
<td align="left"><small><p>Last revised: October 31, 2005 at 18:46:06 GMT</p></small></td>
129139
<td align="right"><small></small></td>
130140
</tr></table>
131141
<hr>

0 commit comments

Comments
 (0)