| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.13"/>
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>GRPC C++: include/grpcpp/impl/codegen/proto_utils.h Source File</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++
-  <span id="projectnumber">1.11.0</span>
- </div>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- <!-- end header part -->
- <!-- Generated by Doxygen 1.8.13 -->
- <script type="text/javascript">
- var searchBox = new SearchBox("searchBox", "search",false,'Search');
- </script>
- <script type="text/javascript" src="menudata.js"></script>
- <script type="text/javascript" src="menu.js"></script>
- <script type="text/javascript">
- $(function() {
- initMenu('',true,false,'search.php','Search');
- $(document).ready(function() { init_search(); });
- });
- </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="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_412f9a3d5dfcba8716486cd870ef4586.html">grpcpp</a></li><li class="navelem"><a class="el" href="dir_84040d6f573b73aa8d12512b533ede11.html">impl</a></li><li class="navelem"><a class="el" href="dir_a33e3e3a3b205cffecbb359564791f71.html">codegen</a></li> </ul>
- </div>
- </div><!-- top -->
- <div class="header">
- <div class="headertitle">
- <div class="title">proto_utils.h</div> </div>
- </div><!--header-->
- <div class="contents">
- <a href="grpcpp_2impl_2codegen_2proto__utils_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * Copyright 2015 gRPC authors.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * Licensed under the Apache License, Version 2.0 (the "License");</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * you may not use this file except in compliance with the License.</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * You may obtain a copy of the License at</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * distributed under the License is distributed on an "AS IS" BASIS,</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * See the License for the specific language governing permissions and</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> *</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> */</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> </div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#ifndef GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#define GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> </div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="preprocessor">#include <type_traits></span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> </div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="preprocessor">#include <<a class="code" href="impl_2codegen_2byte__buffer__reader_8h.html">grpc/impl/codegen/byte_buffer_reader.h</a>></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="preprocessor">#include <<a class="code" href="grpc__types_8h.html">grpc/impl/codegen/grpc_types.h</a>></span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="preprocessor">#include <<a class="code" href="grpc_2impl_2codegen_2slice_8h.html">grpc/impl/codegen/slice.h</a>></span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <<a class="code" href="grpcpp_2impl_2codegen_2config__protobuf_8h.html">grpcpp/impl/codegen/config_protobuf.h</a>></span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="preprocessor">#include <<a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html">grpcpp/impl/codegen/core_codegen_interface.h</a>></span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="preprocessor">#include <<a class="code" href="grpcpp_2impl_2codegen_2serialization__traits_8h.html">grpcpp/impl/codegen/serialization_traits.h</a>></span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <<a class="code" href="grpcpp_2impl_2codegen_2status_8h.html">grpcpp/impl/codegen/status.h</a>></span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> </div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="keyword">namespace </span><a class="code" href="namespacegrpc.html">grpc</a> {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="keyword">extern</span> CoreCodegenInterface* <a class="code" href="namespacegrpc.html#abbcecc18dae64c65df0b6d9aa8bf67a8">g_core_codegen_interface</a>;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="keyword">namespace </span>internal {</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> </div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">class </span>GrpcBufferWriterPeer;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> </div><div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="namespacegrpc_1_1internal.html#ae1df79d0af1deae726bf9f09b87e92a9"> 40</a></span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="namespacegrpc_1_1internal.html#ae1df79d0af1deae726bf9f09b87e92a9">kGrpcBufferWriterMaxBufferLength</a> = 1024 * 1024;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> </div><div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html"> 42</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html">GrpcBufferWriter</a> : <span class="keyword">public</span> <a class="code" href="namespacegrpc_1_1protobuf_1_1io.html#aafcf83341d287d00418952374bc82ce1">::grpc::protobuf::io::ZeroCopyOutputStream</a> {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#ad5528cbf91654e1353a744076b343110"> 44</a></span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#ad5528cbf91654e1353a744076b343110">GrpcBufferWriter</a>(<a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>** bp, <span class="keywordtype">int</span> block_size, <span class="keywordtype">int</span> total_size)</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  : <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#aba847098b0e3f0f72abed7e66be4b04a">block_size_</a>(block_size),</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a86e7b15afcaeba3fdc3cfbf9292115f4">total_size_</a>(total_size),</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a>(0),</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649">have_backup_</a>(false) {</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  *bp = g_core_codegen_interface->grpc_raw_byte_buffer_create(NULL, 0);</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a5fd914fec40a3dd722c9e53a94b214a0">slice_buffer_</a> = &(*bp)->data.raw.slice_buffer;</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  }</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> </div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a8a3b11e59164a65779749ab920c7ec30"> 53</a></span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a8a3b11e59164a65779749ab920c7ec30">~GrpcBufferWriter</a>()<span class="keyword"> override </span>{</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordflow">if</span> (<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649">have_backup_</a>) {</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  g_core_codegen_interface->grpc_slice_unref(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0">backup_slice_</a>);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  }</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00059"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a6bb63037ac69748f83758bafdf150663"> 59</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a6bb63037ac69748f83758bafdf150663">Next</a>(<span class="keywordtype">void</span>** data, <span class="keywordtype">int</span>* size)<span class="keyword"> override </span>{</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="comment">// Protobuf should not ask for more memory than total_size_.</span></div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a> < <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a86e7b15afcaeba3fdc3cfbf9292115f4">total_size_</a>);</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordtype">size_t</span> remain = <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a86e7b15afcaeba3fdc3cfbf9292115f4">total_size_</a> - <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a>;</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordflow">if</span> (<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649">have_backup_</a>) {</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a> = <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0">backup_slice_</a>;</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649">have_backup_</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">if</span> (<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>) > remain) {</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a6791fa7be0a1a9144e005cfea7baea84">GRPC_SLICE_SET_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>, remain);</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  }</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="comment">// When less than a whole block is needed, only allocate that much.</span></div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <span class="comment">// But make sure the allocated slice is not inlined.</span></div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  <span class="keywordtype">size_t</span> allocate_length =</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>  remain > <span class="keyword">static_cast<</span><span class="keywordtype">size_t</span><span class="keyword">></span>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#aba847098b0e3f0f72abed7e66be4b04a">block_size_</a>) ? <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#aba847098b0e3f0f72abed7e66be4b04a">block_size_</a> : remain;</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a> = g_core_codegen_interface->grpc_slice_malloc(</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  allocate_length > <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae65fc74cb3afbcd3299a1c93f90bae20">GRPC_SLICE_INLINED_SIZE</a></div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  ? allocate_length</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  : <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae65fc74cb3afbcd3299a1c93f90bae20">GRPC_SLICE_INLINED_SIZE</a> + 1);</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  }</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>  *data = <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a8a15783c251cdeb18c3f8b0ad41d0352">GRPC_SLICE_START_PTR</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>);</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  <span class="comment">// On win x64, int is only 32bit</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a>(<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>) <= INT_MAX);</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  byte_count_ += * size = (int)<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>);</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  g_core_codegen_interface->grpc_slice_buffer_add(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a5fd914fec40a3dd722c9e53a94b214a0">slice_buffer_</a>, <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>);</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  }</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span> </div><div class="line"><a name="l00087"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a4890fb61a71f4aa0404412d1bb5e6f94"> 87</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a4890fb61a71f4aa0404412d1bb5e6f94">BackUp</a>(<span class="keywordtype">int</span> count)<span class="keyword"> override </span>{</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  g_core_codegen_interface->grpc_slice_buffer_pop(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a5fd914fec40a3dd722c9e53a94b214a0">slice_buffer_</a>);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordflow">if</span> ((<span class="keywordtype">size_t</span>)count == <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>)) {</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0">backup_slice_</a> = <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>;</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  } <span class="keywordflow">else</span> {</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0">backup_slice_</a> = g_core_codegen_interface->grpc_slice_split_tail(</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  &<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>, <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>) - count);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  g_core_codegen_interface->grpc_slice_buffer_add(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a5fd914fec40a3dd722c9e53a94b214a0">slice_buffer_</a>, <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>  }</div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="comment">// It's dangerous to keep an inlined grpc_slice as the backup slice, since</span></div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="comment">// on a following Next() call, a reference will be returned to this slice</span></div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="comment">// via GRPC_SLICE_START_PTR, which will not be an adddress held by</span></div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="comment">// slice_buffer_.</span></div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649">have_backup_</a> = <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0">backup_slice_</a>.<a class="code" href="structgrpc__slice.html#a467ef319d024f1897c7ff3bdadb78493">refcount</a> != NULL;</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a> -= count;</div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  }</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span> </div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af7b145efa2ac6b4a3a72a331af9d6466"> 104</a></span>  <a class="code" href="namespacegrpc_1_1protobuf.html#ad614bff24fe4674ca81af74c769a7b32">grpc::protobuf::int64</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af7b145efa2ac6b4a3a72a331af9d6466">ByteCount</a>()<span class="keyword"> const override </span>{ <span class="keywordflow">return</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a>; }</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span> </div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#ad7d78d8afffe2e98007bd63036c19c42"> 107</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#ad7d78d8afffe2e98007bd63036c19c42">GrpcBufferWriterPeer</a>;</div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#aba847098b0e3f0f72abed7e66be4b04a"> 108</a></span>  <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#aba847098b0e3f0f72abed7e66be4b04a">block_size_</a>;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a86e7b15afcaeba3fdc3cfbf9292115f4"> 109</a></span>  <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a86e7b15afcaeba3fdc3cfbf9292115f4">total_size_</a>;</div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1"> 110</a></span>  int64_t <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a>;</div><div class="line"><a name="l00111"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a5fd914fec40a3dd722c9e53a94b214a0"> 111</a></span>  <a class="code" href="structgrpc__slice__buffer.html">grpc_slice_buffer</a>* <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a5fd914fec40a3dd722c9e53a94b214a0">slice_buffer_</a>;</div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649"> 112</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649">have_backup_</a>;</div><div class="line"><a name="l00113"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0"> 113</a></span>  <a class="code" href="structgrpc__slice.html">grpc_slice</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0">backup_slice_</a>;</div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976"> 114</a></span>  <a class="code" href="structgrpc__slice.html">grpc_slice</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>;</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> };</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div><div class="line"><a name="l00117"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html"> 117</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html">GrpcBufferReader</a> : <span class="keyword">public</span> <a class="code" href="namespacegrpc_1_1protobuf_1_1io.html#ae16bb38d6b730de308f0be4eb43931b4">::grpc::protobuf::io::ZeroCopyInputStream</a> {</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00119"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a17568350c9ee6a89e0a901cfff8401f6"> 119</a></span>  <span class="keyword">explicit</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a17568350c9ee6a89e0a901cfff8401f6">GrpcBufferReader</a>(<a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>* buffer)</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  : <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a>(0), backup_count_(0), status_() {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  <span class="keywordflow">if</span> (!g_core_codegen_interface->grpc_byte_buffer_reader_init(&reader_,</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  buffer)) {</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  status_ = <a class="code" href="classgrpc_1_1_status.html">Status</a>(<a class="code" href="namespacegrpc.html#aff1730578c90160528f6a8d67ef5c43ba0ae30536146394965fd8ad64c2d414f3">StatusCode::INTERNAL</a>,</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <span class="stringliteral">"Couldn't initialize byte buffer reader"</span>);</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  }</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  }</div><div class="line"><a name="l00127"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a5b8f11869c456df354a87dabfaec97f1"> 127</a></span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a5b8f11869c456df354a87dabfaec97f1">~GrpcBufferReader</a>()<span class="keyword"> override </span>{</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  g_core_codegen_interface->grpc_byte_buffer_reader_destroy(&reader_);</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  }</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> </div><div class="line"><a name="l00131"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#ae66351a9aa970bdb225bbba45f279bb2"> 131</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#ae66351a9aa970bdb225bbba45f279bb2">Next</a>(<span class="keyword">const</span> <span class="keywordtype">void</span>** data, <span class="keywordtype">int</span>* size)<span class="keyword"> override </span>{</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keywordflow">if</span> (!status_.ok()) {</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keywordflow">if</span> (backup_count_ > 0) {</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  *data = <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a8a15783c251cdeb18c3f8b0ad41d0352">GRPC_SLICE_START_PTR</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>) + <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>) -</div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  backup_count_;</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a>(backup_count_ <= INT_MAX);</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  *size = (int)backup_count_;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  backup_count_ = 0;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  }</div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>  <span class="keywordflow">if</span> (!g_core_codegen_interface->grpc_byte_buffer_reader_next(&reader_,</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  &<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>)) {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  }</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  g_core_codegen_interface->grpc_slice_unref(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  *data = <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a8a15783c251cdeb18c3f8b0ad41d0352">GRPC_SLICE_START_PTR</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>);</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  <span class="comment">// On win x64, int is only 32bit</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a>(<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>) <= INT_MAX);</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a> += * size = (int)<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">slice_</a>);</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  }</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span> </div><div class="line"><a name="l00155"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a34cf482f798ff91efce00096851f787b"> 155</a></span>  <a class="code" href="classgrpc_1_1_status.html">Status</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a34cf482f798ff91efce00096851f787b">status</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> status_; }</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> </div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a724c133b537616eee22562b3e89885c8"> 157</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a724c133b537616eee22562b3e89885c8">BackUp</a>(<span class="keywordtype">int</span> count)<span class="keyword"> override </span>{ backup_count_ = count; }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a7aad5fe555993d8f86380e3b4c65db1c"> 159</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a7aad5fe555993d8f86380e3b4c65db1c">Skip</a>(<span class="keywordtype">int</span> count)<span class="keyword"> override </span>{</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keyword">const</span> <span class="keywordtype">void</span>* data;</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  <span class="keywordtype">int</span> size;</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  <span class="keywordflow">while</span> (<a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a6bb63037ac69748f83758bafdf150663">Next</a>(&data, &size)) {</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keywordflow">if</span> (size >= count) {</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a4890fb61a71f4aa0404412d1bb5e6f94">BackUp</a>(size - count);</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00166"></a><span class="lineno"> 166</span>  }</div><div class="line"><a name="l00167"></a><span class="lineno"> 167</span>  <span class="comment">// size < count;</span></div><div class="line"><a name="l00168"></a><span class="lineno"> 168</span>  count -= size;</div><div class="line"><a name="l00169"></a><span class="lineno"> 169</span>  }</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <span class="comment">// error or we have too large count;</span></div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span>  }</div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span> </div><div class="line"><a name="l00174"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#acc660ae3172f370d7d2538f9fb9067b1"> 174</a></span>  <a class="code" href="namespacegrpc_1_1protobuf.html#ad614bff24fe4674ca81af74c769a7b32">grpc::protobuf::int64</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#acc660ae3172f370d7d2538f9fb9067b1">ByteCount</a>()<span class="keyword"> const override </span>{</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  <span class="keywordflow">return</span> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">byte_count_</a> - backup_count_;</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  }</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span> </div><div class="line"><a name="l00178"></a><span class="lineno"> 178</span>  <span class="keyword">protected</span>:</div><div class="line"><a name="l00179"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a0a6a65ef8eb5b5bb3d39a7b935ba78ab"> 179</a></span>  int64_t <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a0a6a65ef8eb5b5bb3d39a7b935ba78ab">byte_count_</a>;</div><div class="line"><a name="l00180"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a1ea14debdd9fb96f8f94e755aea5904c"> 180</a></span>  int64_t <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a1ea14debdd9fb96f8f94e755aea5904c">backup_count_</a>;</div><div class="line"><a name="l00181"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a52aae88ebfa452907a74625af1e2975e"> 181</a></span>  <a class="code" href="structgrpc__byte__buffer__reader.html">grpc_byte_buffer_reader</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a52aae88ebfa452907a74625af1e2975e">reader_</a>;</div><div class="line"><a name="l00182"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a74845b264add2937ff253114edb008cb"> 182</a></span>  <a class="code" href="structgrpc__slice.html">grpc_slice</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a74845b264add2937ff253114edb008cb">slice_</a>;</div><div class="line"><a name="l00183"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a85a798cb005abf72d2bc0a6a04e4bf92"> 183</a></span>  <a class="code" href="classgrpc_1_1_status.html">Status</a> <a class="code" href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a85a798cb005abf72d2bc0a6a04e4bf92">status_</a>;</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span> };</div><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> </div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span> <span class="comment">// BufferWriter must be a subclass of io::ZeroCopyOutputStream.</span></div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <span class="keyword">template</span> <<span class="keyword">class</span> BufferWriter, <span class="keyword">class</span> T></div><div class="line"><a name="l00188"></a><span class="lineno"><a class="line" href="namespacegrpc_1_1internal.html#a886108dc21aa277ba5dfc7d53328dde5"> 188</a></span> <a class="code" href="classgrpc_1_1_status.html">Status</a> <a class="code" href="namespacegrpc_1_1internal.html#a886108dc21aa277ba5dfc7d53328dde5">GenericSerialize</a>(<span class="keyword">const</span> <a class="code" href="namespacegrpc_1_1protobuf.html#a58557bfd4af54f1c54a6de69ab1fb43c">grpc::protobuf::Message</a>& msg,</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  <a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>** bp, <span class="keywordtype">bool</span>* own_buffer) {</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  static_assert(</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  std::is_base_of<protobuf::io::ZeroCopyOutputStream, BufferWriter>::value,</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  <span class="stringliteral">"BufferWriter must be a subclass of io::ZeroCopyOutputStream"</span>);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  *own_buffer = <span class="keyword">true</span>;</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keywordtype">int</span> byte_size = msg.ByteSize();</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keywordflow">if</span> ((<span class="keywordtype">size_t</span>)byte_size <= <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae65fc74cb3afbcd3299a1c93f90bae20">GRPC_SLICE_INLINED_SIZE</a>) {</div><div class="line"><a name="l00196"></a><span class="lineno"> 196</span>  <a class="code" href="structgrpc__slice.html">grpc_slice</a> slice = g_core_codegen_interface->grpc_slice_malloc(byte_size);</div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span>  <a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a>(</div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span>  <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a96535019e10a540192c1f276ec049a56">GRPC_SLICE_END_PTR</a>(slice) ==</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  msg.SerializeWithCachedSizesToArray(<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a8a15783c251cdeb18c3f8b0ad41d0352">GRPC_SLICE_START_PTR</a>(slice)));</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  *bp = g_core_codegen_interface->grpc_raw_byte_buffer_create(&slice, 1);</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  g_core_codegen_interface->grpc_slice_unref(slice);</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> </div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  <span class="keywordflow">return</span> g_core_codegen_interface->ok();</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  }</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  BufferWriter writer(bp, kGrpcBufferWriterMaxBufferLength, byte_size);</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">return</span> msg.SerializeToZeroCopyStream(&writer)</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  ? g_core_codegen_interface->ok()</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  : <a class="code" href="classgrpc_1_1_status.html">Status</a>(<a class="code" href="namespacegrpc.html#aff1730578c90160528f6a8d67ef5c43ba0ae30536146394965fd8ad64c2d414f3">StatusCode::INTERNAL</a>, <span class="stringliteral">"Failed to serialize message"</span>);</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span> }</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span> </div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span> <span class="comment">// BufferReader must be a subclass of io::ZeroCopyInputStream.</span></div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span> <span class="keyword">template</span> <<span class="keyword">class</span> BufferReader, <span class="keyword">class</span> T></div><div class="line"><a name="l00213"></a><span class="lineno"><a class="line" href="namespacegrpc_1_1internal.html#a75eadd3dfadd2d6b60dc9aa0e327e131"> 213</a></span> <a class="code" href="classgrpc_1_1_status.html">Status</a> <a class="code" href="namespacegrpc_1_1internal.html#a75eadd3dfadd2d6b60dc9aa0e327e131">GenericDeserialize</a>(<a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>* buffer,</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  <a class="code" href="namespacegrpc_1_1protobuf.html#a58557bfd4af54f1c54a6de69ab1fb43c">grpc::protobuf::Message</a>* msg) {</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  static_assert(</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  std::is_base_of<protobuf::io::ZeroCopyInputStream, BufferReader>::value,</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="stringliteral">"BufferReader must be a subclass of io::ZeroCopyInputStream"</span>);</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordflow">if</span> (buffer == <span class="keyword">nullptr</span>) {</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  <span class="keywordflow">return</span> <a class="code" href="classgrpc_1_1_status.html">Status</a>(<a class="code" href="namespacegrpc.html#aff1730578c90160528f6a8d67ef5c43ba0ae30536146394965fd8ad64c2d414f3">StatusCode::INTERNAL</a>, <span class="stringliteral">"No payload"</span>);</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  }</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <a class="code" href="classgrpc_1_1_status.html">Status</a> result = g_core_codegen_interface-><a class="code" href="classgrpc_1_1_status.html#ab80672b5665c32dc0937a0d58a3ce192">ok</a>();</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  {</div><div class="line"><a name="l00223"></a><span class="lineno"> 223</span>  BufferReader reader(buffer);</div><div class="line"><a name="l00224"></a><span class="lineno"> 224</span>  <span class="keywordflow">if</span> (!reader.status().ok()) {</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  <span class="keywordflow">return</span> reader.status();</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  }</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  <a class="code" href="namespacegrpc_1_1protobuf_1_1io.html#a8be5a5d13d5471daee11dd8203973bf3">::grpc::protobuf::io::CodedInputStream</a> decoder(&reader);</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  decoder.SetTotalBytesLimit(INT_MAX, INT_MAX);</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  <span class="keywordflow">if</span> (!msg->ParseFromCodedStream(&decoder)) {</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  result = <a class="code" href="classgrpc_1_1_status.html">Status</a>(<a class="code" href="namespacegrpc.html#aff1730578c90160528f6a8d67ef5c43ba0ae30536146394965fd8ad64c2d414f3">StatusCode::INTERNAL</a>, msg->InitializationErrorString());</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span>  }</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  <span class="keywordflow">if</span> (!decoder.ConsumedEntireMessage()) {</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span>  result = <a class="code" href="classgrpc_1_1_status.html">Status</a>(<a class="code" href="namespacegrpc.html#aff1730578c90160528f6a8d67ef5c43ba0ae30536146394965fd8ad64c2d414f3">StatusCode::INTERNAL</a>, <span class="stringliteral">"Did not read entire message"</span>);</div><div class="line"><a name="l00234"></a><span class="lineno"> 234</span>  }</div><div class="line"><a name="l00235"></a><span class="lineno"> 235</span>  }</div><div class="line"><a name="l00236"></a><span class="lineno"> 236</span>  g_core_codegen_interface->grpc_byte_buffer_destroy(buffer);</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> }</div><div class="line"><a name="l00239"></a><span class="lineno"> 239</span> </div><div class="line"><a name="l00240"></a><span class="lineno"> 240</span> } <span class="comment">// namespace internal</span></div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span> </div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span> <span class="comment">// this is needed so the following class does not conflict with protobuf</span></div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span> <span class="comment">// serializers that utilize internal-only tools.</span></div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span> <span class="preprocessor">#ifdef GRPC_OPEN_SOURCE_PROTO</span></div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span> <span class="comment">// This class provides a protobuf serializer. It translates between protobuf</span></div><div class="line"><a name="l00246"></a><span class="lineno"> 246</span> <span class="comment">// objects and grpc_byte_buffers. More information about SerializationTraits can</span></div><div class="line"><a name="l00247"></a><span class="lineno"> 247</span> <span class="comment">// be found in include/grpcpp/impl/codegen/serialization_traits.h.</span></div><div class="line"><a name="l00248"></a><span class="lineno"> 248</span> <span class="keyword">template</span> <<span class="keyword">class</span> T></div><div class="line"><a name="l00249"></a><span class="lineno"> 249</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1_serialization_traits.html">SerializationTraits</a><T, typename std::enable_if<std::is_base_of<</div><div class="line"><a name="l00250"></a><span class="lineno"> 250</span>  grpc::protobuf::Message, T>::value>::type> {</div><div class="line"><a name="l00251"></a><span class="lineno"> 251</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00252"></a><span class="lineno"> 252</span>  <span class="keyword">static</span> <a class="code" href="classgrpc_1_1_status.html">Status</a> Serialize(<span class="keyword">const</span> <a class="code" href="namespacegrpc_1_1protobuf.html#a58557bfd4af54f1c54a6de69ab1fb43c">grpc::protobuf::Message</a>& msg,</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>** bp, <span class="keywordtype">bool</span>* own_buffer) {</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordflow">return</span> internal::GenericSerialize<internal::GrpcBufferWriter, T>(</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  msg, bp, own_buffer);</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  }</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> </div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="keyword">static</span> <a class="code" href="classgrpc_1_1_status.html">Status</a> Deserialize(<a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>* buffer,</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <a class="code" href="namespacegrpc_1_1protobuf.html#a58557bfd4af54f1c54a6de69ab1fb43c">grpc::protobuf::Message</a>* msg) {</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span>  <span class="keywordflow">return</span> internal::GenericDeserialize<internal::GrpcBufferReader, T>(buffer,</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  msg);</div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  }</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span> };</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span> </div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span> } <span class="comment">// namespace grpc</span></div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span> </div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span> <span class="preprocessor">#endif // GRPCPP_IMPL_CODEGEN_PROTO_UTILS_H</span></div><div class="ttc" id="namespacegrpc_1_1internal_html_a75eadd3dfadd2d6b60dc9aa0e327e131"><div class="ttname"><a href="namespacegrpc_1_1internal.html#a75eadd3dfadd2d6b60dc9aa0e327e131">grpc::internal::GenericDeserialize</a></div><div class="ttdeci">Status GenericDeserialize(grpc_byte_buffer *buffer, grpc::protobuf::Message *msg)</div><div class="ttdef"><b>Definition:</b> proto_utils.h:213</div></div>
- <div class="ttc" id="grpc_2impl_2codegen_2slice_8h_html_a6791fa7be0a1a9144e005cfea7baea84"><div class="ttname"><a href="grpc_2impl_2codegen_2slice_8h.html#a6791fa7be0a1a9144e005cfea7baea84">GRPC_SLICE_SET_LENGTH</a></div><div class="ttdeci">#define GRPC_SLICE_SET_LENGTH(slice, newlen)</div><div class="ttdef"><b>Definition:</b> slice.h:122</div></div>
- <div class="ttc" id="grpcpp_2impl_2codegen_2config__protobuf_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2config__protobuf_8h.html">config_protobuf.h</a></div></div>
- <div class="ttc" id="grpcpp_2impl_2codegen_2core__codegen__interface_8h_html_a39c1421e7081b57c503487659e2653a5"><div class="ttname"><a href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a></div><div class="ttdeci">#define GPR_CODEGEN_ASSERT(x)</div><div class="ttdoc">Codegen specific version of GPR_ASSERT. </div><div class="ttdef"><b>Definition:</b> core_codegen_interface.h:133</div></div>
- <div class="ttc" id="impl_2codegen_2byte__buffer__reader_8h_html"><div class="ttname"><a href="impl_2codegen_2byte__buffer__reader_8h.html">byte_buffer_reader.h</a></div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html">grpc::internal::GrpcBufferReader</a></div><div class="ttdef"><b>Definition:</b> proto_utils.h:117</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a8a3b11e59164a65779749ab920c7ec30"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a8a3b11e59164a65779749ab920c7ec30">grpc::internal::GrpcBufferWriter::~GrpcBufferWriter</a></div><div class="ttdeci">~GrpcBufferWriter() override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:53</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a85a798cb005abf72d2bc0a6a04e4bf92"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a85a798cb005abf72d2bc0a6a04e4bf92">grpc::internal::GrpcBufferReader::status_</a></div><div class="ttdeci">Status status_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:183</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_af6c83780e775e99b9208302e76a820b1"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af6c83780e775e99b9208302e76a820b1">grpc::internal::GrpcBufferWriter::byte_count_</a></div><div class="ttdeci">int64_t byte_count_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:110</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_acc660ae3172f370d7d2538f9fb9067b1"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#acc660ae3172f370d7d2538f9fb9067b1">grpc::internal::GrpcBufferReader::ByteCount</a></div><div class="ttdeci">grpc::protobuf::int64 ByteCount() const override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:174</div></div>
- <div class="ttc" id="namespacegrpc_1_1internal_html_ae1df79d0af1deae726bf9f09b87e92a9"><div class="ttname"><a href="namespacegrpc_1_1internal.html#ae1df79d0af1deae726bf9f09b87e92a9">grpc::internal::kGrpcBufferWriterMaxBufferLength</a></div><div class="ttdeci">const int kGrpcBufferWriterMaxBufferLength</div><div class="ttdef"><b>Definition:</b> proto_utils.h:40</div></div>
- <div class="ttc" id="namespacegrpc_1_1internal_html_a886108dc21aa277ba5dfc7d53328dde5"><div class="ttname"><a href="namespacegrpc_1_1internal.html#a886108dc21aa277ba5dfc7d53328dde5">grpc::internal::GenericSerialize</a></div><div class="ttdeci">Status GenericSerialize(const grpc::protobuf::Message &msg, grpc_byte_buffer **bp, bool *own_buffer)</div><div class="ttdef"><b>Definition:</b> proto_utils.h:188</div></div>
- <div class="ttc" id="structgrpc__slice_html"><div class="ttname"><a href="structgrpc__slice.html">grpc_slice</a></div><div class="ttdoc">A grpc_slice s, if initialized, represents the byte range s.bytes[0..s.length-1]. ...</div><div class="ttdef"><b>Definition:</b> slice.h:80</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a5b8f11869c456df354a87dabfaec97f1"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a5b8f11869c456df354a87dabfaec97f1">grpc::internal::GrpcBufferReader::~GrpcBufferReader</a></div><div class="ttdeci">~GrpcBufferReader() override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:127</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a0a6a65ef8eb5b5bb3d39a7b935ba78ab"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a0a6a65ef8eb5b5bb3d39a7b935ba78ab">grpc::internal::GrpcBufferReader::byte_count_</a></div><div class="ttdeci">int64_t byte_count_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:179</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_ae66351a9aa970bdb225bbba45f279bb2"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#ae66351a9aa970bdb225bbba45f279bb2">grpc::internal::GrpcBufferReader::Next</a></div><div class="ttdeci">bool Next(const void **data, int *size) override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:131</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a86e7b15afcaeba3fdc3cfbf9292115f4"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a86e7b15afcaeba3fdc3cfbf9292115f4">grpc::internal::GrpcBufferWriter::total_size_</a></div><div class="ttdeci">const int total_size_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:109</div></div>
- <div class="ttc" id="grpc__types_8h_html"><div class="ttname"><a href="grpc__types_8h.html">grpc_types.h</a></div></div>
- <div class="ttc" id="structgrpc__byte__buffer_html"><div class="ttname"><a href="structgrpc__byte__buffer.html">grpc_byte_buffer</a></div><div class="ttdef"><b>Definition:</b> grpc_types.h:40</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a235799e9806853f0f32e5a078d9eddd0"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a235799e9806853f0f32e5a078d9eddd0">grpc::internal::GrpcBufferWriter::backup_slice_</a></div><div class="ttdeci">grpc_slice backup_slice_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:113</div></div>
- <div class="ttc" id="grpc_2impl_2codegen_2slice_8h_html_a8a15783c251cdeb18c3f8b0ad41d0352"><div class="ttname"><a href="grpc_2impl_2codegen_2slice_8h.html#a8a15783c251cdeb18c3f8b0ad41d0352">GRPC_SLICE_START_PTR</a></div><div class="ttdeci">#define GRPC_SLICE_START_PTR(slice)</div><div class="ttdef"><b>Definition:</b> slice.h:116</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a7aad5fe555993d8f86380e3b4c65db1c"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a7aad5fe555993d8f86380e3b4c65db1c">grpc::internal::GrpcBufferReader::Skip</a></div><div class="ttdeci">bool Skip(int count) override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:159</div></div>
- <div class="ttc" id="structgrpc__slice__buffer_html"><div class="ttname"><a href="structgrpc__slice__buffer.html">grpc_slice_buffer</a></div><div class="ttdoc">Represents an expandable array of slices, to be interpreted as a single item. </div><div class="ttdef"><b>Definition:</b> slice.h:98</div></div>
- <div class="ttc" id="grpc_2impl_2codegen_2slice_8h_html_a96535019e10a540192c1f276ec049a56"><div class="ttname"><a href="grpc_2impl_2codegen_2slice_8h.html#a96535019e10a540192c1f276ec049a56">GRPC_SLICE_END_PTR</a></div><div class="ttdeci">#define GRPC_SLICE_END_PTR(slice)</div><div class="ttdef"><b>Definition:</b> slice.h:125</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a724c133b537616eee22562b3e89885c8"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a724c133b537616eee22562b3e89885c8">grpc::internal::GrpcBufferReader::BackUp</a></div><div class="ttdeci">void BackUp(int count) override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:157</div></div>
- <div class="ttc" id="classgrpc_1_1_serialization_traits_html"><div class="ttname"><a href="classgrpc_1_1_serialization_traits.html">grpc::SerializationTraits</a></div><div class="ttdoc">Defines how to serialize and deserialize some type. </div><div class="ttdef"><b>Definition:</b> serialization_traits.h:58</div></div>
- <div class="ttc" id="grpc_2impl_2codegen_2slice_8h_html_ae65fc74cb3afbcd3299a1c93f90bae20"><div class="ttname"><a href="grpc_2impl_2codegen_2slice_8h.html#ae65fc74cb3afbcd3299a1c93f90bae20">GRPC_SLICE_INLINED_SIZE</a></div><div class="ttdeci">#define GRPC_SLICE_INLINED_SIZE</div><div class="ttdef"><b>Definition:</b> slice.h:68</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_ad5528cbf91654e1353a744076b343110"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#ad5528cbf91654e1353a744076b343110">grpc::internal::GrpcBufferWriter::GrpcBufferWriter</a></div><div class="ttdeci">GrpcBufferWriter(grpc_byte_buffer **bp, int block_size, int total_size)</div><div class="ttdef"><b>Definition:</b> proto_utils.h:44</div></div>
- <div class="ttc" id="namespacegrpc_1_1protobuf_1_1io_html_ae16bb38d6b730de308f0be4eb43931b4"><div class="ttname"><a href="namespacegrpc_1_1protobuf_1_1io.html#ae16bb38d6b730de308f0be4eb43931b4">grpc::protobuf::io::ZeroCopyInputStream</a></div><div class="ttdeci">::google::protobuf::io::ZeroCopyInputStream ZeroCopyInputStream</div><div class="ttdef"><b>Definition:</b> config_protobuf.h:88</div></div>
- <div class="ttc" id="structgrpc__slice_html_a467ef319d024f1897c7ff3bdadb78493"><div class="ttname"><a href="structgrpc__slice.html#a467ef319d024f1897c7ff3bdadb78493">grpc_slice::refcount</a></div><div class="ttdeci">struct grpc_slice_refcount * refcount</div><div class="ttdef"><b>Definition:</b> slice.h:81</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a4890fb61a71f4aa0404412d1bb5e6f94"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a4890fb61a71f4aa0404412d1bb5e6f94">grpc::internal::GrpcBufferWriter::BackUp</a></div><div class="ttdeci">void BackUp(int count) override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:87</div></div>
- <div class="ttc" id="namespacegrpc_html"><div class="ttname"><a href="namespacegrpc.html">grpc</a></div><div class="ttdoc">An Alarm posts the user provided tag to its associated completion queue upon expiry or cancellation...</div><div class="ttdef"><b>Definition:</b> alarm.h:31</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a74845b264add2937ff253114edb008cb"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a74845b264add2937ff253114edb008cb">grpc::internal::GrpcBufferReader::slice_</a></div><div class="ttdeci">grpc_slice slice_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:182</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_aba847098b0e3f0f72abed7e66be4b04a"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#aba847098b0e3f0f72abed7e66be4b04a">grpc::internal::GrpcBufferWriter::block_size_</a></div><div class="ttdeci">const int block_size_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:108</div></div>
- <div class="ttc" id="namespacegrpc_html_abbcecc18dae64c65df0b6d9aa8bf67a8"><div class="ttname"><a href="namespacegrpc.html#abbcecc18dae64c65df0b6d9aa8bf67a8">grpc::g_core_codegen_interface</a></div><div class="ttdeci">CoreCodegenInterface * g_core_codegen_interface</div><div class="ttdef"><b>Definition:</b> call.h:46</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html">grpc::internal::GrpcBufferWriter</a></div><div class="ttdef"><b>Definition:</b> proto_utils.h:42</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a349050d8575a87cfd0979866f23f9649"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a349050d8575a87cfd0979866f23f9649">grpc::internal::GrpcBufferWriter::have_backup_</a></div><div class="ttdeci">bool have_backup_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:112</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_ad7d78d8afffe2e98007bd63036c19c42"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#ad7d78d8afffe2e98007bd63036c19c42">grpc::internal::GrpcBufferWriter::GrpcBufferWriterPeer</a></div><div class="ttdeci">friend class GrpcBufferWriterPeer</div><div class="ttdef"><b>Definition:</b> proto_utils.h:107</div></div>
- <div class="ttc" id="namespacegrpc_1_1protobuf_html_ad614bff24fe4674ca81af74c769a7b32"><div class="ttname"><a href="namespacegrpc_1_1protobuf.html#ad614bff24fe4674ca81af74c769a7b32">grpc::protobuf::int64</a></div><div class="ttdeci">::google::protobuf::int64 int64</div><div class="ttdef"><b>Definition:</b> config_protobuf.h:73</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a0d82c79ed1450a74b67448e6e1a32976"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a0d82c79ed1450a74b67448e6e1a32976">grpc::internal::GrpcBufferWriter::slice_</a></div><div class="ttdeci">grpc_slice slice_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:114</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a34cf482f798ff91efce00096851f787b"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a34cf482f798ff91efce00096851f787b">grpc::internal::GrpcBufferReader::status</a></div><div class="ttdeci">Status status() const</div><div class="ttdef"><b>Definition:</b> proto_utils.h:155</div></div>
- <div class="ttc" id="classgrpc_1_1_status_html_ab80672b5665c32dc0937a0d58a3ce192"><div class="ttname"><a href="classgrpc_1_1_status.html#ab80672b5665c32dc0937a0d58a3ce192">grpc::Status::ok</a></div><div class="ttdeci">bool ok() const</div><div class="ttdoc">Is the status OK? </div><div class="ttdef"><b>Definition:</b> status.h:118</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_af7b145efa2ac6b4a3a72a331af9d6466"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#af7b145efa2ac6b4a3a72a331af9d6466">grpc::internal::GrpcBufferWriter::ByteCount</a></div><div class="ttdeci">grpc::protobuf::int64 ByteCount() const override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:104</div></div>
- <div class="ttc" id="grpcpp_2impl_2codegen_2core__codegen__interface_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html">core_codegen_interface.h</a></div></div>
- <div class="ttc" id="grpcpp_2impl_2codegen_2status_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2status_8h.html">status.h</a></div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a6bb63037ac69748f83758bafdf150663"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a6bb63037ac69748f83758bafdf150663">grpc::internal::GrpcBufferWriter::Next</a></div><div class="ttdeci">bool Next(void **data, int *size) override</div><div class="ttdef"><b>Definition:</b> proto_utils.h:59</div></div>
- <div class="ttc" id="grpcpp_2impl_2codegen_2serialization__traits_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2serialization__traits_8h.html">serialization_traits.h</a></div></div>
- <div class="ttc" id="classgrpc_1_1_status_html"><div class="ttname"><a href="classgrpc_1_1_status.html">grpc::Status</a></div><div class="ttdoc">Did it work? If it didn&#39;t, why? </div><div class="ttdef"><b>Definition:</b> status.h:31</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_writer_html_a5fd914fec40a3dd722c9e53a94b214a0"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_writer.html#a5fd914fec40a3dd722c9e53a94b214a0">grpc::internal::GrpcBufferWriter::slice_buffer_</a></div><div class="ttdeci">grpc_slice_buffer * slice_buffer_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:111</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a1ea14debdd9fb96f8f94e755aea5904c"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a1ea14debdd9fb96f8f94e755aea5904c">grpc::internal::GrpcBufferReader::backup_count_</a></div><div class="ttdeci">int64_t backup_count_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:180</div></div>
- <div class="ttc" id="namespacegrpc_1_1protobuf_1_1io_html_aafcf83341d287d00418952374bc82ce1"><div class="ttname"><a href="namespacegrpc_1_1protobuf_1_1io.html#aafcf83341d287d00418952374bc82ce1">grpc::protobuf::io::ZeroCopyOutputStream</a></div><div class="ttdeci">::google::protobuf::io::ZeroCopyOutputStream ZeroCopyOutputStream</div><div class="ttdef"><b>Definition:</b> config_protobuf.h:87</div></div>
- <div class="ttc" id="grpc_2impl_2codegen_2slice_8h_html_ae965fb2ee1a646253cdbd49d82b0b6c5"><div class="ttname"><a href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a></div><div class="ttdeci">#define GRPC_SLICE_LENGTH(slice)</div><div class="ttdef"><b>Definition:</b> slice.h:119</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a17568350c9ee6a89e0a901cfff8401f6"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a17568350c9ee6a89e0a901cfff8401f6">grpc::internal::GrpcBufferReader::GrpcBufferReader</a></div><div class="ttdeci">GrpcBufferReader(grpc_byte_buffer *buffer)</div><div class="ttdef"><b>Definition:</b> proto_utils.h:119</div></div>
- <div class="ttc" id="structgrpc__byte__buffer__reader_html"><div class="ttname"><a href="structgrpc__byte__buffer__reader.html">grpc_byte_buffer_reader</a></div><div class="ttdef"><b>Definition:</b> byte_buffer_reader.h:28</div></div>
- <div class="ttc" id="namespacegrpc_html_aff1730578c90160528f6a8d67ef5c43ba0ae30536146394965fd8ad64c2d414f3"><div class="ttname"><a href="namespacegrpc.html#aff1730578c90160528f6a8d67ef5c43ba0ae30536146394965fd8ad64c2d414f3">grpc::INTERNAL</a></div><div class="ttdoc">Internal errors. </div><div class="ttdef"><b>Definition:</b> status_code_enum.h:119</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_grpc_buffer_reader_html_a52aae88ebfa452907a74625af1e2975e"><div class="ttname"><a href="classgrpc_1_1internal_1_1_grpc_buffer_reader.html#a52aae88ebfa452907a74625af1e2975e">grpc::internal::GrpcBufferReader::reader_</a></div><div class="ttdeci">grpc_byte_buffer_reader reader_</div><div class="ttdef"><b>Definition:</b> proto_utils.h:181</div></div>
- <div class="ttc" id="grpc_2impl_2codegen_2slice_8h_html"><div class="ttname"><a href="grpc_2impl_2codegen_2slice_8h.html">slice.h</a></div></div>
- <div class="ttc" id="namespacegrpc_1_1protobuf_html_a58557bfd4af54f1c54a6de69ab1fb43c"><div class="ttname"><a href="namespacegrpc_1_1protobuf.html#a58557bfd4af54f1c54a6de69ab1fb43c">grpc::protobuf::Message</a></div><div class="ttdeci">::google::protobuf::Message Message</div><div class="ttdef"><b>Definition:</b> config_protobuf.h:72</div></div>
- <div class="ttc" id="namespacegrpc_1_1protobuf_1_1io_html_a8be5a5d13d5471daee11dd8203973bf3"><div class="ttname"><a href="namespacegrpc_1_1protobuf_1_1io.html#a8be5a5d13d5471daee11dd8203973bf3">grpc::protobuf::io::CodedInputStream</a></div><div class="ttdeci">::google::protobuf::io::CodedInputStream CodedInputStream</div><div class="ttdef"><b>Definition:</b> config_protobuf.h:89</div></div>
- </div><!-- fragment --></div><!-- contents -->
- <!-- start footer part -->
- <hr class="footer"/><address class="footer"><small>
- Generated on Fri Apr 13 2018 15:03:52 for GRPC C++ by  <a href="http://www.doxygen.org/index.html">
- <img class="footer" src="doxygen.png" alt="doxygen"/>
- </a> 1.8.13
- </small></address>
- </body>
- </html>
|