1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<HTML> 3<HEAD> 4 <TITLE>Class Template aggregate_filter</TITLE> 5 <LINK REL="stylesheet" HREF="../../../../boost.css"> 6 <LINK REL="stylesheet" HREF="../theme/iostreams.css"> 7</HEAD> 8<BODY> 9 10<!-- Begin Banner --> 11 12 <H1 CLASS="title">Class Template <CODE>aggregate_filter</CODE></H1> 13 <HR CLASS="banner"> 14 15<!-- End Banner --> 16 17<DL class="page-index"> 18 <DT><A href="#description">Description</A></DT> 19 <DT><A href="#headers">Headers</A></DT> 20 <DT><A href="#reference">Reference</A></DT> 21 <DT><A href="#examples">Examples</A></DT> 22</DL> 23 24<HR> 25 26<A NAME="description"></A> 27<H2>Description</H2> 28 29<P> 30 The class template <CODE>aggregate_filter</CODE> is a <A HREF='../concepts/dual_use_filter.html'>DualUseFilter</A> for use as a base class by Filters which filter an entire character sequence at once. Because a <CODE>aggregate_filter</CODE> must read an entire character sequence into memory before it begins to filter, it is not suitable in low-memory situations or for processing character sequences which have no natural end, such as stock tickers. Because of these limitations, <CODE>aggregate_filter</CODE> is best used as an aid to those learning to use the Iostreams library. 31</P> 32<P> 33 When used as an <A HREF="../concepts/input_filter.html">InputFilter</A>, an instance of <CODE>aggregate_filter</CODE> reads to the end of the stream as soon as input is commenced. The entire contents of the stream are filtered using the <CODE>private virtual</CODE> function <A HREF="#do_filter"><CODE>do_filter</CODE></A>. The filtered data is stored and used to satisfy all future requests for input until the end of the filtered data is reached. 34</P> 35<P> 36 When used as an <A HREF="../concepts/output_filter.html">OutputFilter</A>, an instance of <CODE>aggregate_filter</CODE> stores all data written to it without passing it downstream. When the stream is closed, the entire contents of the stream are filtered using <A HREF="#do_filter"><CODE>do_filter</CODE></A>. The filtered data is then written, all at once, to the next downstream Filter or Device. 37</P> 38 39<A NAME="headers"></A> 40<H2>Headers</H2> 41 42<DL class="page-index"> 43 <DT><A CLASS="header" HREF="../../../../boost/iostreams/filter/aggregate.hpp"><CODE><boost/iostreams/filter/aggregate.hpp></CODE></A></DT> 44</DL> 45 46<A NAME="reference"></A> 47<H2>Reference</H2> 48 49<H4>Synopsis</H4> 50 51<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams { 52 53<SPAN CLASS="preprocessor">#include</SPAN> <SPAN CLASS="literal"><vector></SPAN> 54 55<SPAN CLASS="keyword"><SPAN CLASS="keyword">template</SPAN></SPAN>< <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Ch</A>, 56 <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Tr</A> = std::char_traits<Ch>, 57 <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Alloc</A> = std::allocator<Ch> > 58<SPAN CLASS="keyword">class</SPAN> <A CLASS="documented" HREF="#template_params">aggregate_filter</A> { 59<SPAN CLASS="keyword">public</SPAN>: 60 <SPAN CLASS="keyword">typedef</SPAN> Ch char_type; 61 <SPAN CLASS="keyword">typedef</SPAN> <SPAN CLASS="omitted">implementation-defined</SPAN> category; 62 <SPAN CLASS="keyword">typedef</SPAN> std::vector<Char, Alloc> vector_type; 63 <SPAN CLASS="keyword">virtual</SPAN> ~aggregate_filter(); 64 <SPAN CLASS="omitted">...</SPAN> 65<SPAN CLASS="keyword">private</SPAN>: 66 <SPAN CLASS="keyword">virtual</SPAN> <SPAN CLASS="keyword">void</SPAN> <A CLASS="documented" HREF="#do_filter">do_filter</A>(<SPAN CLASS="keyword">const</SPAN> vector_type& src, vector_type& dest) = 0; 67}; 68 69} } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE> 70 71<A NAME="template_params"></A> 72<H4>Template parameters</H4> 73 74<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2> 75<TR> 76 <TR> 77 <TD VALIGN="top"><I>Ch</I></TD><TD WIDTH="2em" VALIGN="top">-</TD> 78 <TD>The character type</TD> 79 </TR> 80 <TR> 81 <TD VALIGN="top"><I>Tr</I></TD><TD WIDTH="2em" VALIGN="top">-</TD> 82 <TD>The traits type</TD> 83 </TR> 84 <TR> 85 <TD VALIGN="top"><I>Alloc</I></TD><TD WIDTH="2em" VALIGN="top">-</TD> 86 <TD>A standard library allocator type (<A CLASS="bib_ref" HREF="../bibliography.html#iso">[ISO]</A>, 20.1.5), used to instantiate <CODE>std::vector</CODE></TD> 87 </TR> 88</TABLE> 89 90<A NAME="do_filter"></A> 91<H4><CODE>aggregate_filter::do_filter</CODE></H4> 92 93<PRE CLASS="broken_ie"> <SPAN CLASS="keyword">virtual</SPAN> <SPAN CLASS="keyword">void</SPAN> <B>do_filter</B>(<SPAN CLASS="keyword">const</SPAN> vector_type& src, vector_type& dest) = 0;</PRE> 94 95<P>Reads unflitered characters from <CODE>src</CODE> and appends filtered characters to <CODE>dest</CODE>, returning after all the characters in <CODE>src</CODE> have been consumed.</P> 96 97<A NAME="examples"></A> 98<H2>Examples</H2> 99 100<P>For example uses of <CODE>aggregate_filter</CODE>, see the headers <A CLASS="header" HREF="../../../../boost/iostreams/filter/regex.hpp"><CODE><boost/iostreams/filter/regex.hpp></CODE></A> and <A CLASS="header" HREF="../../../../boost/iostreams/filter/stdio.hpp"><CODE><boost/iostreams/filter/stdio.hpp></CODE></A>.</P> 101 102<!-- Begin Footer --> 103 104<HR> 105 106<P CLASS="copyright">© Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage, LLC</a><br/>© Copyright 2004-2007 <a href="https://www.boost.org/users/people/jonathan_turkanis.html" target="_top">Jonathan Turkanis</a></P> 107<P CLASS="copyright"> 108 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">http://www.boost.org/LICENSE_1_0.txt</A>) 109</P> 110 111<!-- End Footer --> 112 113</BODY> 114