impl_2codegen_2proto__buffer__reader_8h_source.html 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
  5. <meta http-equiv="X-UA-Compatible" content="IE=9"/>
  6. <meta name="generator" content="Doxygen 1.8.13"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>GRPC C++: include/grpcpp/impl/codegen/proto_buffer_reader.h Source File</title>
  9. <link href="tabs.css" rel="stylesheet" type="text/css"/>
  10. <script type="text/javascript" src="jquery.js"></script>
  11. <script type="text/javascript" src="dynsections.js"></script>
  12. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="search/searchdata.js"></script>
  14. <script type="text/javascript" src="search/search.js"></script>
  15. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  16. <script type="text/javascript"> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-60127042-1', 'auto'); ga('send', 'pageview'); </script></head>
  17. <body>
  18. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  19. <div id="titlearea">
  20. <table cellspacing="0" cellpadding="0">
  21. <tbody>
  22. <tr style="height: 56px;">
  23. <td id="projectalign" style="padding-left: 0.5em;">
  24. <div id="projectname">GRPC C++
  25. &#160;<span id="projectnumber">1.13.0-dev</span>
  26. </div>
  27. </td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. <!-- end header part -->
  33. <!-- Generated by Doxygen 1.8.13 -->
  34. <script type="text/javascript">
  35. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  36. </script>
  37. <script type="text/javascript" src="menudata.js"></script>
  38. <script type="text/javascript" src="menu.js"></script>
  39. <script type="text/javascript">
  40. $(function() {
  41. initMenu('',true,false,'search.php','Search');
  42. $(document).ready(function() { init_search(); });
  43. });
  44. </script>
  45. <div id="main-nav"></div>
  46. <!-- window showing the filter options -->
  47. <div id="MSearchSelectWindow"
  48. onmouseover="return searchBox.OnSearchSelectShow()"
  49. onmouseout="return searchBox.OnSearchSelectHide()"
  50. onkeydown="return searchBox.OnSearchSelectKey(event)">
  51. </div>
  52. <!-- iframe showing the search results (closed by default) -->
  53. <div id="MSearchResultsWindow">
  54. <iframe src="javascript:void(0)" frameborder="0"
  55. name="MSearchResults" id="MSearchResults">
  56. </iframe>
  57. </div>
  58. <div id="nav-path" class="navpath">
  59. <ul>
  60. <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>
  61. </div>
  62. </div><!-- top -->
  63. <div class="header">
  64. <div class="headertitle">
  65. <div class="title">proto_buffer_reader.h</div> </div>
  66. </div><!--header-->
  67. <div class="contents">
  68. <a href="impl_2codegen_2proto__buffer__reader_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>&#160;<span class="comment">/*</span></div><div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * Copyright 2015 gRPC authors.</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span>&#160;<span class="comment"> * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span>&#160;<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>&#160;<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>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span>&#160;<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>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span>&#160;<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>&#160;<span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span>&#160;<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>&#160;<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>&#160;<span class="comment"> * limitations under the License.</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> *</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160;</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;type_traits&gt;</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160;</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="impl_2codegen_2byte__buffer__reader_8h.html">grpc/impl/codegen/byte_buffer_reader.h</a>&gt;</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpc__types_8h.html">grpc/impl/codegen/grpc_types.h</a>&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpc_2impl_2codegen_2slice_8h.html">grpc/impl/codegen/slice.h</a>&gt;</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpcpp_2impl_2codegen_2byte__buffer_8h.html">grpcpp/impl/codegen/byte_buffer.h</a>&gt;</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpcpp_2impl_2codegen_2config__protobuf_8h.html">grpcpp/impl/codegen/config_protobuf.h</a>&gt;</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html">grpcpp/impl/codegen/core_codegen_interface.h</a>&gt;</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpcpp_2impl_2codegen_2serialization__traits_8h.html">grpcpp/impl/codegen/serialization_traits.h</a>&gt;</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpcpp_2impl_2codegen_2status_8h.html">grpcpp/impl/codegen/status.h</a>&gt;</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>&#160;</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>&#160;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacegrpc.html">grpc</a> {</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160;<span class="keyword">extern</span> CoreCodegenInterface* <a class="code" href="namespacegrpc.html#abbcecc18dae64c65df0b6d9aa8bf67a8">g_core_codegen_interface</a>;</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>&#160;</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html"> 46</a></span>&#160;<span class="keyword">class </span><a class="code" href="classgrpc_1_1_proto_buffer_reader.html">ProtoBufferReader</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="l00047"></a><span class="lineno"> 47</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#aa00588464b3586ea57b8d4f20b526934"> 50</a></span>&#160; <span class="keyword">explicit</span> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#aa00588464b3586ea57b8d4f20b526934">ProtoBufferReader</a>(<a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>* buffer)</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; : byte_count_(0), backup_count_(0), status_() {</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordflow">if</span> (!buffer-&gt;<a class="code" href="classgrpc_1_1_byte_buffer.html#aea6bcd0d3c70fc14158df68c59dc82d4">Valid</a>() ||</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; !g_core_codegen_interface-&gt;grpc_byte_buffer_reader_init(</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; &amp;reader_, buffer-&gt;c_buffer())) {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; 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="l00058"></a><span class="lineno"> 58</span>&#160; <span class="stringliteral">&quot;Couldn&#39;t initialize byte buffer reader&quot;</span>);</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; }</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; }</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160;</div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a919f28b7d6be0d6a2fb0f178a0cdf573"> 62</a></span>&#160; <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a919f28b7d6be0d6a2fb0f178a0cdf573">~ProtoBufferReader</a>() {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; <span class="keywordflow">if</span> (status_.<a class="code" href="classgrpc_1_1_status.html#ab80672b5665c32dc0937a0d58a3ce192">ok</a>()) {</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; g_core_codegen_interface-&gt;grpc_byte_buffer_reader_destroy(&amp;reader_);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; }</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; }</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160;</div><div class="line"><a name="l00070"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a5535d30e741c8a081a0fec40620b37e8"> 70</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a5535d30e741c8a081a0fec40620b37e8">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="l00071"></a><span class="lineno"> 71</span>&#160; <span class="keywordflow">if</span> (!status_.<a class="code" href="classgrpc_1_1_status.html#ab80672b5665c32dc0937a0d58a3ce192">ok</a>()) {</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; }</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">if</span> (backup_count_ &gt; 0) {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; *data = <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a8a15783c251cdeb18c3f8b0ad41d0352">GRPC_SLICE_START_PTR</a>(slice_) + <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(slice_) -</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; backup_count_;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; <a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a>(backup_count_ &lt;= INT_MAX);</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160; *size = (int)backup_count_;</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160; backup_count_ = 0;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160; <span class="keywordflow">if</span> (!g_core_codegen_interface-&gt;grpc_byte_buffer_reader_next(&amp;reader_,</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; &amp;slice_)) {</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; }</div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; g_core_codegen_interface-&gt;grpc_slice_unref(slice_);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160; *data = <a class="code" href="grpc_2impl_2codegen_2slice_8h.html#a8a15783c251cdeb18c3f8b0ad41d0352">GRPC_SLICE_START_PTR</a>(slice_);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160; <span class="comment">// On win x64, int is only 32bit</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160; <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>(slice_) &lt;= INT_MAX);</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160; byte_count_ += * size = (int)<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(slice_);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>&#160; }</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span>&#160;</div><div class="line"><a name="l00097"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a50b5c353ac2d915b09e68bf9c1f7136e"> 97</a></span>&#160; <a class="code" href="classgrpc_1_1_status.html">Status</a> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a50b5c353ac2d915b09e68bf9c1f7136e">status</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> status_; }</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>&#160;</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#adb77905f9cecd961c6066dc78d93a60c"> 102</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#adb77905f9cecd961c6066dc78d93a60c">BackUp</a>(<span class="keywordtype">int</span> count)<span class="keyword"> override </span>{</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>&#160; <a class="code" href="grpcpp_2impl_2codegen_2core__codegen__interface_8h.html#a39c1421e7081b57c503487659e2653a5">GPR_CODEGEN_ASSERT</a>(count &lt;= static_cast&lt;int&gt;(<a class="code" href="grpc_2impl_2codegen_2slice_8h.html#ae965fb2ee1a646253cdbd49d82b0b6c5">GRPC_SLICE_LENGTH</a>(slice_)));</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>&#160; backup_count_ = count;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>&#160; }</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>&#160;</div><div class="line"><a name="l00109"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a6f9fdfde9953f08b5ca247e6e1b2f02b"> 109</a></span>&#160; <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a6f9fdfde9953f08b5ca247e6e1b2f02b">Skip</a>(<span class="keywordtype">int</span> count)<span class="keyword"> override </span>{</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>&#160; <span class="keyword">const</span> <span class="keywordtype">void</span>* data;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>&#160; <span class="keywordtype">int</span> size;</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>&#160; <span class="keywordflow">while</span> (<a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a5535d30e741c8a081a0fec40620b37e8">Next</a>(&amp;data, &amp;size)) {</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>&#160; <span class="keywordflow">if</span> (size &gt;= count) {</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>&#160; <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#adb77905f9cecd961c6066dc78d93a60c">BackUp</a>(size - count);</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span>&#160; <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>&#160; }</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>&#160; <span class="comment">// size &lt; count;</span></div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>&#160; count -= size;</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>&#160; }</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>&#160; <span class="comment">// error or we have too large count;</span></div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>&#160; <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>&#160; }</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>&#160;</div><div class="line"><a name="l00125"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a6998c79bf27db27ab0fe35ab1be5c972"> 125</a></span>&#160; <a class="code" href="namespacegrpc_1_1protobuf.html#ad614bff24fe4674ca81af74c769a7b32">grpc::protobuf::int64</a> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a6998c79bf27db27ab0fe35ab1be5c972">ByteCount</a>()<span class="keyword"> const override </span>{</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>&#160; <span class="keywordflow">return</span> byte_count_ - backup_count_;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>&#160; }</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>&#160;</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>&#160; <span class="comment">// These protected members are needed to support internal optimizations.</span></div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>&#160; <span class="comment">// they expose internal bits of grpc core that are NOT stable. If you have</span></div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>&#160; <span class="comment">// a use case needs to use one of these functions, please send an email to</span></div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>&#160; <span class="comment">// https://groups.google.com/forum/#!forum/grpc-io.</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>&#160; <span class="keyword">protected</span>:</div><div class="line"><a name="l00134"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a9fa8b889f80d4bf56f6915ad9245ac3b"> 134</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a9fa8b889f80d4bf56f6915ad9245ac3b">set_byte_count</a>(int64_t byte_count) { byte_count_ = byte_count; }</div><div class="line"><a name="l00135"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#ac9dad34d4b14195b85d5cd019ba5d7d1"> 135</a></span>&#160; int64_t <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#ac9dad34d4b14195b85d5cd019ba5d7d1">backup_count</a>() { <span class="keywordflow">return</span> backup_count_; }</div><div class="line"><a name="l00136"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a56f59bca6804e19d0f780c80ccbca031"> 136</a></span>&#160; <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a56f59bca6804e19d0f780c80ccbca031">set_backup_count</a>(int64_t <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#ac9dad34d4b14195b85d5cd019ba5d7d1">backup_count</a>) { backup_count_ = <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#ac9dad34d4b14195b85d5cd019ba5d7d1">backup_count</a>; }</div><div class="line"><a name="l00137"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#aa50ef34b08b9cb338dc26db6be108748"> 137</a></span>&#160; <a class="code" href="structgrpc__byte__buffer__reader.html">grpc_byte_buffer_reader</a>* <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#aa50ef34b08b9cb338dc26db6be108748">reader</a>() { <span class="keywordflow">return</span> &amp;reader_; }</div><div class="line"><a name="l00138"></a><span class="lineno"><a class="line" href="classgrpc_1_1_proto_buffer_reader.html#a0874823748781629e0b2bde470d78bf3"> 138</a></span>&#160; <a class="code" href="structgrpc__slice.html">grpc_slice</a>* <a class="code" href="classgrpc_1_1_proto_buffer_reader.html#a0874823748781629e0b2bde470d78bf3">slice</a>() { <span class="keywordflow">return</span> &amp;slice_; }</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>&#160;</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>&#160; int64_t byte_count_; </div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>&#160; int64_t backup_count_; </div><div class="line"><a name="l00143"></a><span class="lineno"> 143</span>&#160; <a class="code" href="structgrpc__byte__buffer__reader.html">grpc_byte_buffer_reader</a> reader_; </div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>&#160; <a class="code" href="structgrpc__slice.html">grpc_slice</a> slice_; </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>&#160; <a class="code" href="classgrpc_1_1_status.html">Status</a> status_; </div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>&#160;};</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>&#160;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>&#160;} <span class="comment">// namespace grpc</span></div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>&#160;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>&#160;<span class="preprocessor">#endif // GRPCPP_IMPL_CODEGEN_PROTO_BUFFER_READER_H</span></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>
  69. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_aa50ef34b08b9cb338dc26db6be108748"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#aa50ef34b08b9cb338dc26db6be108748">grpc::ProtoBufferReader::reader</a></div><div class="ttdeci">grpc_byte_buffer_reader * reader()</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:137</div></div>
  70. <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:138</div></div>
  71. <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>
  72. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_adb77905f9cecd961c6066dc78d93a60c"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#adb77905f9cecd961c6066dc78d93a60c">grpc::ProtoBufferReader::BackUp</a></div><div class="ttdeci">void BackUp(int count) override</div><div class="ttdoc">The proto library calls this to indicate that we should back up count bytes that have already been re...</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:102</div></div>
  73. <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>
  74. <div class="ttc" id="grpc__types_8h_html"><div class="ttname"><a href="grpc__types_8h.html">grpc_types.h</a></div></div>
  75. <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>
  76. <div class="ttc" id="classgrpc_1_1_byte_buffer_html_aea6bcd0d3c70fc14158df68c59dc82d4"><div class="ttname"><a href="classgrpc_1_1_byte_buffer.html#aea6bcd0d3c70fc14158df68c59dc82d4">grpc::ByteBuffer::Valid</a></div><div class="ttdeci">bool Valid() const</div><div class="ttdoc">Is this ByteBuffer valid? </div><div class="ttdef"><b>Definition:</b> byte_buffer.h:133</div></div>
  77. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a50b5c353ac2d915b09e68bf9c1f7136e"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a50b5c353ac2d915b09e68bf9c1f7136e">grpc::ProtoBufferReader::status</a></div><div class="ttdeci">Status status() const</div><div class="ttdoc">Returns the status of the buffer reader. </div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:97</div></div>
  78. <div class="ttc" id="grpcpp_2impl_2codegen_2byte__buffer_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2byte__buffer_8h.html">byte_buffer.h</a></div></div>
  79. <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>
  80. <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>
  81. <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>
  82. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a5535d30e741c8a081a0fec40620b37e8"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a5535d30e741c8a081a0fec40620b37e8">grpc::ProtoBufferReader::Next</a></div><div class="ttdeci">bool Next(const void **data, int *size) override</div><div class="ttdoc">Give the proto library a chunk of data from the stream. </div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:70</div></div>
  83. <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>
  84. <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>
  85. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_aa00588464b3586ea57b8d4f20b526934"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#aa00588464b3586ea57b8d4f20b526934">grpc::ProtoBufferReader::ProtoBufferReader</a></div><div class="ttdeci">ProtoBufferReader(ByteBuffer *buffer)</div><div class="ttdoc">Constructs buffer reader from buffer. </div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:50</div></div>
  86. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a56f59bca6804e19d0f780c80ccbca031"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a56f59bca6804e19d0f780c80ccbca031">grpc::ProtoBufferReader::set_backup_count</a></div><div class="ttdeci">void set_backup_count(int64_t backup_count)</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:136</div></div>
  87. <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>
  88. <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>
  89. <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>
  90. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a0874823748781629e0b2bde470d78bf3"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a0874823748781629e0b2bde470d78bf3">grpc::ProtoBufferReader::slice</a></div><div class="ttdeci">grpc_slice * slice()</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:138</div></div>
  91. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a6998c79bf27db27ab0fe35ab1be5c972"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a6998c79bf27db27ab0fe35ab1be5c972">grpc::ProtoBufferReader::ByteCount</a></div><div class="ttdeci">grpc::protobuf::int64 ByteCount() const override</div><div class="ttdoc">Returns the total number of bytes read since this object was created. </div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:125</div></div>
  92. <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&amp;#39;t, why? </div><div class="ttdef"><b>Definition:</b> status.h:31</div></div>
  93. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a9fa8b889f80d4bf56f6915ad9245ac3b"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a9fa8b889f80d4bf56f6915ad9245ac3b">grpc::ProtoBufferReader::set_byte_count</a></div><div class="ttdeci">void set_byte_count(int64_t byte_count)</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:134</div></div>
  94. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_ac9dad34d4b14195b85d5cd019ba5d7d1"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#ac9dad34d4b14195b85d5cd019ba5d7d1">grpc::ProtoBufferReader::backup_count</a></div><div class="ttdeci">int64_t backup_count()</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:135</div></div>
  95. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html">grpc::ProtoBufferReader</a></div><div class="ttdoc">This is a specialization of the protobuf class ZeroCopyInputStream The principle is to get one chunk ...</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:46</div></div>
  96. <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>
  97. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a6f9fdfde9953f08b5ca247e6e1b2f02b"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a6f9fdfde9953f08b5ca247e6e1b2f02b">grpc::ProtoBufferReader::Skip</a></div><div class="ttdeci">bool Skip(int count) override</div><div class="ttdoc">The proto library calls this to skip over count bytes. </div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:109</div></div>
  98. <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>
  99. <div class="ttc" id="classgrpc_1_1_proto_buffer_reader_html_a919f28b7d6be0d6a2fb0f178a0cdf573"><div class="ttname"><a href="classgrpc_1_1_proto_buffer_reader.html#a919f28b7d6be0d6a2fb0f178a0cdf573">grpc::ProtoBufferReader::~ProtoBufferReader</a></div><div class="ttdeci">~ProtoBufferReader()</div><div class="ttdef"><b>Definition:</b> proto_buffer_reader.h:62</div></div>
  100. <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>
  101. <div class="ttc" id="classgrpc_1_1_byte_buffer_html"><div class="ttname"><a href="classgrpc_1_1_byte_buffer.html">grpc::ByteBuffer</a></div><div class="ttdoc">A sequence of bytes. </div><div class="ttdef"><b>Definition:</b> byte_buffer.h:53</div></div>
  102. <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>
  103. </div><!-- fragment --></div><!-- contents -->
  104. <!-- start footer part -->
  105. <hr class="footer"/><address class="footer"><small>
  106. Generated on Tue May 15 2018 17:01:01 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
  107. <img class="footer" src="doxygen.png" alt="doxygen"/>
  108. </a> 1.8.13
  109. </small></address>
  110. </body>
  111. </html>