grpc/cpp/classgrpc__impl_1_1_server_...

315 lines
21 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GRPC C++: grpc_impl::ServerReaderWriter&lt; W, R &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GRPC C++
&#160;<span id="projectnumber">1.31.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
onmouseover="return searchBox.OnSearchSelectShow()"
onmouseout="return searchBox.OnSearchSelectHide()"
onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>
<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0"
name="MSearchResults" id="MSearchResults">
</iframe>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacegrpc__impl.html">grpc_impl</a></li><li class="navelem"><a class="el" href="classgrpc__impl_1_1_server_reader_writer.html">ServerReaderWriter</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#friends">Friends</a> </div>
<div class="headertitle">
<div class="title">grpc_impl::ServerReaderWriter&lt; W, R &gt; Class Template Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>Synchronous (blocking) server-side API for a bidirectional streaming call, where the incoming message stream coming from the client has messages of type <em>R</em>, and the outgoing message streaming coming from the server has messages of type <em>W</em>.
<a href="classgrpc__impl_1_1_server_reader_writer.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="impl_2codegen_2sync__stream__impl_8h_source.html">sync_stream_impl.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:ad4925fff21599e76a9a44eb5a8cee1be"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_reader_writer.html#ad4925fff21599e76a9a44eb5a8cee1be">SendInitialMetadata</a> () override</td></tr>
<tr class="memdesc:ad4925fff21599e76a9a44eb5a8cee1be"><td class="mdescLeft">&#160;</td><td class="mdescRight">See the <em>ServerStreamingInterface.SendInitialMetadata</em> method for semantics. <a href="classgrpc__impl_1_1_server_reader_writer.html#ad4925fff21599e76a9a44eb5a8cee1be">More...</a><br /></td></tr>
<tr class="separator:ad4925fff21599e76a9a44eb5a8cee1be"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed2f41fb63ee98dd1bd81a22577588a7"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_reader_writer.html#aed2f41fb63ee98dd1bd81a22577588a7">NextMessageSize</a> (uint32_t *sz) override</td></tr>
<tr class="memdesc:aed2f41fb63ee98dd1bd81a22577588a7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get an upper bound on the next message size available for reading on this stream. <a href="classgrpc__impl_1_1_server_reader_writer.html#aed2f41fb63ee98dd1bd81a22577588a7">More...</a><br /></td></tr>
<tr class="separator:aed2f41fb63ee98dd1bd81a22577588a7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa055ed5d1d18000f31ead21219782fe6"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_reader_writer.html#aa055ed5d1d18000f31ead21219782fe6">Read</a> (R *msg) override</td></tr>
<tr class="memdesc:aa055ed5d1d18000f31ead21219782fe6"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block to read a message and parse to <em>msg</em>. <a href="classgrpc__impl_1_1_server_reader_writer.html#aa055ed5d1d18000f31ead21219782fe6">More...</a><br /></td></tr>
<tr class="separator:aa055ed5d1d18000f31ead21219782fe6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af440a2bd3b1ff7e2e2c1b6e4aa14a66a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_reader_writer.html#af440a2bd3b1ff7e2e2c1b6e4aa14a66a">Write</a> (const W &amp;msg, ::<a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a> options) override</td></tr>
<tr class="memdesc:af440a2bd3b1ff7e2e2c1b6e4aa14a66a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block to write <em>msg</em> to the stream with WriteOptions <em>options</em>. <a href="classgrpc__impl_1_1_server_reader_writer.html#af440a2bd3b1ff7e2e2c1b6e4aa14a66a">More...</a><br /></td></tr>
<tr class="separator:af440a2bd3b1ff7e2e2c1b6e4aa14a66a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classgrpc__impl_1_1internal_1_1_server_streaming_interface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classgrpc__impl_1_1internal_1_1_server_streaming_interface')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classgrpc__impl_1_1internal_1_1_server_streaming_interface.html">grpc_impl::internal::ServerStreamingInterface</a></td></tr>
<tr class="memitem:aaa6dd6b48816911391bb7283dd49da37 inherit pub_methods_classgrpc__impl_1_1internal_1_1_server_streaming_interface"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1internal_1_1_server_streaming_interface.html#aaa6dd6b48816911391bb7283dd49da37">~ServerStreamingInterface</a> ()</td></tr>
<tr class="separator:aaa6dd6b48816911391bb7283dd49da37 inherit pub_methods_classgrpc__impl_1_1internal_1_1_server_streaming_interface"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classgrpc__impl_1_1internal_1_1_writer_interface.html">grpc_impl::internal::WriterInterface&lt; W &gt;</a></td></tr>
<tr class="memitem:af986fc5eeb12384945172d9711867889 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1internal_1_1_writer_interface.html#af986fc5eeb12384945172d9711867889">~WriterInterface</a> ()</td></tr>
<tr class="separator:af986fc5eeb12384945172d9711867889 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8cd2f943f38815b25c71275f96a5c742 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1internal_1_1_writer_interface.html#a8cd2f943f38815b25c71275f96a5c742">Write</a> (const W &amp;msg)</td></tr>
<tr class="memdesc:a8cd2f943f38815b25c71275f96a5c742 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block to write <em>msg</em> to the stream with default write options. <a href="classgrpc__impl_1_1internal_1_1_writer_interface.html#a8cd2f943f38815b25c71275f96a5c742">More...</a><br /></td></tr>
<tr class="separator:a8cd2f943f38815b25c71275f96a5c742 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dcc2c52401f3bfc7f87072954ec6808 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1internal_1_1_writer_interface.html#a6dcc2c52401f3bfc7f87072954ec6808">WriteLast</a> (const W &amp;msg, ::<a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a> options)</td></tr>
<tr class="memdesc:a6dcc2c52401f3bfc7f87072954ec6808 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="mdescLeft">&#160;</td><td class="mdescRight">Write <em>msg</em> and coalesce it with the writing of trailing metadata, using WriteOptions <em>options</em>. <a href="classgrpc__impl_1_1internal_1_1_writer_interface.html#a6dcc2c52401f3bfc7f87072954ec6808">More...</a><br /></td></tr>
<tr class="separator:a6dcc2c52401f3bfc7f87072954ec6808 inherit pub_methods_classgrpc__impl_1_1internal_1_1_writer_interface"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="inherit_header pub_methods_classgrpc__impl_1_1internal_1_1_reader_interface"><td colspan="2" onclick="javascript:toggleInherit('pub_methods_classgrpc__impl_1_1internal_1_1_reader_interface')"><img src="closed.png" alt="-"/>&#160;Public Member Functions inherited from <a class="el" href="classgrpc__impl_1_1internal_1_1_reader_interface.html">grpc_impl::internal::ReaderInterface&lt; R &gt;</a></td></tr>
<tr class="memitem:ae4f2b89ea092e964b6e7dd9f220138fb inherit pub_methods_classgrpc__impl_1_1internal_1_1_reader_interface"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1internal_1_1_reader_interface.html#ae4f2b89ea092e964b6e7dd9f220138fb">~ReaderInterface</a> ()</td></tr>
<tr class="separator:ae4f2b89ea092e964b6e7dd9f220138fb inherit pub_methods_classgrpc__impl_1_1internal_1_1_reader_interface"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:ab42ef04622d84924a8ec7bb603f35646"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_reader_writer.html#ab42ef04622d84924a8ec7bb603f35646">::grpc_impl::internal::TemplatedBidiStreamingHandler&lt; ServerReaderWriter&lt; W, R &gt;, false &gt;</a></td></tr>
<tr class="separator:ab42ef04622d84924a8ec7bb603f35646"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class W, class R&gt;<br />
class grpc_impl::ServerReaderWriter&lt; W, R &gt;</h3>
<p>Synchronous (blocking) server-side API for a bidirectional streaming call, where the incoming message stream coming from the client has messages of type <em>R</em>, and the outgoing message streaming coming from the server has messages of type <em>W</em>. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aed2f41fb63ee98dd1bd81a22577588a7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aed2f41fb63ee98dd1bd81a22577588a7">&#9670;&nbsp;</a></span>NextMessageSize()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classgrpc__impl_1_1_server_reader_writer.html">grpc_impl::ServerReaderWriter</a>&lt; W, R &gt;::NextMessageSize </td>
<td>(</td>
<td class="paramtype">uint32_t *&#160;</td>
<td class="paramname"><em>sz</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Get an upper bound on the next message size available for reading on this stream. </p>
<p>Implements <a class="el" href="classgrpc__impl_1_1internal_1_1_reader_interface.html#acb8defa36c3981335a4de3b3a77fc890">grpc_impl::internal::ReaderInterface&lt; R &gt;</a>.</p>
</div>
</div>
<a id="aa055ed5d1d18000f31ead21219782fe6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa055ed5d1d18000f31ead21219782fe6">&#9670;&nbsp;</a></span>Read()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classgrpc__impl_1_1_server_reader_writer.html">grpc_impl::ServerReaderWriter</a>&lt; W, R &gt;::Read </td>
<td>(</td>
<td class="paramtype">R *&#160;</td>
<td class="paramname"><em>msg</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Block to read a message and parse to <em>msg</em>. </p>
<p>Returns <em>true</em> on success. This is thread-safe with respect to <em>Write</em> or \WritesDone methods on the same stream. It should not be called concurrently with another <em>Read</em> on the same stream as the order of delivery will not be defined.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>The read message.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><em>false</em> when there will be no more incoming messages, either because the other side has called <em>WritesDone()</em> or the stream has failed (or been cancelled). </dd></dl>
<p>Implements <a class="el" href="classgrpc__impl_1_1internal_1_1_reader_interface.html#a005a2778e6005e25555dd0fdeb2db1a7">grpc_impl::internal::ReaderInterface&lt; R &gt;</a>.</p>
</div>
</div>
<a id="ad4925fff21599e76a9a44eb5a8cee1be"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad4925fff21599e76a9a44eb5a8cee1be">&#9670;&nbsp;</a></span>SendInitialMetadata()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classgrpc__impl_1_1_server_reader_writer.html">grpc_impl::ServerReaderWriter</a>&lt; W, R &gt;::SendInitialMetadata </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>See the <em>ServerStreamingInterface.SendInitialMetadata</em> method for semantics. </p>
<p>Note that initial metadata will be affected by the <em><a class="el" href="classgrpc__impl_1_1_server_context.html" title="A ServerContext or CallbackServerContext allows the code implementing a service handler to:">ServerContext</a></em> associated with this call. </p>
<p>Implements <a class="el" href="classgrpc__impl_1_1internal_1_1_server_streaming_interface.html#ab7fcbcbf97962c44a479c0b19a771490">grpc_impl::internal::ServerStreamingInterface</a>.</p>
</div>
</div>
<a id="af440a2bd3b1ff7e2e2c1b6e4aa14a66a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af440a2bd3b1ff7e2e2c1b6e4aa14a66a">&#9670;&nbsp;</a></span>Write()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classgrpc__impl_1_1_server_reader_writer.html">grpc_impl::ServerReaderWriter</a>&lt; W, R &gt;::Write </td>
<td>(</td>
<td class="paramtype">const W &amp;&#160;</td>
<td class="paramname"><em>msg</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">::<a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a>&#160;</td>
<td class="paramname"><em>options</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">override</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Block to write <em>msg</em> to the stream with WriteOptions <em>options</em>. </p>
<p>This is thread-safe with respect to <em>ReaderInterface::Read</em> </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">msg</td><td>The message to be written to the stream. </td></tr>
<tr><td class="paramname">options</td><td>The WriteOptions affecting the write operation.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><em>true</em> on success, <em>false</em> when the stream has been closed. </dd></dl>
<p>Implements <a class="el" href="classgrpc__impl_1_1internal_1_1_writer_interface.html#a289bb880cfc060c6105fe8ca84198a5c">grpc_impl::internal::WriterInterface&lt; W &gt;</a>.</p>
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="ab42ef04622d84924a8ec7bb603f35646"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab42ef04622d84924a8ec7bb603f35646">&#9670;&nbsp;</a></span>::grpc_impl::internal::TemplatedBidiStreamingHandler&lt; ServerReaderWriter&lt; W, R &gt;, false &gt;</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class W , class R &gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">friend class ::<a class="el" href="classgrpc__impl_1_1internal_1_1_templated_bidi_streaming_handler.html">grpc_impl::internal::TemplatedBidiStreamingHandler</a>&lt; <a class="el" href="classgrpc__impl_1_1_server_reader_writer.html">ServerReaderWriter</a>&lt; W, R &gt;, false &gt;</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/grpcpp/impl/codegen/<a class="el" href="impl_2codegen_2sync__stream__impl_8h_source.html">sync_stream_impl.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated on Tue Aug 18 2020 16:24:48 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>