classgrpc_1_1_serialization_traits.html 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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++: grpc::SerializationTraits&lt; Message, UnusedButHereForPartialTemplateSpecialization &gt; Class Template Reference</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="namespacegrpc.html">grpc</a></li><li class="navelem"><a class="el" href="classgrpc_1_1_serialization_traits.html">SerializationTraits</a></li> </ul>
  64. </div>
  65. </div><!-- top -->
  66. <div class="header">
  67. <div class="headertitle">
  68. <div class="title">grpc::SerializationTraits&lt; Message, UnusedButHereForPartialTemplateSpecialization &gt; Class Template Reference</div> </div>
  69. </div><!--header-->
  70. <div class="contents">
  71. <p>Defines how to serialize and deserialize some type.
  72. <a href="classgrpc_1_1_serialization_traits.html#details">More...</a></p>
  73. <p><code>#include &lt;<a class="el" href="grpcpp_2impl_2codegen_2serialization__traits_8h_source.html">serialization_traits.h</a>&gt;</code></p>
  74. <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
  75. <div class="textblock"><h3>template&lt;class Message, class UnusedButHereForPartialTemplateSpecialization = void&gt;<br />
  76. class grpc::SerializationTraits&lt; Message, UnusedButHereForPartialTemplateSpecialization &gt;</h3>
  77. <p>Defines how to serialize and deserialize some type. </p>
  78. <p>Used for hooking different message serialization API's into GRPC. Each SerializationTraits&lt;Message&gt; implementation must provide the following functions:</p><ol type="1">
  79. <li>static <a class="el" href="classgrpc_1_1_status.html" title="Did it work? If it didn&#39;t, why?">Status</a> Serialize(const Message&amp; msg, ByteBuffer* buffer, bool* own_buffer); OR static <a class="el" href="classgrpc_1_1_status.html" title="Did it work? If it didn&#39;t, why?">Status</a> Serialize(const Message&amp; msg, grpc_byte_buffer** buffer, bool* own_buffer); The former is preferred; the latter is deprecated</li>
  80. <li>static <a class="el" href="classgrpc_1_1_status.html" title="Did it work? If it didn&#39;t, why?">Status</a> Deserialize(ByteBuffer* buffer, Message* msg); OR static <a class="el" href="classgrpc_1_1_status.html" title="Did it work? If it didn&#39;t, why?">Status</a> Deserialize(grpc_byte_buffer* buffer, Message* msg); The former is preferred; the latter is deprecated</li>
  81. </ol>
  82. <p>Serialize is required to convert message to a <a class="el" href="classgrpc_1_1_byte_buffer.html" title="A sequence of bytes.">ByteBuffer</a>, and return that byte buffer through *buffer. *own_buffer should be set to true if the caller owns said byte buffer, or false if ownership is retained elsewhere.</p>
  83. <p>Deserialize is required to convert buffer into the message stored at msg. max_receive_message_size is passed in as a bound on the maximum number of message bytes Deserialize should accept.</p>
  84. <p>Both functions return a <a class="el" href="classgrpc_1_1_status.html" title="Did it work? If it didn&#39;t, why?">Status</a>, allowing them to explain what went wrong if required. </p>
  85. </div><hr/>The documentation for this class was generated from the following file:<ul>
  86. <li>include/grpcpp/impl/codegen/<a class="el" href="grpcpp_2impl_2codegen_2serialization__traits_8h_source.html">serialization_traits.h</a></li>
  87. </ul>
  88. </div><!-- contents -->
  89. <!-- start footer part -->
  90. <hr class="footer"/><address class="footer"><small>
  91. Generated on Wed Mar 3 2021 19:17:24 for GRPC C++ by &#160;<a href="http://www.doxygen.org/index.html">
  92. <img class="footer" src="doxygen.png" alt="doxygen"/>
  93. </a> 1.8.17
  94. </small></address>
  95. </body>
  96. </html>