]>
Commit | Line | Data |
---|---|---|
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> | |
2 | <HTML> | |
3 | <HEAD> | |
4 | <TITLE>SymmetricFilter</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">SymmetricFilter</H1> | |
13 | <HR CLASS="banner"> | |
14 | ||
15 | <!-- End Banner --> | |
16 | ||
17 | <H2>Description</H2> | |
18 | ||
19 | <P> | |
20 | A SymmetricFilter processes a character sequence fed to it incrementally in a user-supplied buffer and outputs a filtered sequence incrementally to a second user-supplied buffer. It is useful for defining filters based on C language APIs. | |
21 | </P> | |
22 | ||
23 | <P> | |
24 | SymmetricFilter does not refine <A HREF="filter.html">Filter</A>. Instead, the template <A HREF="../classes/symmetric_filter.html"><CODE>symmetric_filter</CODE></A> can used to generate a Filter from a SymmetricFilter. The Filters generated in this manner are <A HREF="dual_use_filter.html">DualUseFilters</A> and are <A HREF="../../../../doc/html/CopyConstructible.html" TARGET="_top">CopyConstructible</A> regardless of whether the SymmetricFilters on which they are based are <A HREF="../../../../doc/html/CopyConstructible.html">CopyConstructible</A>. | |
25 | </P> | |
26 | ||
27 | <P> | |
28 | The concept SymmetricFilter is notable in that its definition does not involve the concept of a <A HREF="source.html">Source</A> or <A HREF="sink.html">Sink</A>. | |
29 | </P> | |
30 | ||
31 | <H2>Associated Types</H2> | |
32 | ||
33 | <TABLE CELLPADDING="5" BORDER="1"> | |
34 | <TR><TD>Character type</TD><TD>The type of the characters in the filtered sequences</TD></TR> | |
35 | </TABLE> | |
36 | ||
37 | <H2>Notation</H2> | |
38 | ||
39 | <TABLE CELLPADDING="2"> | |
40 | <TR><TD><CODE>F</CODE></TD><TD>- A type which is a model of SymmetricFilter</TD></TR> | |
41 | <TR><TD><CODE>Ch</CODE></TD><TD>- The character type of <CODE>F</CODE></TD></TR> | |
42 | <TR><TD><CODE>f</CODE></TD><TD>- Object of type <CODE>F</CODE></TD></TR> | |
43 | <TR><TD><CODE>i1, i2</CODE></TD><TD>- Objects of type <CODE>const Ch*</CODE></TD></TR> | |
44 | <TR><TD><CODE>o1, o2</CODE></TD><TD>- Objects of type <CODE>Ch*</CODE></TD></TR> | |
45 | <TR><TD><CODE>flush</CODE></TD><TD>- Object of type <CODE>bool</CODE></TD></TR> | |
46 | </TABLE> | |
47 | ||
48 | <H2>Valid Expressions / Semantics — Typenames</H2> | |
49 | ||
50 | <TABLE CELLPADDING="5" BORDER="1"> | |
51 | <TR><TH>Expression</TH><TH>Expression Type</TH></TR> | |
52 | <TR> | |
53 | <TD> | |
54 | <PRE CLASS="plain_code"><CODE>typename <A HREF="../guide/traits.html#char_type_of_ref">char_type_of</A><F>::type</CODE></PRE> | |
55 | </TD> | |
56 | <TD><CODE>typename</CODE> of the character type</TD> | |
57 | </TR> | |
58 | </TABLE> | |
59 | ||
60 | <H2>Valid Expressions / Semantics — Member Functions</H2> | |
61 | ||
62 | <TABLE CELLPADDING="5" BORDER="1"> | |
63 | <TR><TH>Expression</TH><TH>Expression Type</TH><TH>Semantics</TH><TH>Postcondition</TH></TR> | |
64 | <TR> | |
65 | <TD><PRE CLASS="plain_code"><CODE>f.filter(i1, i2, o1, o2, flush)</CODE></PRE></TD> | |
66 | <TD><CODE>bool</CODE></TD> | |
67 | <TD> | |
68 | Attempts to filter the sequence <CODE>[i1, i2)</CODE>, storing the result in the sequence <CODE>[o1, o2)</CODE>. If <CODE>flush</CODE> is true, writes as much output to <CODE>[o1, o2)</CODE> as possible. If <CODE>flush</CODE> is <CODE>false</CODE>, returns <CODE>false</CODE> to indicate that a “natural” end of stream has been detected. Otherwise, returns <CODE>true</CODE> to indicate that additional characters, not yet stored in <CODE>[o1, o2)</CODE>, are available for output. | |
69 | </TD> | |
70 | <TD> | |
71 | <P><CODE>i1</CODE> points to the first unconsumed character in the orginal sequence <CODE>[i1, i2)</CODE>. | |
72 | <P><CODE>o1</CODE> points to the first unconsumed character in the orginal sequence <CODE>[o1, o2)</CODE>. | |
73 | <P>Either <CODE>i1 == i2</CODE> or <CODE>o1 == o2</CODE>. | |
74 | </TD> | |
75 | </TR> | |
76 | <TR> | |
77 | <TD><PRE CLASS="plain_code"><CODE>f.close()</CODE></PRE></TD> | |
78 | <TD><CODE>void</CODE></TD> | |
79 | <TD ALIGN="center">-</TD> | |
80 | <TD> | |
81 | <CODE></CODE><CODE>f</CODE> is ready to begin filtering a new sequence | |
82 | </TD> | |
83 | </TR> | |
84 | </TABLE> | |
85 | ||
86 | <H2>Exceptions</H2> | |
87 | ||
88 | <P> | |
89 | Errors which occur during the execution of <CODE>filter</CODE> or <CODE>close</CODE> are indicated by throwing exceptions. | |
90 | </P> | |
91 | ||
92 | <H2>Models</H2> | |
93 | ||
94 | <!-- Begin Footer --> | |
95 | ||
96 | <HR> | |
97 | ||
98 | <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> | |
99 | <P CLASS="copyright"> | |
100 | 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>) | |
101 | </P> | |
102 | ||
103 | <!-- End Footer --> | |
104 | ||
105 | </BODY> |