| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110 |
- <!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/byte_buffer.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">byte_buffer.h</div> </div>
- </div><!--header-->
- <div class="contents">
- <a href="grpcpp_2impl_2codegen_2byte__buffer_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 2017 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_BYTE_BUFFER_H</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#define GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_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 <<a class="code" href="grpc_2impl_2codegen_2byte__buffer_8h.html">grpc/impl/codegen/byte_buffer.h</a>></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="grpcpp_2impl_2codegen_2config_8h.html">grpcpp/impl/codegen/config.h</a>></span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</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="l00026"></a><span class="lineno"> 26</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="l00027"></a><span class="lineno"> 27</span> <span class="preprocessor">#include <<a class="code" href="grpcpp_2impl_2codegen_2slice_8h.html">grpcpp/impl/codegen/slice.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_2status_8h.html">grpcpp/impl/codegen/status.h</a>></span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#include <vector></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">class </span>ServerInterface;</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> <span class="keyword">class </span>CallOpSendMessage;</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="keyword">template</span> <<span class="keyword">class</span> R></div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_call_op_recv_message.html"> 39</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_call_op_recv_message.html">CallOpRecvMessage</a>;</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_call_op_generic_recv_message.html">CallOpGenericRecvMessage</a>;</div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_method_handler.html">MethodHandler</a>;</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="keyword">template</span> <<span class="keyword">class</span> ServiceType, <span class="keyword">class</span> RequestType, <span class="keyword">class</span> ResponseType></div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_rpc_method_handler.html"> 43</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_rpc_method_handler.html">RpcMethodHandler</a>;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="keyword">template</span> <<span class="keyword">class</span> ServiceType, <span class="keyword">class</span> RequestType, <span class="keyword">class</span> ResponseType></div><div class="line"><a name="l00045"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_server_streaming_handler.html"> 45</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_server_streaming_handler.html">ServerStreamingHandler</a>;</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="keyword">template</span> <<span class="keyword">class</span> R></div><div class="line"><a name="l00047"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_deserialize_func_type.html"> 47</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_deserialize_func_type.html">DeserializeFuncType</a>;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> } <span class="comment">// namespace internal</span></div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html"> 50</a></span> <span class="comment"></span><span class="keyword">class </span><a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a> final {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#aa3037355cbd37dce99c97e5c3700a76b"> 53</a></span>  <a class="code" href="classgrpc_1_1_byte_buffer.html#aa3037355cbd37dce99c97e5c3700a76b">ByteBuffer</a>() : buffer_(nullptr) {}</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>(<span class="keyword">const</span> <a class="code" href="classgrpc_1_1_slice.html">Slice</a>* slices, <span class="keywordtype">size_t</span> nslices);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span> </div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>(<span class="keyword">const</span> <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>& buf);</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> </div><div class="line"><a name="l00062"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#aeb5dd0045ed262de06481465326bd64a"> 62</a></span>  <a class="code" href="classgrpc_1_1_byte_buffer.html#aeb5dd0045ed262de06481465326bd64a">~ByteBuffer</a>() {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordflow">if</span> (buffer_) {</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <a class="code" href="namespacegrpc.html#abbcecc18dae64c65df0b6d9aa8bf67a8">g_core_codegen_interface</a>-><a class="code" href="classgrpc_1_1_core_codegen_interface.html#aad8bd2e910b838c91bc5aba03d2dc153">grpc_byte_buffer_destroy</a>(buffer_);</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  }</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  }</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> </div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>& operator=(<span class="keyword">const</span> <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>&);</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> </div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span>  <a class="code" href="classgrpc_1_1_status.html">Status</a> Dump(std::vector<Slice>* slices) <span class="keyword">const</span>;</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> </div><div class="line"><a name="l00074"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a185b593e5c7d2b888fa377989a6bae80"> 74</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1_byte_buffer.html#a185b593e5c7d2b888fa377989a6bae80">Clear</a>() {</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  <span class="keywordflow">if</span> (buffer_) {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  <a class="code" href="namespacegrpc.html#abbcecc18dae64c65df0b6d9aa8bf67a8">g_core_codegen_interface</a>-><a class="code" href="classgrpc_1_1_core_codegen_interface.html#aad8bd2e910b838c91bc5aba03d2dc153">grpc_byte_buffer_destroy</a>(buffer_);</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  buffer_ = <span class="keyword">nullptr</span>;</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>  }</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> </div><div class="line"><a name="l00084"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a42889c8018ea3868db2f54d92d1609ab"> 84</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1_byte_buffer.html#a42889c8018ea3868db2f54d92d1609ab">Duplicate</a>() {</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  buffer_ = <a class="code" href="namespacegrpc.html#abbcecc18dae64c65df0b6d9aa8bf67a8">g_core_codegen_interface</a>-><a class="code" href="classgrpc_1_1_core_codegen_interface.html#a27c53b8e68493908593016bf8951f4a0">grpc_byte_buffer_copy</a>(buffer_);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  }</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#ae03627c8b3297965fa0cdd4f03a9af0f"> 90</a></span>  <span class="keywordtype">void</span> <a class="code" href="classgrpc_1_1_byte_buffer.html#ae03627c8b3297965fa0cdd4f03a9af0f">Release</a>() { buffer_ = <span class="keyword">nullptr</span>; }</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  <span class="keywordtype">size_t</span> Length() <span class="keyword">const</span>;</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <span class="keywordtype">void</span> Swap(<a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>* other);</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span> </div><div class="line"><a name="l00099"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#aea6bcd0d3c70fc14158df68c59dc82d4"> 99</a></span>  <span class="keywordtype">bool</span> <a class="code" href="classgrpc_1_1_byte_buffer.html#aea6bcd0d3c70fc14158df68c59dc82d4">Valid</a>()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> (buffer_ != <span class="keyword">nullptr</span>); }</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span> </div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00102"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#ab90fe50537dd6fe009b7b913652420f0"> 102</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1_serialization_traits.html">SerializationTraits</a><<a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>, void>;</div><div class="line"><a name="l00103"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#ad0907065db479dc47b2fa752d7782b6f"> 103</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1_server_interface.html">ServerInterface</a>;</div><div class="line"><a name="l00104"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#ad7fe1828bc120efad35f57929870dc5b"> 104</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_call_op_send_message.html">internal::CallOpSendMessage</a>;</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keyword">template</span> <<span class="keyword">class</span> R></div><div class="line"><a name="l00106"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a445caf03eec410ca4fab24e534181801"> 106</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_call_op_recv_message.html">internal::CallOpRecvMessage</a>;</div><div class="line"><a name="l00107"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a291e55ec452333b2212c5d5a3fac160f"> 107</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_call_op_generic_recv_message.html">internal::CallOpGenericRecvMessage</a>;</div><div class="line"><a name="l00108"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a499997f007ce7afcc7ca7adb69a0bebf"> 108</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_method_handler.html">internal::MethodHandler</a>;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keyword">template</span> <<span class="keyword">class</span> ServiceType, <span class="keyword">class</span> RequestType, <span class="keyword">class</span> ResponseType></div><div class="line"><a name="l00110"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a471b336e252edb7105b57058c8de7fff"> 110</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_rpc_method_handler.html">internal::RpcMethodHandler</a>;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keyword">template</span> <<span class="keyword">class</span> ServiceType, <span class="keyword">class</span> RequestType, <span class="keyword">class</span> ResponseType></div><div class="line"><a name="l00112"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a92a457fe95d4f1662f65ed9b47be0f84"> 112</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_server_streaming_handler.html">internal::ServerStreamingHandler</a>;</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  <span class="keyword">template</span> <<span class="keyword">class</span> R></div><div class="line"><a name="l00114"></a><span class="lineno"><a class="line" href="classgrpc_1_1_byte_buffer.html#a8575cd74967bac70dad4afbf830db64c"> 114</a></span>  <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_deserialize_func_type.html">internal::DeserializeFuncType</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>  <a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>* buffer_;</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  <span class="comment">// takes ownership</span></div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  <span class="keywordtype">void</span> set_buffer(<a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>* buf) {</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keywordflow">if</span> (buffer_) {</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  Clear();</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  }</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  buffer_ = buf;</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</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>  <a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>* c_buffer() { <span class="keywordflow">return</span> buffer_; }</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>** c_buffer_ptr() { <span class="keywordflow">return</span> &buffer_; }</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span> </div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keyword">class </span>ByteBufferPointer {</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  ByteBufferPointer(<span class="keyword">const</span> <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>* b)</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  : bbuf_(const_cast<<a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>*>(b)) {}</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="keyword">operator</span> <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>*() { <span class="keywordflow">return</span> bbuf_; }</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  <span class="keyword">operator</span> <a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>*() { <span class="keywordflow">return</span> bbuf_->buffer_; }</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="keyword">operator</span> <a class="code" href="structgrpc__byte__buffer.html">grpc_byte_buffer</a>**() { <span class="keywordflow">return</span> &bbuf_->buffer_; }</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> </div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keyword">private</span>:</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>* bbuf_;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  };</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  ByteBufferPointer bbuf_ptr()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> ByteBufferPointer(<span class="keyword">this</span>); }</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</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="keyword">template</span> <></div><div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4.html"> 144</a></span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1_serialization_traits.html">SerializationTraits</a><<a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>, void> {</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00146"></a><span class="lineno"><a class="line" href="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4.html#a11eb353a98d86bab2fa1a1bfd5df9393"> 146</a></span>  <span class="keyword">static</span> <a class="code" href="classgrpc_1_1_status.html">Status</a> <a class="code" href="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4.html#a11eb353a98d86bab2fa1a1bfd5df9393">Deserialize</a>(<a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>* byte_buffer, <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>* dest) {</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  dest->set_buffer(byte_buffer->buffer_);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="keywordflow">return</span> <a class="code" href="classgrpc_1_1_status.html#acbac12f241ad08f449aa1b9086ec7acc">Status::OK</a>;</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div><div class="line"><a name="l00150"></a><span class="lineno"><a class="line" href="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4.html#a5a4c3007da4742be050c0d58de8c0590"> 150</a></span>  <span class="keyword">static</span> <a class="code" href="classgrpc_1_1_status.html">Status</a> <a class="code" href="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4.html#a5a4c3007da4742be050c0d58de8c0590">Serialize</a>(<span class="keyword">const</span> <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>& source, <a class="code" href="classgrpc_1_1_byte_buffer.html">ByteBuffer</a>* buffer,</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  <span class="keywordtype">bool</span>* own_buffer) {</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  *buffer = source;</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span>  *own_buffer = <span class="keyword">true</span>;</div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="keywordflow">return</span> <a class="code" href="classgrpc_1_1_status.html#acbac12f241ad08f449aa1b9086ec7acc">Status::OK</a>;</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  }</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span> };</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span> </div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> } <span class="comment">// namespace grpc</span></div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> </div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span> <span class="preprocessor">#endif // GRPCPP_IMPL_CODEGEN_BYTE_BUFFER_H</span></div><div class="ttc" id="grpcpp_2impl_2codegen_2config_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2config_8h.html">config.h</a></div></div>
- <div class="ttc" id="classgrpc_1_1_byte_buffer_html_a185b593e5c7d2b888fa377989a6bae80"><div class="ttname"><a href="classgrpc_1_1_byte_buffer.html#a185b593e5c7d2b888fa377989a6bae80">grpc::ByteBuffer::Clear</a></div><div class="ttdeci">void Clear()</div><div class="ttdoc">Remove all data. </div><div class="ttdef"><b>Definition:</b> byte_buffer.h:74</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_server_streaming_handler_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_server_streaming_handler.html">grpc::internal::ServerStreamingHandler</a></div><div class="ttdoc">A wrapper class of an application provided server streaming handler. </div><div class="ttdef"><b>Definition:</b> byte_buffer.h:45</div></div>
- <div class="ttc" id="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4_html_a5a4c3007da4742be050c0d58de8c0590"><div class="ttname"><a href="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4.html#a5a4c3007da4742be050c0d58de8c0590">grpc::SerializationTraits< ByteBuffer, void >::Serialize</a></div><div class="ttdeci">static Status Serialize(const ByteBuffer &source, ByteBuffer *buffer, bool *own_buffer)</div><div class="ttdef"><b>Definition:</b> byte_buffer.h:150</div></div>
- <div class="ttc" id="classgrpc_1_1_slice_html"><div class="ttname"><a href="classgrpc_1_1_slice.html">grpc::Slice</a></div><div class="ttdoc">A wrapper around grpc_slice. </div><div class="ttdef"><b>Definition:</b> slice.h:35</div></div>
- <div class="ttc" id="classgrpc_1_1_byte_buffer_html_a42889c8018ea3868db2f54d92d1609ab"><div class="ttname"><a href="classgrpc_1_1_byte_buffer.html#a42889c8018ea3868db2f54d92d1609ab">grpc::ByteBuffer::Duplicate</a></div><div class="ttdeci">void Duplicate()</div><div class="ttdoc">Make a duplicate copy of the internals of this byte buffer so that we have our own owned version of i...</div><div class="ttdef"><b>Definition:</b> byte_buffer.h:84</div></div>
- <div class="ttc" id="grpcpp_2impl_2codegen_2slice_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2slice_8h.html">slice.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_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:99</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_deserialize_func_type_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_deserialize_func_type.html">grpc::internal::DeserializeFuncType</a></div><div class="ttdef"><b>Definition:</b> byte_buffer.h:47</div></div>
- <div class="ttc" id="classgrpc_1_1_core_codegen_interface_html_aad8bd2e910b838c91bc5aba03d2dc153"><div class="ttname"><a href="classgrpc_1_1_core_codegen_interface.html#aad8bd2e910b838c91bc5aba03d2dc153">grpc::CoreCodegenInterface::grpc_byte_buffer_destroy</a></div><div class="ttdeci">virtual void grpc_byte_buffer_destroy(grpc_byte_buffer *bb)=0</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="classgrpc_1_1_byte_buffer_html_ae03627c8b3297965fa0cdd4f03a9af0f"><div class="ttname"><a href="classgrpc_1_1_byte_buffer.html#ae03627c8b3297965fa0cdd4f03a9af0f">grpc::ByteBuffer::Release</a></div><div class="ttdeci">void Release()</div><div class="ttdoc">Forget underlying byte buffer without destroying Use this only for un-owned byte buffers. </div><div class="ttdef"><b>Definition:</b> byte_buffer.h:90</div></div>
- <div class="ttc" id="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4_html_a11eb353a98d86bab2fa1a1bfd5df9393"><div class="ttname"><a href="classgrpc_1_1_serialization_traits_3_01_byte_buffer_00_01void_01_4.html#a11eb353a98d86bab2fa1a1bfd5df9393">grpc::SerializationTraits< ByteBuffer, void >::Deserialize</a></div><div class="ttdeci">static Status Deserialize(ByteBuffer *byte_buffer, ByteBuffer *dest)</div><div class="ttdef"><b>Definition:</b> byte_buffer.h:146</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_call_op_send_message_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_call_op_send_message.html">grpc::internal::CallOpSendMessage</a></div><div class="ttdef"><b>Definition:</b> call.h:268</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="grpc_2impl_2codegen_2byte__buffer_8h_html"><div class="ttname"><a href="grpc_2impl_2codegen_2byte__buffer_8h.html">byte_buffer.h</a></div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_rpc_method_handler_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_rpc_method_handler.html">grpc::internal::RpcMethodHandler</a></div><div class="ttdoc">A wrapper class of an application provided rpc method handler. </div><div class="ttdef"><b>Definition:</b> byte_buffer.h:43</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_call_op_recv_message_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_call_op_recv_message.html">grpc::internal::CallOpRecvMessage</a></div><div class="ttdef"><b>Definition:</b> byte_buffer.h:39</div></div>
- <div class="ttc" id="classgrpc_1_1_server_interface_html"><div class="ttname"><a href="classgrpc_1_1_server_interface.html">grpc::ServerInterface</a></div><div class="ttdef"><b>Definition:</b> server_interface.h:48</div></div>
- <div class="ttc" id="classgrpc_1_1_core_codegen_interface_html_a27c53b8e68493908593016bf8951f4a0"><div class="ttname"><a href="classgrpc_1_1_core_codegen_interface.html#a27c53b8e68493908593016bf8951f4a0">grpc::CoreCodegenInterface::grpc_byte_buffer_copy</a></div><div class="ttdeci">virtual grpc_byte_buffer * grpc_byte_buffer_copy(grpc_byte_buffer *bb)=0</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_method_handler_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_method_handler.html">grpc::internal::MethodHandler</a></div><div class="ttdoc">Base class for running an RPC handler. </div><div class="ttdef"><b>Definition:</b> rpc_service_method.h:38</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_1_byte_buffer_html_aeb5dd0045ed262de06481465326bd64a"><div class="ttname"><a href="classgrpc_1_1_byte_buffer.html#aeb5dd0045ed262de06481465326bd64a">grpc::ByteBuffer::~ByteBuffer</a></div><div class="ttdeci">~ByteBuffer()</div><div class="ttdef"><b>Definition:</b> byte_buffer.h:62</div></div>
- <div class="ttc" id="classgrpc_1_1internal_1_1_call_op_generic_recv_message_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_call_op_generic_recv_message.html">grpc::internal::CallOpGenericRecvMessage</a></div><div class="ttdef"><b>Definition:</b> call.h:392</div></div>
- <div class="ttc" id="classgrpc_1_1_status_html_acbac12f241ad08f449aa1b9086ec7acc"><div class="ttname"><a href="classgrpc_1_1_status.html#acbac12f241ad08f449aa1b9086ec7acc">grpc::Status::OK</a></div><div class="ttdeci">static const Status & OK</div><div class="ttdoc">An OK pre-defined instance. </div><div class="ttdef"><b>Definition:</b> status.h:105</div></div>
- <div class="ttc" id="classgrpc_1_1_byte_buffer_html_aa3037355cbd37dce99c97e5c3700a76b"><div class="ttname"><a href="classgrpc_1_1_byte_buffer.html#aa3037355cbd37dce99c97e5c3700a76b">grpc::ByteBuffer::ByteBuffer</a></div><div class="ttdeci">ByteBuffer()</div><div class="ttdoc">Constuct an empty buffer. </div><div class="ttdef"><b>Definition:</b> byte_buffer.h:53</div></div>
- <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:50</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>
|