1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <TITLE>Flushable
</TITLE>
5 <LINK REL=
"stylesheet" HREF=
"../../../../boost.css">
6 <LINK REL=
"stylesheet" HREF=
"../theme/iostreams.css">
12 <H1 CLASS=
"title">Flushable
</H1>
20 A Flushable Sink or OutputFilter provides a means for the user to request that all buffered characters be sent downstream.
23 <H2>Refinement of
</H2>
26 <H2>Associated Types
</H2>
28 <P>Same as
<A HREF=
"filter.html#types">Filter
</A> or
<A HREF=
"device.html#types">Device
</A>, with the following additional requirement:
</P>
30 <TABLE CELLPADDING=
"5" BORDER=
"1">
31 <TR><TD>Category
</TD><TD>A type convertible to
<A HREF=
"../guide/traits.html#category_tags"><CODE>flushable_tag
</CODE></A></TD></TR>
37 <TABLE CELLPADDING=
"2">
38 <TR><TD><CODE>F
</CODE></TD><TD>-
</TD><TD>A type which is a model of Flushable
</TD></TR>
39 <TR><TD><CODE>D
</CODE></TD><TD>-
</TD><TD>A type which is a model of
<A HREF=
"device.html">Sink
</A>, with the same character type as
<CODE>F
</CODE></TD></TR>
40 <TR><TD><CODE>f
</CODE></TD><TD>-
</TD><TD>Object of type
<CODE>F
</CODE></TD></TR>
41 <TR><TD><CODE>d
</CODE></TD><TD>-
</TD><TD>Object of type
<CODE>D
</CODE></TD></TR>
44 <H2>Valid Expressions / Semantics
</H2>
46 <TABLE CELLPADDING=
"5" BORDER=
"1">
47 <TR><TH>Expression
</TH><TH>Expression Type
</TH><TH>Precondition
</TH><TH>Semantics
</TH></TR>
50 <PRE CLASS=
"plain_code"><CODE><A HREF=
"../functions/flush.html#flush_device">boost::iostreams::flush
</A>(f)
</CODE></PRE>
52 <TD><CODE>bool
</CODE></TD>
53 <TD>Category convertible to
<A HREF=
"../guide/traits.html#category_tags"><CODE>device_tag
</CODE></A></TD>
55 Attempts to send all buffered characters downstream, returning
<CODE>true
</CODE> unless an error occurs.
<A CLASS='footnote_ref' NAME='note_1_ref' HREF='#note_1'
><SUP>[
1]
</SUP></A>
60 <PRE CLASS=
"plain_code"><CODE><A HREF=
"../functions/flush.html#flush_filter">boost::iostreams::flush
</A>(f, d)
</CODE></PRE>
62 <TD><CODE>bool
</CODE></TD>
63 <TD>Category convertible to
<A HREF=
"../guide/traits.html#category_tags"><CODE>filter_tag
</CODE></A></TD>
66 Attempts to write all buffered characters to d, returning
<CODE>true
</CODE> if all buffered characters were written.
75 Errors which occur during the execution of
<A CLASS=
"code" HREF=
"../functions/flush.html"><CODE>flush
</CODE></A> are be indicated by throwing exceptions. Such exceptions are caught and ignored if they occur during the execution of stream or stream buffer destructor.
80 <P>Several of the Filters and Devices provided by the Iostreams library are Flushable, but this is an implementation detail.
</P>
85 <A CLASS='footnote_ref' NAME='note_1' HREF='#note_1_ref'
><SUP>[
1]
</SUP></A>It was noticed late in developement that to be consistent with the policy of reporting errors using exceptions (
<I>see
</I> <A HREF='../guide/exceptions.html'
>Exceptions
</A>),
<CODE>flush
</CODE> should have been specified to return
<CODE>void
</CODE> when invoked on a Device. Until the specification is changed, Devices should always return
<CODE>true
</CODE> when flushed.
92 <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>
94 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>)