2007-11-25 18:38:02 +00:00
< html >
< head >
2010-01-01 22:00:21 +00:00
< meta http-equiv = "Content-Type" content = "text/html; charset=US-ASCII" >
2007-11-25 18:38:02 +00:00
< title > Sequence Facade</ title >
< link rel = "stylesheet" href = "../../../../../../doc/html/boostbook.css" type = "text/css" >
2010-01-01 22:00:21 +00:00
<<<<<< < .working
2009-10-11 16:12:54 +00:00
< meta name = "generator" content = "DocBook XSL Stylesheets V1.65.1" >
2010-01-01 22:00:21 +00:00
=======
< meta name = "generator" content = "DocBook XSL Stylesheets V1.75.1" >
<<<<<< < .working
> >>>>>> .merge-right.r57125
2009-09-14 07:47:53 +00:00
< link rel = "home" href = "../../index.html" title = "Chapter 1. Fusion 2.0" >
2010-01-01 22:00:21 +00:00
=======
< link rel = "home" href = "../../index.html" title = "Chapter 1. Fusion 2.0" >
>>>>>>> .merge-right.r58299
2007-11-25 18:38:02 +00:00
< link rel = "up" href = "../extension.html" title = "Extension" >
2009-10-11 16:12:54 +00:00
< link rel = "previous" href = "ext_full.html" title = " The Full Extension Mechanism" >
2007-11-25 18:38:02 +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:40 +00:00
< td align = "center" >< a href = "../../../../../../index.html" > Home</ a ></ td >
2007-11-25 18:38:02 +00:00
< td align = "center" >< a href = "../../../../../libraries.htm" > Libraries</ a ></ td >
2008-07-17 23:59:40 +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-25 18:38:02 +00:00
< td align = "center" >< a href = "../../../../../../more/index.htm" > More</ a ></ td >
</ tr ></ table >
< hr >
< div class = "spirit-nav" >
< a accesskey = "p" href = "ext_full.html" >< img src = "../../../../../../doc/html/images/prev.png" alt = "Prev" ></ a >< a accesskey = "u" href = "../extension.html" >< img src = "../../../../../../doc/html/images/up.png" alt = "Up" ></ a >< a accesskey = "h" href = "../../index.html" >< img src = "../../../../../../doc/html/images/home.png" alt = "Home" ></ a >< a accesskey = "n" href = "iterator_facade.html" >< img src = "../../../../../../doc/html/images/next.png" alt = "Next" ></ a >
</ div >
2010-01-01 22:00:21 +00:00
<<<<<< < .working
2009-10-11 16:12:54 +00:00
< div class = "section" lang = "en" >
< div class = "titlepage" >
< div >< div >< h3 class = "title" >
< a name = "fusion.extension.sequence_facade" ></ a >< a href = "sequence_facade.html" title = "Sequence Facade" > Sequence Facade</ a >
</ h3 ></ div ></ div >
< div ></ div >
</ div >
< a name = "fusion.extension.sequence_facade.description" ></ a >< h4 >
< a name = "id605596" ></ a >
< a href = "sequence_facade.html#fusion.extension.sequence_facade.description" > Description</ a >
</ h4 >
2010-01-01 22:00:21 +00:00
=======
< div class = "section" title = "Sequence Facade" >
< 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 >
< a name = "id822333" ></ a >
< a class = "link" href = "sequence_facade.html#fusion.extension.sequence_facade.description" > Description</ a >
</ h5 >
>>>>>>> .merge-right.r57125
2007-11-25 18:38:02 +00:00
< p >
2009-10-11 16:12:54 +00:00
The < a href = "sequence_facade.html" title = "Sequence Facade" >< tt class = "computeroutput" >< span class = "identifier" > sequence_facade</ span ></ tt ></ a >
2007-11-25 18:38:02 +00:00
template provides an intrusive mechanism for producing a conforming Fusion
iterator.
</ p >
2010-01-01 22:00:21 +00:00
<<<<<< < .working
2009-10-11 16:12:54 +00:00
< a name = "fusion.extension.sequence_facade.synopsis" ></ a >< h4 >
< a name = "id605644" ></ a >
< a href = "sequence_facade.html#fusion.extension.sequence_facade.synopsis" > Synopsis</ a >
</ h4 >
2010-01-01 22:00:21 +00:00
=======
< a name = "fusion.extension.sequence_facade.synopsis" ></ a >< h5 >
< a name = "id822359" ></ a >
< a class = "link" href = "sequence_facade.html#fusion.extension.sequence_facade.synopsis" > Synopsis</ a >
</ h5 >
>>>>>>> .merge-right.r57125
2009-09-14 07:47:53 +00:00
< pre class = "programlisting" >< span class = "keyword" > template</ span >< span class = "special" > < </ 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" > > </ span >
2007-11-25 18:38:02 +00:00
< span class = "keyword" > struct</ span > < span class = "identifier" > sequence_facade</ span >< span class = "special" > ;</ span >
</ pre >
2010-01-01 22:00:21 +00:00
<<<<<< < .working
2009-10-11 16:12:54 +00:00
< a name = "fusion.extension.sequence_facade.usage" ></ a >< h4 >
< a name = "id605777" ></ a >
< a href = "sequence_facade.html#fusion.extension.sequence_facade.usage" > Usage</ a >
</ h4 >
2010-01-01 22:00:21 +00:00
=======
< a name = "fusion.extension.sequence_facade.usage" ></ a >< h5 >
< a name = "id822453" ></ a >
< a class = "link" href = "sequence_facade.html#fusion.extension.sequence_facade.usage" > Usage</ a >
</ h5 >
>>>>>>> .merge-right.r57125
2007-11-25 18:38:02 +00:00
< p >
2009-10-11 16:12:54 +00:00
The user of < a href = "sequence_facade.html" title = "Sequence Facade" >< tt class = "computeroutput" >< span class = "identifier" > sequence_facade</ span ></ tt ></ a > derives his sequence
type from a specialization of < a href = "sequence_facade.html" title = "Sequence Facade" >< tt class = "computeroutput" >< span class = "identifier" > sequence_facade</ span ></ tt ></ a > and passes the derived
2007-11-25 18:38:02 +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
2009-10-11 16:12:54 +00:00
parameter should be set to < tt class = "computeroutput" >< span class = "identifier" > mpl</ span >< span class = "special" > ::</ span >< span class = "identifier" > true_</ span ></ tt >
2007-11-25 18:38:02 +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-01-01 22:00:21 +00:00
<<<<<< < .working
<<<<<<< . working
<<<<<<< . working
<<<<<<< . working
<<<<<<< . working
<<<<<<< . working
2009-10-11 16:12:54 +00:00
< a name = "id605864" ></ a >< p class = "title" >< b > Table 1.91. Parameters</ b ></ p >
< table class = "table" summary = "Parameters" >
2010-01-01 22:00:21 +00:00
=======
< a name = "id857300" ></ a >< p class = "title" >< b > Table 1.91. Parameters</ b ></ p >
=======
< a name = "id820939" ></ a >< p class = "title" >< b > Table 1.95. Parameters</ b ></ p >
=======
< a name = "id813315" ></ a >< p class = "title" >< b > Table 1.95. Parameters</ b ></ p >
=======
< a name = "id837112" ></ a >< p class = "title" >< b > Table  1.95.  Parameters</ b ></ p >
=======
< a name = "id825781" ></ a >< p class = "title" >< b > Table  1.95.  Parameters</ b ></ p >
=======
< a name = "id822504" ></ a >< p class = "title" >< b > Table  1.95.  Parameters</ b ></ p >
>>>>>>> .merge-right.r58559
>>>>>>> .merge-right.r58549
>>>>>>> .merge-right.r58299
>>>>>>> .merge-right.r57337
>>>>>>> .merge-right.r57242
< div class = "table-contents" >< table class = "table" summary = "Parameters" >
>>>>>>> .merge-right.r57125
2007-11-25 18:38:02 +00:00
< colgroup >
< col >
< col >
</ colgroup >
< thead >< tr >
2009-10-11 16:12:54 +00:00
< th >< p >
2007-11-25 18:38:02 +00:00
Name
2009-10-11 16:12:54 +00:00
</ p ></ th >
< th >< p >
2007-11-25 18:38:02 +00:00
Description
2009-10-11 16:12:54 +00:00
</ p ></ th >
2007-11-25 18:38:02 +00:00
</ tr ></ thead >
< tbody >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span ></ tt > , < tt class = "computeroutput" >< span class = "identifier" > Seq</ span ></ tt >
</ p ></ td >
< td >< p >
A type derived from < a href = "sequence_facade.html" title = "Sequence Facade" >< tt class = "computeroutput" >< span class = "identifier" > sequence_facade</ span ></ tt ></ a >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > N</ span ></ tt >
</ p ></ td >
< td >< p >
2007-11-25 18:38:02 +00:00
An < a href = "http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target = "_top" > MPL
Integral Constant</ a >
2009-10-11 16:12:54 +00:00
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
</ tbody >
2009-10-11 16:12:54 +00:00
</ table >
2007-11-25 18:38:02 +00:00
</ div >
2010-01-01 22:00:21 +00:00
<<<<<< < .working
2009-10-11 16:12:54 +00:00
< div class = "table" >
< a name = "id605998" ></ a >< p class = "title" >< b > Table 1.92. Key Expressions</ b ></ p >
< table class = "table" summary = "Key Expressions" >
2010-01-01 22:00:21 +00:00
=======
< br class = "table-break" >< div class = "table" >
< a name = "id822611" ></ a >< p class = "title" >< b > Table  1.96.  Key Expressions</ b ></ p >
< div class = "table-contents" >< table class = "table" summary = "Key Expressions" >
>>>>>>> .merge-right.r57125
2007-11-25 18:38:02 +00:00
< colgroup >
< col >
< col >
</ colgroup >
< thead >< tr >
2009-10-11 16:12:54 +00:00
< th >< p >
2007-11-25 18:38:02 +00:00
Expression
2009-10-11 16:12:54 +00:00
</ p ></ th >
< th >< p >
2007-11-25 18:38:02 +00:00
Result
2009-10-11 16:12:54 +00:00
</ p ></ th >
2007-11-25 18:38:02 +00:00
</ tr ></ thead >
< tbody >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > begin</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > > ::</ span >< span class = "identifier" > type</ span ></ tt >
</ p ></ td >
< td >< p >
The type of an iterator to the beginning of a sequence of type < tt class = "computeroutput" >< span class = "identifier" > Seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > begin</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > > ::</ span >< span class = "identifier" > call</ span >< span class = "special" > (</ span >< span class = "identifier" > seq</ span >< span class = "special" > )</ span ></ tt >
</ p ></ td >
< td >< p >
An iterator to the beginning of sequence < tt class = "computeroutput" >< span class = "identifier" > seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > end</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > > ::</ span >< span class = "identifier" > type</ span ></ tt >
</ p ></ td >
< td >< p >
The type of an iterator to the end of a sequence of type < tt class = "computeroutput" >< span class = "identifier" > Seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > end</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > > ::</ span >< span class = "identifier" > call</ span >< span class = "special" > (</ span >< span class = "identifier" > seq</ span >< span class = "special" > )</ span ></ tt >
</ p ></ td >
< td >< p >
An iterator to the end of sequence < tt class = "computeroutput" >< span class = "identifier" > seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > size</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > > ::</ span >< span class = "identifier" > type</ span ></ tt >
</ p ></ td >
< td >< p >
The size of a sequence of type < tt class = "computeroutput" >< span class = "identifier" > Seq</ span ></ tt >
2007-11-25 18:38:02 +00:00
as an < a href = "http://www.boost.org/libs/mpl/doc/refmanual/integral-constant.html" target = "_top" > MPL
Integral Constant</ a >
2009-10-11 16:12:54 +00:00
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > size</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > > ::</ span >< span class = "identifier" > call</ span >< span class = "special" > (</ span >< span class = "identifier" > seq</ span >< span class = "special" > )</ span ></ tt >
</ p ></ td >
< td >< p >
The size of sequence < tt class = "computeroutput" >< span class = "identifier" > seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > at</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > ,</ span > < span class = "identifier" > N</ span >< span class = "special" > > ::</ span >< span class = "identifier" > type</ span ></ tt >
</ p ></ td >
< td >< p >
The type of element < tt class = "computeroutput" >< span class = "identifier" > N</ span ></ tt >
in a sequence of type < tt class = "computeroutput" >< span class = "identifier" > Seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt class = "computeroutput" >< span class = "identifier" > sequence</ span >< span class = "special" > ::</ span >< span class = "keyword" > template</ span > < span class = "identifier" > at</ span >< span class = "special" > < </ span >< span class = "identifier" > Seq</ span >< span class = "special" > ,</ span > < span class = "identifier" > N</ span >< span class = "special" > > ::</ span >< span class = "identifier" > call</ span >< span class = "special" > (</ span >< span class = "identifier" > seq</ span >< span class = "special" > )</ span ></ tt >
</ p ></ td >
< td >< p >
Element < tt class = "computeroutput" >< span class = "identifier" > N</ span ></ tt > in sequence
< tt class = "computeroutput" >< span class = "identifier" > seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
< tr >
2009-10-11 16:12:54 +00:00
< td >< p >
< tt 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" > < </ span >< span class = "identifier" > Sequence</ span >< span class = "special" > ,</ span > < span class = "identifier" > N</ span >< span class = "special" > > ::</ span >< span class = "identifier" > type</ span ></ tt >
</ p ></ td >
< td >< p >
The type of the < tt class = "computeroutput" >< span class = "identifier" > N</ span ></ tt > th
element in a sequence of type < tt class = "computeroutput" >< span class = "identifier" > Seq</ span ></ tt >
</ p ></ td >
2007-11-25 18:38:02 +00:00
</ tr >
</ tbody >
2009-10-11 16:12:54 +00:00
</ table >
2007-11-25 18:38:02 +00:00
</ div >
2010-01-01 22:00:21 +00:00
<<<<<< < .working
2009-10-11 16:12:54 +00:00
< a name = "fusion.extension.sequence_facade.include" ></ a >< h4 >
< a name = "id606877" ></ a >
< a href = "sequence_facade.html#fusion.extension.sequence_facade.include" > Include</ a >
</ h4 >
2010-01-01 22:00:21 +00:00
=======
< br class = "table-break" >< a name = "fusion.extension.sequence_facade.include" ></ a >< h5 >
< a name = "id823266" ></ a >
< a class = "link" href = "sequence_facade.html#fusion.extension.sequence_facade.include" > Include</ a >
</ h5 >
>>>>>>> .merge-right.r57125
2009-09-14 07:47:53 +00:00
< pre class = "programlisting" >< span class = "preprocessor" > #include</ span > < span class = "special" > < </ 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" > > </ span >
2007-11-25 18:38:02 +00:00
< span class = "preprocessor" > #include</ span > < span class = "special" > < </ 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" > > </ span >
</ pre >
2010-01-01 22:00:21 +00:00
<<<<<< < .working
2009-10-11 16:12:54 +00:00
< a name = "fusion.extension.sequence_facade.example" ></ a >< h4 >
< a name = "id607033" ></ a >
< a href = "sequence_facade.html#fusion.extension.sequence_facade.example" > Example</ a >
</ h4 >
2010-01-01 22:00:21 +00:00
=======
< a name = "fusion.extension.sequence_facade.example" ></ a >< h5 >
< a name = "id823374" ></ a >
< a class = "link" href = "sequence_facade.html#fusion.extension.sequence_facade.example" > Example</ a >
</ h5 >
>>>>>>> .merge-right.r57125
2007-11-25 18:38:02 +00:00
< p >
2009-10-11 16:12:54 +00:00
A full working example using < a href = "sequence_facade.html" title = "Sequence Facade" >< tt class = "computeroutput" >< span class = "identifier" > sequence_facade</ span ></ tt ></ a > is provided in triple.cpp
2007-11-25 18:38:02 +00:00
in the extension examples.
</ p >
</ div >
< table xmlns:rev = "http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width = "100%" >< tr >
< td align = "left" ></ td >
2010-01-01 22:00:21 +00:00
< td align = "right" >< div class = "copyright-footer" > Copyright © 2001-2007 Joel de Guzman, Dan Marsden, Tobias
2007-11-25 18:38:02 +00:00
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 > )
</ p >
</ div ></ td >
</ tr ></ table >
< hr >
< div class = "spirit-nav" >
< a accesskey = "p" href = "ext_full.html" >< img src = "../../../../../../doc/html/images/prev.png" alt = "Prev" ></ a >< a accesskey = "u" href = "../extension.html" >< img src = "../../../../../../doc/html/images/up.png" alt = "Up" ></ a >< a accesskey = "h" href = "../../index.html" >< img src = "../../../../../../doc/html/images/home.png" alt = "Home" ></ a >< a accesskey = "n" href = "iterator_facade.html" >< img src = "../../../../../../doc/html/images/next.png" alt = "Next" ></ a >
</ div >
</ body >
</ html >