grpc/cpp/classgrpc__impl_1_1_server_...

318 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::ServerSplitStreamer&lt; RequestType, ResponseType &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_split_streamer.html">ServerSplitStreamer</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::ServerSplitStreamer&lt; RequestType, ResponseType &gt; Class Template Reference<span class="mlabels"><span class="mlabel">final</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>A class to represent a flow-controlled server-side streaming call.
<a href="classgrpc__impl_1_1_server_split_streamer.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:a7ed1feb396a4635f44cc9b29817b6858"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_split_streamer.html#a7ed1feb396a4635f44cc9b29817b6858">SendInitialMetadata</a> () override</td></tr>
<tr class="memdesc:a7ed1feb396a4635f44cc9b29817b6858"><td class="mdescLeft">&#160;</td><td class="mdescRight">Block to send initial metadata to client. <a href="classgrpc__impl_1_1_server_split_streamer.html#a7ed1feb396a4635f44cc9b29817b6858">More...</a><br /></td></tr>
<tr class="separator:a7ed1feb396a4635f44cc9b29817b6858"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a073e1f6ef5e6a366a0b103008f63a216"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_split_streamer.html#a073e1f6ef5e6a366a0b103008f63a216">NextMessageSize</a> (uint32_t *sz) override</td></tr>
<tr class="memdesc:a073e1f6ef5e6a366a0b103008f63a216"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get an upper bound on the request message size from the client. <a href="classgrpc__impl_1_1_server_split_streamer.html#a073e1f6ef5e6a366a0b103008f63a216">More...</a><br /></td></tr>
<tr class="separator:a073e1f6ef5e6a366a0b103008f63a216"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a31c5a6e2b0bb3e1ce416273259a1fcce"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_split_streamer.html#a31c5a6e2b0bb3e1ce416273259a1fcce">Read</a> (RequestType *request) override</td></tr>
<tr class="memdesc:a31c5a6e2b0bb3e1ce416273259a1fcce"><td class="mdescLeft">&#160;</td><td class="mdescRight">Read a message of type <em>R</em> into <em>msg</em>. <a href="classgrpc__impl_1_1_server_split_streamer.html#a31c5a6e2b0bb3e1ce416273259a1fcce">More...</a><br /></td></tr>
<tr class="separator:a31c5a6e2b0bb3e1ce416273259a1fcce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f99f9a385235c82762edff8fbe55d1c"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_split_streamer.html#a4f99f9a385235c82762edff8fbe55d1c">Write</a> (const ResponseType &amp;response, ::<a class="el" href="classgrpc_1_1_write_options.html">grpc::WriteOptions</a> options) override</td></tr>
<tr class="memdesc:a4f99f9a385235c82762edff8fbe55d1c"><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_split_streamer.html#a4f99f9a385235c82762edff8fbe55d1c">More...</a><br /></td></tr>
<tr class="separator:a4f99f9a385235c82762edff8fbe55d1c"><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; ResponseType &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 ResponseType &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 ResponseType &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; RequestType &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:a93f0de52b4a12ad301edbb87e0e10baf"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgrpc__impl_1_1_server_split_streamer.html#a93f0de52b4a12ad301edbb87e0e10baf">::grpc_impl::internal::TemplatedBidiStreamingHandler&lt; ServerSplitStreamer&lt; RequestType, ResponseType &gt;, false &gt;</a></td></tr>
<tr class="separator:a93f0de52b4a12ad301edbb87e0e10baf"><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 RequestType, class ResponseType&gt;<br />
class grpc_impl::ServerSplitStreamer&lt; RequestType, ResponseType &gt;</h3>
<p>A class to represent a flow-controlled server-side streaming call. </p>
<p>This is something of a hybrid between server-side and bidi streaming. This is invoked through a server-side streaming call on the client side, but the server responds to it as though it were a bidi streaming call that must first have exactly 1 Read and then any number of Writes. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a073e1f6ef5e6a366a0b103008f63a216"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a073e1f6ef5e6a366a0b103008f63a216">&#9670;&nbsp;</a></span>NextMessageSize()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RequestType , class ResponseType &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_split_streamer.html">grpc_impl::ServerSplitStreamer</a>&lt; RequestType, ResponseType &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 request message size from the client. </p>
<p>Implements <a class="el" href="classgrpc__impl_1_1internal_1_1_reader_interface.html#acb8defa36c3981335a4de3b3a77fc890">grpc_impl::internal::ReaderInterface&lt; RequestType &gt;</a>.</p>
</div>
</div>
<a id="a31c5a6e2b0bb3e1ce416273259a1fcce"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a31c5a6e2b0bb3e1ce416273259a1fcce">&#9670;&nbsp;</a></span>Read()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RequestType , class ResponseType &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_split_streamer.html">grpc_impl::ServerSplitStreamer</a>&lt; RequestType, ResponseType &gt;::Read </td>
<td>(</td>
<td class="paramtype">RequestType *&#160;</td>
<td class="paramname"><em>request</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>Read a message of type <em>R</em> into <em>msg</em>. </p>
<p>Completion will be notified by <em>tag</em> on the associated completion queue. This is thread-safe with respect to <em>Write</em> or <em>WritesDone</em> methods. It should not be called concurrently with other streaming APIs on the same stream. It is not meaningful to call it concurrently with another <em>ReaderInterface::Read</em> on the same stream since reads on the same stream are delivered in order.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[out]</td><td class="paramname">msg</td><td>Where to eventually store the read message. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">tag</td><td>The tag identifying the operation. </td></tr>
</table>
</dd>
</dl>
<p>Implements <a class="el" href="classgrpc__impl_1_1internal_1_1_reader_interface.html#a005a2778e6005e25555dd0fdeb2db1a7">grpc_impl::internal::ReaderInterface&lt; RequestType &gt;</a>.</p>
</div>
</div>
<a id="a7ed1feb396a4635f44cc9b29817b6858"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7ed1feb396a4635f44cc9b29817b6858">&#9670;&nbsp;</a></span>SendInitialMetadata()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RequestType , class ResponseType &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_split_streamer.html">grpc_impl::ServerSplitStreamer</a>&lt; RequestType, ResponseType &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>Block to send initial metadata to client. </p>
<p>Implicit input parameter:</p><ul>
<li>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 will be used for sending initial metadata. </li>
</ul>
<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="a4f99f9a385235c82762edff8fbe55d1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f99f9a385235c82762edff8fbe55d1c">&#9670;&nbsp;</a></span>Write()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RequestType , class ResponseType &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_split_streamer.html">grpc_impl::ServerSplitStreamer</a>&lt; RequestType, ResponseType &gt;::Write </td>
<td>(</td>
<td class="paramtype">const ResponseType &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; ResponseType &gt;</a>.</p>
</div>
</div>
<h2 class="groupheader">Friends And Related Function Documentation</h2>
<a id="a93f0de52b4a12ad301edbb87e0e10baf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a93f0de52b4a12ad301edbb87e0e10baf">&#9670;&nbsp;</a></span>::grpc_impl::internal::TemplatedBidiStreamingHandler&lt; ServerSplitStreamer&lt; RequestType, ResponseType &gt;, false &gt;</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class RequestType , class ResponseType &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_split_streamer.html">ServerSplitStreamer</a>&lt; RequestType, ResponseType &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>