intercepted__channel_8h_source.html 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.17"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>GRPC C++: include/grpcpp/impl/codegen/intercepted_channel.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. </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.36.1</span>
  26. </div>
  27. </td>
  28. </tr>
  29. </tbody>
  30. </table>
  31. </div>
  32. <!-- end header part -->
  33. <!-- Generated by Doxygen 1.8.17 -->
  34. <script type="text/javascript">
  35. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  36. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  37. /* @license-end */
  38. </script>
  39. <script type="text/javascript" src="menudata.js"></script>
  40. <script type="text/javascript" src="menu.js"></script>
  41. <script type="text/javascript">
  42. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  43. $(function() {
  44. initMenu('',true,false,'search.php','Search');
  45. $(document).ready(function() { init_search(); });
  46. });
  47. /* @license-end */</script>
  48. <div id="main-nav"></div>
  49. <!-- window showing the filter options -->
  50. <div id="MSearchSelectWindow"
  51. onmouseover="return searchBox.OnSearchSelectShow()"
  52. onmouseout="return searchBox.OnSearchSelectHide()"
  53. onkeydown="return searchBox.OnSearchSelectKey(event)">
  54. </div>
  55. <!-- iframe showing the search results (closed by default) -->
  56. <div id="MSearchResultsWindow">
  57. <iframe src="javascript:void(0)" frameborder="0"
  58. name="MSearchResults" id="MSearchResults">
  59. </iframe>
  60. </div>
  61. <div id="nav-path" class="navpath">
  62. <ul>
  63. <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>
  64. </div>
  65. </div><!-- top -->
  66. <div class="header">
  67. <div class="headertitle">
  68. <div class="title">intercepted_channel.h</div> </div>
  69. </div><!--header-->
  70. <div class="contents">
  71. <a href="intercepted__channel_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>
  72. <div class="line"><a name="l00002"></a><span class="lineno"> 2</span>&#160;<span class="comment"> *</span></div>
  73. <div class="line"><a name="l00003"></a><span class="lineno"> 3</span>&#160;<span class="comment"> * Copyright 2018 gRPC authors.</span></div>
  74. <div class="line"><a name="l00004"></a><span class="lineno"> 4</span>&#160;<span class="comment"> *</span></div>
  75. <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>
  76. <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>
  77. <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>
  78. <div class="line"><a name="l00008"></a><span class="lineno"> 8</span>&#160;<span class="comment"> *</span></div>
  79. <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>
  80. <div class="line"><a name="l00010"></a><span class="lineno"> 10</span>&#160;<span class="comment"> *</span></div>
  81. <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>
  82. <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>
  83. <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>
  84. <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>
  85. <div class="line"><a name="l00015"></a><span class="lineno"> 15</span>&#160;<span class="comment"> * limitations under the License.</span></div>
  86. <div class="line"><a name="l00016"></a><span class="lineno"> 16</span>&#160;<span class="comment"> *</span></div>
  87. <div class="line"><a name="l00017"></a><span class="lineno"> 17</span>&#160;<span class="comment"> */</span></div>
  88. <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>&#160; </div>
  89. <div class="line"><a name="l00019"></a><span class="lineno"> 19</span>&#160;<span class="preprocessor">#ifndef GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H</span></div>
  90. <div class="line"><a name="l00020"></a><span class="lineno"> 20</span>&#160;<span class="preprocessor">#define GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H</span></div>
  91. <div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160; </div>
  92. <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#include &lt;<a class="code" href="grpcpp_2impl_2codegen_2channel__interface_8h.html">grpcpp/impl/codegen/channel_interface.h</a>&gt;</span></div>
  93. <div class="line"><a name="l00023"></a><span class="lineno"> 23</span>&#160; </div>
  94. <div class="line"><a name="l00024"></a><span class="lineno"> 24</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespacegrpc.html">grpc</a> {</div>
  95. <div class="line"><a name="l00025"></a><span class="lineno"> 25</span>&#160;<span class="keyword">class </span>CompletionQueue;</div>
  96. <div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160; </div>
  97. <div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="keyword">namespace </span>internal {</div>
  98. <div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160; </div>
  99. <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>&#160;<span class="keyword">class </span>InterceptorBatchMethodsImpl;</div>
  100. <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>&#160; </div>
  101. <div class="line"><a name="l00035"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_intercepted_channel.html"> 35</a></span>&#160;<span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_intercepted_channel.html">InterceptedChannel</a> : <span class="keyword">public</span> <a class="code" href="classgrpc_1_1_channel_interface.html">ChannelInterface</a> {</div>
  102. <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>&#160; <span class="keyword">public</span>:</div>
  103. <div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_intercepted_channel.html#ac6c23faad6b1fe426e1092498790851e"> 37</a></span>&#160; <a class="code" href="classgrpc_1_1internal_1_1_intercepted_channel.html#ac6c23faad6b1fe426e1092498790851e">~InterceptedChannel</a>()<span class="keyword"> override </span>{ channel_ = <span class="keyword">nullptr</span>; }</div>
  104. <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>&#160; </div>
  105. <div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_intercepted_channel.html#ab7073fa3f0de1369f7201c1ce1630970"> 41</a></span>&#160; <a class="code" href="connectivity__state_8h.html#a065b65f5cdd062a67d82e2b6bcf68cf2">grpc_connectivity_state</a> <a class="code" href="classgrpc_1_1internal_1_1_intercepted_channel.html#ab7073fa3f0de1369f7201c1ce1630970">GetState</a>(<span class="keywordtype">bool</span> try_to_connect)<span class="keyword"> override </span>{</div>
  106. <div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; <span class="keywordflow">return</span> channel_-&gt;<a class="code" href="classgrpc_1_1_channel_interface.html#a68e987e7b87ca5a2668419736f9ee9b1">GetState</a>(try_to_connect);</div>
  107. <div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; }</div>
  108. <div class="line"><a name="l00044"></a><span class="lineno"> 44</span>&#160; </div>
  109. <div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160; <span class="keyword">private</span>:</div>
  110. <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>&#160; <a class="code" href="classgrpc_1_1internal_1_1_intercepted_channel.html">InterceptedChannel</a>(<a class="code" href="classgrpc_1_1_channel_interface.html">ChannelInterface</a>* channel, <span class="keywordtype">size_t</span> pos)</div>
  111. <div class="line"><a name="l00047"></a><span class="lineno"> 47</span>&#160; : channel_(channel), interceptor_pos_(pos) {}</div>
  112. <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; </div>
  113. <div class="line"><a name="l00049"></a><span class="lineno"> 49</span>&#160; Call CreateCall(<span class="keyword">const</span> RpcMethod&amp; method, ::<a class="code" href="classgrpc_1_1_client_context.html">grpc::ClientContext</a>* context,</div>
  114. <div class="line"><a name="l00050"></a><span class="lineno"> 50</span>&#160; ::<a class="code" href="classgrpc_1_1_completion_queue.html">grpc::CompletionQueue</a>* cq)<span class="keyword"> override </span>{</div>
  115. <div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160; <span class="keywordflow">return</span> channel_-&gt;CreateCallInternal(method, context, cq, interceptor_pos_);</div>
  116. <div class="line"><a name="l00052"></a><span class="lineno"> 52</span>&#160; }</div>
  117. <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>&#160; </div>
  118. <div class="line"><a name="l00054"></a><span class="lineno"> 54</span>&#160; <span class="keywordtype">void</span> PerformOpsOnCall(CallOpSetInterface* ops, Call* call)<span class="keyword"> override </span>{</div>
  119. <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>&#160; <span class="keywordflow">return</span> channel_-&gt;PerformOpsOnCall(ops, call);</div>
  120. <div class="line"><a name="l00056"></a><span class="lineno"> 56</span>&#160; }</div>
  121. <div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160; <span class="keywordtype">void</span>* RegisterMethod(<span class="keyword">const</span> <span class="keywordtype">char</span>* method)<span class="keyword"> override </span>{</div>
  122. <div class="line"><a name="l00058"></a><span class="lineno"> 58</span>&#160; <span class="keywordflow">return</span> channel_-&gt;RegisterMethod(method);</div>
  123. <div class="line"><a name="l00059"></a><span class="lineno"> 59</span>&#160; }</div>
  124. <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>&#160; </div>
  125. <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>&#160; <span class="keywordtype">void</span> NotifyOnStateChangeImpl(<a class="code" href="connectivity__state_8h.html#a065b65f5cdd062a67d82e2b6bcf68cf2">grpc_connectivity_state</a> last_observed,</div>
  126. <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>&#160; <a class="code" href="structgpr__timespec.html">gpr_timespec</a> deadline,</div>
  127. <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160; ::<a class="code" href="classgrpc_1_1_completion_queue.html">grpc::CompletionQueue</a>* cq,</div>
  128. <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>&#160; <span class="keywordtype">void</span>* tag)<span class="keyword"> override </span>{</div>
  129. <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>&#160; <span class="keywordflow">return</span> channel_-&gt;NotifyOnStateChangeImpl(last_observed, deadline, cq, tag);</div>
  130. <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>&#160; }</div>
  131. <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>&#160; <span class="keywordtype">bool</span> WaitForStateChangeImpl(<a class="code" href="connectivity__state_8h.html#a065b65f5cdd062a67d82e2b6bcf68cf2">grpc_connectivity_state</a> last_observed,</div>
  132. <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>&#160; <a class="code" href="structgpr__timespec.html">gpr_timespec</a> deadline)<span class="keyword"> override </span>{</div>
  133. <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>&#160; <span class="keywordflow">return</span> channel_-&gt;WaitForStateChangeImpl(last_observed, deadline);</div>
  134. <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>&#160; }</div>
  135. <div class="line"><a name="l00071"></a><span class="lineno"> 71</span>&#160; </div>
  136. <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>&#160; <a class="code" href="classgrpc_1_1_completion_queue.html">::grpc::CompletionQueue</a>* CallbackCQ()<span class="keyword"> override </span>{</div>
  137. <div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keywordflow">return</span> channel_-&gt;CallbackCQ();</div>
  138. <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; }</div>
  139. <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; </div>
  140. <div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; ChannelInterface* channel_;</div>
  141. <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; <span class="keywordtype">size_t</span> interceptor_pos_;</div>
  142. <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>&#160; </div>
  143. <div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="classgrpc_1_1internal_1_1_intercepted_channel.html#a727024a430a919fd5294f685d1c5b36c"> 79</a></span>&#160; <span class="keyword">friend</span> <span class="keyword">class </span><a class="code" href="classgrpc_1_1internal_1_1_interceptor_batch_methods_impl.html">InterceptorBatchMethodsImpl</a>;</div>
  144. <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>&#160;};</div>
  145. <div class="line"><a name="l00081"></a><span class="lineno"> 81</span>&#160;} <span class="comment">// namespace internal</span></div>
  146. <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160;} <span class="comment">// namespace grpc</span></div>
  147. <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>&#160; </div>
  148. <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>&#160;<span class="preprocessor">#endif // GRPCPP_IMPL_CODEGEN_INTERCEPTED_CHANNEL_H</span></div>
  149. </div><!-- fragment --></div><!-- contents -->
  150. <div class="ttc" id="aclassgrpc_1_1internal_1_1_intercepted_channel_html_ab7073fa3f0de1369f7201c1ce1630970"><div class="ttname"><a href="classgrpc_1_1internal_1_1_intercepted_channel.html#ab7073fa3f0de1369f7201c1ce1630970">grpc::internal::InterceptedChannel::GetState</a></div><div class="ttdeci">grpc_connectivity_state GetState(bool try_to_connect) override</div><div class="ttdoc">Get the current channel state.</div><div class="ttdef"><b>Definition:</b> intercepted_channel.h:41</div></div>
  151. <div class="ttc" id="anamespacegrpc_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 or invokes the user-provided ...</div><div class="ttdef"><b>Definition:</b> alarm.h:33</div></div>
  152. <div class="ttc" id="aclassgrpc_1_1_client_context_html"><div class="ttname"><a href="classgrpc_1_1_client_context.html">grpc::ClientContext</a></div><div class="ttdoc">A ClientContext allows the person implementing a service client to:</div><div class="ttdef"><b>Definition:</b> client_context.h:192</div></div>
  153. <div class="ttc" id="aconnectivity__state_8h_html_a065b65f5cdd062a67d82e2b6bcf68cf2"><div class="ttname"><a href="connectivity__state_8h.html#a065b65f5cdd062a67d82e2b6bcf68cf2">grpc_connectivity_state</a></div><div class="ttdeci">grpc_connectivity_state</div><div class="ttdoc">Connectivity state of a channel.</div><div class="ttdef"><b>Definition:</b> connectivity_state.h:27</div></div>
  154. <div class="ttc" id="aclassgrpc_1_1_channel_interface_html"><div class="ttname"><a href="classgrpc_1_1_channel_interface.html">grpc::ChannelInterface</a></div><div class="ttdoc">Codegen interface for grpc::Channel.</div><div class="ttdef"><b>Definition:</b> channel_interface.h:71</div></div>
  155. <div class="ttc" id="aclassgrpc_1_1internal_1_1_intercepted_channel_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_intercepted_channel.html">grpc::internal::InterceptedChannel</a></div><div class="ttdoc">An InterceptedChannel is available to client Interceptors.</div><div class="ttdef"><b>Definition:</b> intercepted_channel.h:35</div></div>
  156. <div class="ttc" id="agrpcpp_2impl_2codegen_2channel__interface_8h_html"><div class="ttname"><a href="grpcpp_2impl_2codegen_2channel__interface_8h.html">channel_interface.h</a></div></div>
  157. <div class="ttc" id="aclassgrpc_1_1_channel_interface_html_a68e987e7b87ca5a2668419736f9ee9b1"><div class="ttname"><a href="classgrpc_1_1_channel_interface.html#a68e987e7b87ca5a2668419736f9ee9b1">grpc::ChannelInterface::GetState</a></div><div class="ttdeci">virtual grpc_connectivity_state GetState(bool try_to_connect)=0</div><div class="ttdoc">Get the current channel state.</div></div>
  158. <div class="ttc" id="aclassgrpc_1_1internal_1_1_intercepted_channel_html_ac6c23faad6b1fe426e1092498790851e"><div class="ttname"><a href="classgrpc_1_1internal_1_1_intercepted_channel.html#ac6c23faad6b1fe426e1092498790851e">grpc::internal::InterceptedChannel::~InterceptedChannel</a></div><div class="ttdeci">~InterceptedChannel() override</div><div class="ttdef"><b>Definition:</b> intercepted_channel.h:37</div></div>
  159. <div class="ttc" id="aclassgrpc_1_1_completion_queue_html"><div class="ttname"><a href="classgrpc_1_1_completion_queue.html">grpc::CompletionQueue</a></div><div class="ttdoc">A thin wrapper around grpc_completion_queue (see src/core/lib/surface/completion_queue....</div><div class="ttdef"><b>Definition:</b> completion_queue.h:102</div></div>
  160. <div class="ttc" id="astructgpr__timespec_html"><div class="ttname"><a href="structgpr__timespec.html">gpr_timespec</a></div><div class="ttdoc">Analogous to struct timespec.</div><div class="ttdef"><b>Definition:</b> gpr_types.h:47</div></div>
  161. <div class="ttc" id="aclassgrpc_1_1internal_1_1_interceptor_batch_methods_impl_html"><div class="ttname"><a href="classgrpc_1_1internal_1_1_interceptor_batch_methods_impl.html">grpc::internal::InterceptorBatchMethodsImpl</a></div><div class="ttdef"><b>Definition:</b> interceptor_common.h:36</div></div>
  162. <!-- start footer part -->
  163. <hr class="footer"/><address class="footer"><small>
  164. Generated on Wed Mar 3 2021 19:17:20 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
  165. <img class="footer" src="doxygen.png" alt="doxygen"/>
  166. </a> 1.8.17
  167. </small></address>
  168. </body>
  169. </html>