1 <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01 Transitional//EN">
4 <TITLE>Function Template optimal_buffer_size
</TITLE>
5 <LINK REL=
"stylesheet" HREF=
"../../../../boost.css">
6 <LINK REL=
"stylesheet" HREF=
"../theme/iostreams.css">
12 <H1 CLASS=
"title">Function Template
<CODE>optimal_buffer_size
</CODE></H1>
17 <DL class=
"page-index">
18 <DT><A href=
"#overview">Overview
</A></DT>
19 <DT><A href=
"#headers">Headers
</A></DT>
20 <DT><A href=
"#reference">Reference
</A></DT>
23 <A NAME=
"overview"></A>
27 The function template
<CODE>optimal_buffer_size
</CODE> returns the size of the character buffer which is allocated for a Filter or Device by library streams, stream buffers and chains if no buffer size is explicitly specified.
30 <A NAME=
"headers"></A>
34 <DT><A CLASS=
"header" HREF=
"../../../../boost/iostreams/optimal_buffer_size.hpp"><CODE><boost/iostreams/optimal_buffer_size.hpp
></CODE></A></DT>
35 <DT><A CLASS=
"header" HREF=
"../../../../boost/iostreams/operations.hpp"><CODE><boost/iostreams/operations.hpp
></CODE></A></DT>
38 <A NAME=
"reference"></A>
41 <A NAME=
"synopsis"></A>
44 <PRE CLASS=
"broken_ie"><SPAN CLASS=
"keyword">namespace
</SPAN> boost {
<SPAN CLASS=
"keyword">namespace
</SPAN> iostreams {
46 <SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> <A CLASS=
"documented" HREF=
"#template_params">T
</A>>
47 std::streamsize
<A CLASS=
"documented" HREF=
"#optimal_buffer_size">optimal_buffer_size
</A>(T
& t);
49 } }
<SPAN CLASS=
"comment">// End namespace boost::io
</SPAN></PRE>
51 <A NAME=
"template_params"></A>
52 <H4>Template Parameters
</H4>
54 <TABLE STYLE=
"margin-left:2em" BORDER=
0 CELLPADDING=
2>
57 <TD VALIGN=
"top"><I>T
</I></TD><TD WIDTH=
"2em" VALIGN=
"top">-
</TD>
58 <TD>A model of
<A HREF=
"../concepts/filter.html">Filter
</A> or
<A HREF=
"../concepts/device.html">Device
</A>.
62 <A NAME=
"optimal_buffer_size"></A>
63 <PRE CLASS=
"broken_ie"><SPAN CLASS=
"keyword">template
</SPAN><<SPAN CLASS=
"keyword">typename
</SPAN> T
>
64 std::streamsize optimal_buffer_size(T
& t);
</PRE>
66 <P>The semantics of
<CODE>optimal_buffer_size
</CODE> depends on the
<A HREF=
"../guide/traits.html#category">category
</A> of
<CODE>T
</CODE> as follows:
</P>
68 <TABLE STYLE=
"margin-left:2em;margin-bottom:2em" BORDER=
1 CELLPADDING=
4>
69 <TR><TH><CODE>category_of
<T
>::type
</CODE></TH><TH>semantics
</TH></TR>
71 <TD VALIGN=
"top">convertible to
<A HREF=
"../guide/traits.html#category_tags"><CODE>optimally_buffered_tag
</CODE></A></TD>
72 <TD>Returns
<CODE>t.optimal_buffer_size()
</CODE>.
</TD>
75 <TD VALIGN=
"top">convertible to
<A HREF=
"../guide/traits.html#category_tags"><CODE>filter_tag
</CODE></A> but not to
<A HREF=
"../guide/traits.html#category_tags"><CODE>optimally_buffered_tag
</CODE></A></TD>
76 <TD>Returns
<A HREF='../macros/buffer_sizes.html'
><CODE>default_filter_buffer_size
</CODE></A>.
</TD>
79 <TD VALIGN=
"top">otherwise
</TD>
80 <TD>Returns
<A HREF='../macros/buffer_sizes.html'
><CODE>default_device_buffer_size
</CODE></A>.
</TD>
88 <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>
90 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>)