optimal_buffer_size.html 3.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
  2. <HTML>
  3. <HEAD>
  4. <TITLE>Function Template optimal_buffer_size</TITLE>
  5. <LINK REL="stylesheet" HREF="../../../../boost.css">
  6. <LINK REL="stylesheet" HREF="../theme/iostreams.css">
  7. </HEAD>
  8. <BODY>
  9. <!-- Begin Banner -->
  10. <H1 CLASS="title">Function Template <CODE>optimal_buffer_size</CODE></H1>
  11. <HR CLASS="banner">
  12. <!-- End Banner -->
  13. <DL class="page-index">
  14. <DT><A href="#overview">Overview</A></DT>
  15. <DT><A href="#headers">Headers</A></DT>
  16. <DT><A href="#reference">Reference</A></DT>
  17. </DL>
  18. <A NAME="overview"></A>
  19. <H2>Overview</H2>
  20. <P>
  21. 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.
  22. </P>
  23. <A NAME="headers"></A>
  24. <H2>Headers</H2>
  25. <DL>
  26. <DT><A CLASS="header" HREF="../../../../boost/iostreams/optimal_buffer_size.hpp"><CODE>&lt;boost/iostreams/optimal_buffer_size.hpp&gt;</CODE></A></DT>
  27. <DT><A CLASS="header" HREF="../../../../boost/iostreams/operations.hpp"><CODE>&lt;boost/iostreams/operations.hpp&gt;</CODE></A></DT>
  28. </DL>
  29. <A NAME="reference"></A>
  30. <H2>Reference</H2>
  31. <A NAME="synopsis"></A>
  32. <H4>Synopsis</H4>
  33. <PRE CLASS="broken_ie"><SPAN CLASS="keyword">namespace</SPAN> boost { <SPAN CLASS="keyword">namespace</SPAN> iostreams {
  34. <SPAN CLASS="keyword">template</SPAN>&lt;<SPAN CLASS="keyword">typename</SPAN> <A CLASS="documented" HREF="#template_params">T</A>&gt;
  35. std::streamsize <A CLASS="documented" HREF="#optimal_buffer_size">optimal_buffer_size</A>(T&amp; t);
  36. } } <SPAN CLASS="comment">// End namespace boost::io</SPAN></PRE>
  37. <A NAME="template_params"></A>
  38. <H4>Template Parameters</H4>
  39. <TABLE STYLE="margin-left:2em" BORDER=0 CELLPADDING=2>
  40. <TR>
  41. <TR>
  42. <TD VALIGN="top"><I>T</I></TD><TD WIDTH="2em" VALIGN="top">-</TD>
  43. <TD>A model of <A HREF="../concepts/filter.html">Filter</A> or <A HREF="../concepts/device.html">Device</A>.
  44. </TR>
  45. </TABLE>
  46. <A NAME="optimal_buffer_size"></A>
  47. <PRE CLASS="broken_ie"><SPAN CLASS="keyword">template</SPAN>&lt;<SPAN CLASS="keyword">typename</SPAN> T&gt;
  48. std::streamsize optimal_buffer_size(T&amp; t);</PRE>
  49. <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>
  50. <TABLE STYLE="margin-left:2em;margin-bottom:2em" BORDER=1 CELLPADDING=4>
  51. <TR><TH><CODE>category_of&lt;T&gt;::type</CODE></TH><TH>semantics</TH></TR>
  52. <TR>
  53. <TD VALIGN="top">convertible to <A HREF="../guide/traits.html#category_tags"><CODE>optimally_buffered_tag</CODE></A></TD>
  54. <TD>Returns <CODE>t.optimal_buffer_size()</CODE>.</TD>
  55. </TR>
  56. <TR>
  57. <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>
  58. <TD>Returns <A HREF='../macros/buffer_sizes.html'><CODE>default_filter_buffer_size</CODE></A>.</TD>
  59. </TR>
  60. <TR>
  61. <TD VALIGN="top">otherwise</TD>
  62. <TD>Returns <A HREF='../macros/buffer_sizes.html'><CODE>default_device_buffer_size</CODE></A>.</TD>
  63. </TR>
  64. </TABLE>
  65. <!-- Begin Footer -->
  66. <HR>
  67. <P CLASS="copyright">&copy; Copyright 2008 <a href="http://www.coderage.com/" target="_top">CodeRage, LLC</a><br/>&copy; Copyright 2004-2007 <a href="https://www.boost.org/users/people/jonathan_turkanis.html" target="_top">Jonathan Turkanis</a></P>
  68. <P CLASS="copyright">
  69. 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>)
  70. </P>
  71. <!-- End Footer -->
  72. </BODY>