1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <TITLE>Class Template aggregate_filter
</TITLE>
5 <LINK REL=
"stylesheet" HREF=
"../../../../boost.css">
6 <LINK REL=
"stylesheet" HREF=
"../theme/iostreams.css">
12 <H1 CLASS=
"title">Class Template
<CODE>aggregate_filter
</CODE></H1>
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>
26 <A NAME=
"description"></A>
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.
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.
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.
39 <A NAME=
"headers"></A>
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>
46 <A NAME=
"reference"></A>
51 <PRE CLASS=
"broken_ie"><SPAN CLASS=
"keyword">namespace
</SPAN> boost {
<SPAN CLASS=
"keyword">namespace
</SPAN> iostreams {
53 <SPAN CLASS=
"preprocessor">#include
</SPAN> <SPAN CLASS=
"literal"><vector
></SPAN>
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;
69 } }
<SPAN CLASS=
"comment">// End namespace boost::io
</SPAN></PRE>
71 <A NAME=
"template_params"></A>
72 <H4>Template parameters
</H4>
74 <TABLE STYLE=
"margin-left:2em" BORDER=
0 CELLPADDING=
2>
77 <TD VALIGN=
"top"><I>Ch
</I></TD><TD WIDTH=
"2em" VALIGN=
"top">-
</TD>
78 <TD>The character type
</TD>
81 <TD VALIGN=
"top"><I>Tr
</I></TD><TD WIDTH=
"2em" VALIGN=
"top">-
</TD>
82 <TD>The traits type
</TD>
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>
90 <A NAME=
"do_filter"></A>
91 <H4><CODE>aggregate_filter::do_filter
</CODE></H4>
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>
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>
97 <A NAME=
"examples"></A>
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>
102 <!-- Begin Footer -->
106 <P CLASS=
"copyright">© Copyright
2008 <a href=
"http://www.coderage.com/" target=
"_top">CodeRage, LLC
</a><br/>© Copyright
2004-
2007 <a href=
"http://www.coderage.com/turkanis/" 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>)