File: aggregate.html

package info (click to toggle)
boost 1.34.1-14
  • links: PTS
  • area: main
  • in suites: lenny
  • size: 116,412 kB
  • ctags: 259,566
  • sloc: cpp: 642,395; xml: 56,450; python: 17,612; ansic: 14,520; sh: 2,265; yacc: 858; perl: 481; makefile: 478; lex: 94; sql: 74; csh: 6
file content (118 lines) | stat: -rw-r--r-- 5,990 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML>
<HEAD>
    <TITLE>Class Template aggregate_filter</TITLE>
    <LINK REL="stylesheet" HREF="../../../../boost.css">
    <LINK REL="stylesheet" HREF="../theme/iostreams.css">
</HEAD>
<BODY>

<!-- Begin Banner -->

    <H1 CLASS="title">Class Template <CODE>aggregate_filter</CODE></H1>
    <HR CLASS="banner">

<!-- End Banner -->

<DL class="page-index">
  <DT><A href="#description">Description</A></DT>
  <DT><A href="#headers">Headers</A></DT>
  <DT><A href="#reference">Reference</A></DT>
  <DT><A href="#examples">Examples</A></DT>
</DL>

<HR>

<A NAME="description"></A>
<H2>Description</H2>

<P>
    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.
</P>
<P>
    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.
</P>
<P>
    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.
</P>

<A NAME="headers"></A>
<H2>Headers</H2>

<DL class="page-index">
  <DT><A CLASS="header" HREF="../../../../boost/iostreams/filter/aggregate.hpp"><CODE>&lt;boost/iostreams/filter/aggregate.hpp&gt;</CODE></A></DT>
</DL>

<A NAME="reference"></A>
<H2>Reference</H2>

<H4>Synopsis</H4>

<PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {

<SPAN CLASS="preprocessor">#include</SPAN> <SPAN CLASS="literal">&lt;vector&gt;</SPAN>

<SPAN CLASS="keyword"><SPAN CLASS="keyword">template</SPAN></SPAN>&lt; <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Ch</A>,
          <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Tr</A> = std::char_traits&lt;Ch&gt;,
          <SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">Alloc</A> = std::allocator&lt;Ch&gt; &gt;
<SPAN CLASS="keyword">class</SPAN> <A CLASS="documented" HREF="#template_params">aggregate_filter</A>  {
<SPAN CLASS="keyword">public</SPAN>:
    <SPAN CLASS="keyword">typedef</SPAN> Ch                            char_type;
    <SPAN CLASS="keyword">typedef</SPAN> <SPAN CLASS="omitted">implementation-defined</SPAN>        category;
    <SPAN CLASS="keyword">typedef</SPAN> std::vector&lt;Char, Alloc&gt;      vector_type;
    <SPAN CLASS="keyword">virtual</SPAN> ~aggregate_filter();
    <SPAN CLASS="omitted">...</SPAN>
<SPAN CLASS="keyword">private</SPAN>:
    <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;
};

} } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE>

<A NAME="template_params"></A>
<H4>Template parameters</H4>

<TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2>
<TR>
    <TR>
        <TD VALIGN="top"><I>Ch</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
        <TD>The character type</TD>
    </TR>
    <TR>
        <TD VALIGN="top"><I>Tr</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
        <TD>The traits type</TD>
    </TR>
    <TR>
        <TD VALIGN="top"><I>Alloc</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
        <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>
    </TR>
</TABLE>

<A NAME="do_filter"></A>
<H4><CODE>aggregate_filter::do_filter</CODE></H4>

<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>

<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>

<A NAME="examples"></A>
<H2>Examples</H2>

<P>For example uses of <CODE>aggregate_filter</CODE>, see the headers <A CLASS="header" HREF="../../../../boost/iostreams/filter/regex.hpp"><CODE>&lt;boost/iostreams/filter/regex.hpp&gt;</CODE></A> and <A CLASS="header" HREF="../../../../boost/iostreams/filter/stdio.hpp"><CODE>&lt;boost/iostreams/filter/stdio.hpp&gt;</CODE></A>.</P>

<!-- Begin Footer -->

<HR>
<P CLASS="copyright">Revised
<!--webbot bot="Timestamp" S-Type="EDITED" S-Format="%d %B, %Y" startspan -->
20 May, 2004
<!--webbot bot="Timestamp" endspan i-checksum="38504" -->
</P>

<P CLASS="copyright">&copy; Copyright <A HREF="http://www.kangaroologic.com" TARGET="_top">Jonathan Turkanis</A>, 2004</P>
<P CLASS="copyright"> 
    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>)
</P>

<!-- End Footer -->

</BODY>