Files
boost_fusion/doc/html/fusion/extension/sequence_facade.html
T

277 lines
15 KiB
HTML
Raw Normal View History

2007-11-06 12:13:52 +00:00
<html>
<head>
2009-12-11 21:01:22 +00:00
<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
2007-11-06 12:13:52 +00:00
<title>Sequence Facade</title>
2010-07-04 19:20:50 +00:00
<link rel="stylesheet" href="../../../../../../doc/src/boostbook.css" type="text/css">
<meta name="generator" content="DocBook XSL Stylesheets V1.75.2">
2009-12-11 21:01:22 +00:00
<link rel="home" href="../../index.html" title="Chapter&#160;1.&#160;Fusion 2.0">
2007-11-06 12:13:52 +00:00
<link rel="up" href="../extension.html" title="Extension">
<link rel="prev" href="ext_full.html" title="The Full Extension Mechanism">
2007-11-06 12:13:52 +00:00
<link rel="next" href="iterator_facade.html" title="Iterator Facade">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table cellpadding="2" width="100%"><tr>
<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../boost.png"></td>
2008-07-17 23:59:22 +00:00
<td align="center"><a href="../../../../../../index.html">Home</a></td>
2010-07-04 19:20:50 +00:00
<td align="center"><a href="../../../../../../libs/libraries.htm">Libraries</a></td>
2008-07-17 23:59:22 +00:00
<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td>
<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td>
2007-11-06 12:13:52 +00:00
<td align="center"><a href="../../../../../../more/index.htm">More</a></td>
</tr></table>
<hr>
<div class="spirit-nav">
2010-07-04 19:20:50 +00:00
<a accesskey="p" href="ext_full.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../extension.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="iterator_facade.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
2007-11-06 12:13:52 +00:00
</div>
2010-06-03 08:29:23 +00:00
<div class="section">
<div class="titlepage"><div><div><h3 class="title">
<a name="fusion.extension.sequence_facade"></a><a class="link" href="sequence_facade.html" title="Sequence Facade">Sequence Facade</a>
</h3></div></div></div>
<a name="fusion.extension.sequence_facade.description"></a><h5>
2010-12-29 19:54:59 +00:00
<a name="id1028812"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.description">Description</a>
</h5>
2007-11-06 12:13:52 +00:00
<p>
The <a class="link" href="sequence_facade.html" title="Sequence Facade"><code class="computeroutput"><span class="identifier">sequence_facade</span></code></a>
2007-11-06 12:13:52 +00:00
template provides an intrusive mechanism for producing a conforming Fusion
iterator.
</p>
<a name="fusion.extension.sequence_facade.synopsis"></a><h5>
2010-12-29 19:54:59 +00:00
<a name="id1028838"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.synopsis">Synopsis</a>
</h5>
<pre class="programlisting"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> <span class="identifier">Derived</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">TravesalTag</span><span class="special">,</span> <span class="keyword">typename</span> <span class="identifier">IsView</span> <span class="special">=</span> <span class="identifier">mpl</span><span class="special">::</span><span class="identifier">false_</span><span class="special">&gt;</span>
2007-11-06 12:13:52 +00:00
<span class="keyword">struct</span> <span class="identifier">sequence_facade</span><span class="special">;</span>
</pre>
<a name="fusion.extension.sequence_facade.usage"></a><h5>
2010-12-29 19:54:59 +00:00
<a name="id1028932"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.usage">Usage</a>
</h5>
2007-11-06 12:13:52 +00:00
<p>
The user of <a class="link" href="sequence_facade.html" title="Sequence Facade"><code class="computeroutput"><span class="identifier">sequence_facade</span></code></a> derives his sequence
type from a specialization of <a class="link" href="sequence_facade.html" title="Sequence Facade"><code class="computeroutput"><span class="identifier">sequence_facade</span></code></a> and passes the derived
2007-11-06 12:13:52 +00:00
sequence type as the first template parameter. The second template parameter
should be the traversal category of the sequence being implemented. The 3rd
parameter should be set to <code class="computeroutput"><span class="identifier">mpl</span><span class="special">::</span><span class="identifier">true_</span></code>
2007-11-06 12:13:52 +00:00
if the sequence is a view.
</p>
<p>
The user must the implement the key expressions required by their sequence
type.
</p>
<div class="table">
2010-12-29 19:54:59 +00:00
<a name="id1028983"></a><p class="title"><b>Table&#160;1.101.&#160;Parameters</b></p>
<div class="table-contents"><table class="table" summary="Parameters">
2007-11-06 12:13:52 +00:00
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
2010-04-10 18:55:44 +00:00
<p>
Name
</p>
</th>
<th>
2010-04-10 18:55:44 +00:00
<p>
Description
</p>
</th>
2007-11-06 12:13:52 +00:00
</tr></thead>
<tbody>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span></code>, <code class="computeroutput"><span class="identifier">Seq</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
A type derived from <a class="link" href="sequence_facade.html" title="Sequence Facade"><code class="computeroutput"><span class="identifier">sequence_facade</span></code></a>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">N</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
An <a href="http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL
Integral Constant</a>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
</tbody>
</table></div>
2007-11-06 12:13:52 +00:00
</div>
<br class="table-break"><div class="table">
2010-12-29 19:54:59 +00:00
<a name="id1029094"></a><p class="title"><b>Table&#160;1.102.&#160;Key Expressions</b></p>
<div class="table-contents"><table class="table" summary="Key Expressions">
2007-11-06 12:13:52 +00:00
<colgroup>
<col>
<col>
</colgroup>
<thead><tr>
<th>
2010-04-10 18:55:44 +00:00
<p>
Expression
</p>
</th>
<th>
2010-04-10 18:55:44 +00:00
<p>
Result
</p>
</th>
2007-11-06 12:13:52 +00:00
</tr></thead>
<tbody>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">begin</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
The type of an iterator to the beginning of a sequence of type
<code class="computeroutput"><span class="identifier">Seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">begin</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;::</span><span class="identifier">call</span><span class="special">(</span><span class="identifier">seq</span><span class="special">)</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
An iterator to the beginning of sequence <code class="computeroutput"><span class="identifier">seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">end</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
The type of an iterator to the end of a sequence of type <code class="computeroutput"><span class="identifier">Seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">end</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;::</span><span class="identifier">call</span><span class="special">(</span><span class="identifier">seq</span><span class="special">)</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
An iterator to the end of sequence <code class="computeroutput"><span class="identifier">seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">size</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
The size of a sequence of type <code class="computeroutput"><span class="identifier">Seq</span></code>
as an <a href="http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target="_top">MPL
Integral Constant</a>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">size</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">&gt;::</span><span class="identifier">call</span><span class="special">(</span><span class="identifier">seq</span><span class="special">)</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
The size of sequence <code class="computeroutput"><span class="identifier">seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">at</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
The type of element <code class="computeroutput"><span class="identifier">N</span></code>
in a sequence of type <code class="computeroutput"><span class="identifier">Seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">at</span><span class="special">&lt;</span><span class="identifier">Seq</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;::</span><span class="identifier">call</span><span class="special">(</span><span class="identifier">seq</span><span class="special">)</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
Element <code class="computeroutput"><span class="identifier">N</span></code> in sequence
<code class="computeroutput"><span class="identifier">seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
<tr>
<td>
2010-04-10 18:55:44 +00:00
<p>
<code class="computeroutput"><span class="identifier">sequence</span><span class="special">::</span><span class="keyword">template</span> <span class="identifier">value_at</span><span class="special">&lt;</span><span class="identifier">Sequence</span><span class="special">,</span> <span class="identifier">N</span><span class="special">&gt;::</span><span class="identifier">type</span></code>
</p>
</td>
<td>
2010-04-10 18:55:44 +00:00
<p>
The type of the <code class="computeroutput"><span class="identifier">N</span></code>th
element in a sequence of type <code class="computeroutput"><span class="identifier">Seq</span></code>
</p>
</td>
2007-11-06 12:13:52 +00:00
</tr>
</tbody>
</table></div>
2007-11-06 12:13:52 +00:00
</div>
<br class="table-break"><a name="fusion.extension.sequence_facade.include"></a><h5>
2010-12-29 19:54:59 +00:00
<a name="id1029766"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.include">Include</a>
</h5>
<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">sequence</span><span class="special">/</span><span class="identifier">sequence_facade</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">fusion</span><span class="special">/</span><span class="identifier">include</span><span class="special">/</span><span class="identifier">sequence_facade</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
</pre>
<a name="fusion.extension.sequence_facade.example"></a><h5>
2010-12-29 19:54:59 +00:00
<a name="id1029874"></a>
<a class="link" href="sequence_facade.html#fusion.extension.sequence_facade.example">Example</a>
</h5>
2007-11-06 12:13:52 +00:00
<p>
A full working example using <a class="link" href="sequence_facade.html" title="Sequence Facade"><code class="computeroutput"><span class="identifier">sequence_facade</span></code></a> is provided in triple.cpp
in the extension examples.
2007-11-06 12:13:52 +00:00
</p>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
<td align="left"></td>
2009-12-11 21:01:22 +00:00
<td align="right"><div class="copyright-footer">Copyright &#169; 2001-2007 Joel de Guzman, Dan Marsden, Tobias
Schwinger<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>)
2007-11-14 10:17:09 +00:00
</p>
</div></td>
2007-11-06 12:13:52 +00:00
</tr></table>
<hr>
<div class="spirit-nav">
2010-07-04 19:20:50 +00:00
<a accesskey="p" href="ext_full.html"><img src="../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../extension.html"><img src="../../../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="iterator_facade.html"><img src="../../../../../../doc/src/images/next.png" alt="Next"></a>
2007-11-06 12:13:52 +00:00
</div>
</body>
</html>