Micro template library A library for building device drivers
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

124 lines
20 KiB

  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.14"/>
  7. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  8. <title>uTL: include/utl/com/_1wire_id.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="navtree.css" rel="stylesheet" type="text/css"/>
  13. <script type="text/javascript" src="resize.js"></script>
  14. <script type="text/javascript" src="navtreedata.js"></script>
  15. <script type="text/javascript" src="navtree.js"></script>
  16. <script type="text/javascript">
  17. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  18. $(document).ready(initResizable);
  19. /* @license-end */</script>
  20. <link href="search/search.css" rel="stylesheet" type="text/css"/>
  21. <script type="text/javascript" src="search/searchdata.js"></script>
  22. <script type="text/javascript" src="search/search.js"></script>
  23. <link href="doxygen.css" rel="stylesheet" type="text/css" />
  24. </head>
  25. <body>
  26. <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
  27. <div id="titlearea">
  28. <table cellspacing="0" cellpadding="0">
  29. <tbody>
  30. <tr style="height: 56px;">
  31. <td id="projectalign" style="padding-left: 0.5em;">
  32. <div id="projectname">uTL
  33. </div>
  34. <div id="projectbrief">micro Template library</div>
  35. </td>
  36. </tr>
  37. </tbody>
  38. </table>
  39. </div>
  40. <!-- end header part -->
  41. <!-- Generated by Doxygen 1.8.14 -->
  42. <script type="text/javascript">
  43. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  44. var searchBox = new SearchBox("searchBox", "search",false,'Search');
  45. /* @license-end */
  46. </script>
  47. <script type="text/javascript" src="menudata.js"></script>
  48. <script type="text/javascript" src="menu.js"></script>
  49. <script type="text/javascript">
  50. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  51. $(function() {
  52. initMenu('',true,false,'search.php','Search');
  53. $(document).ready(function() { init_search(); });
  54. });
  55. /* @license-end */</script>
  56. <div id="main-nav"></div>
  57. </div><!-- top -->
  58. <div id="side-nav" class="ui-resizable side-nav-resizable">
  59. <div id="nav-tree">
  60. <div id="nav-tree-contents">
  61. <div id="nav-sync" class="sync"></div>
  62. </div>
  63. </div>
  64. <div id="splitbar" style="-moz-user-select:none;"
  65. class="ui-resizable-handle">
  66. </div>
  67. </div>
  68. <script type="text/javascript">
  69. /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
  70. $(document).ready(function(){initNavTree('__1wire__id_8h_source.html','');});
  71. /* @license-end */
  72. </script>
  73. <div id="doc-content">
  74. <!-- window showing the filter options -->
  75. <div id="MSearchSelectWindow"
  76. onmouseover="return searchBox.OnSearchSelectShow()"
  77. onmouseout="return searchBox.OnSearchSelectHide()"
  78. onkeydown="return searchBox.OnSearchSelectKey(event)">
  79. </div>
  80. <!-- iframe showing the search results (closed by default) -->
  81. <div id="MSearchResultsWindow">
  82. <iframe src="javascript:void(0)" frameborder="0"
  83. name="MSearchResults" id="MSearchResults">
  84. </iframe>
  85. </div>
  86. <div class="header">
  87. <div class="headertitle">
  88. <div class="title">_1wire_id.h</div> </div>
  89. </div><!--header-->
  90. <div class="contents">
  91. <a href="__1wire__id_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;</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>&#160;<span class="preprocessor">#ifndef __utl_com_1wire_id_h__</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>&#160;<span class="preprocessor">#define __utl_com_1wire_id_h__</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_8h.html">utl/core/impl.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="id_8h.html">utl/container/id.h</a>&gt;</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>&#160;</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>&#160;<span class="keyword">namespace </span><a class="code" href="namespaceutl.html">utl</a> {</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>&#160;</div><div class="line"><a name="l00032"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html"> 32</a></span>&#160; <span class="keyword">class </span><a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a> : <span class="keyword">public</span> <a class="code" href="structutl_1_1id__t.html">id_t</a>&lt;uint8_t, 8&gt; {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>&#160;</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>&#160; <span class="keyword">public</span>:</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#a813f69adfff7bcdcba6b07bf52e3546e"> 39</a></span>&#160; <a class="code" href="classutl_1_1__1wire__id__t.html#a813f69adfff7bcdcba6b07bf52e3546e">_1wire_id_t</a> () noexcept</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>&#160; : <a class="code" href="structutl_1_1id__t.html">id_t</a>&lt;uint8_t, 8&gt; {0, 0, 0, 0, 0, 0, 0, 0} { }</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#a042aa65cc13c6040f795c8198f5afc23"> 41</a></span>&#160; <a class="code" href="classutl_1_1__1wire__id__t.html#a042aa65cc13c6040f795c8198f5afc23">_1wire_id_t</a> (<span class="keyword">const</span> <a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a>&amp; <span class="keywordtype">id</span>) noexcept {</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>&#160; std::copy(<span class="keywordtype">id</span>.<a class="code" href="structutl_1_1id__t.html#abf6354098b87ecd333bfb3a160e757df">begin</a>(), <span class="keywordtype">id</span>.<a class="code" href="structutl_1_1id__t.html#ad3e1553b24e43c71b64d080922c42148">end</a>(), this-&gt;<a class="code" href="structutl_1_1id__t.html#abf6354098b87ecd333bfb3a160e757df">begin</a>());</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>&#160; }</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>&#160;</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>&#160; <span class="keyword">static</span> constexpr <span class="keyword">const</span> <a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a>&amp; <a class="code" href="classutl_1_1__1wire__id__t.html#adad08aa5ce38e1a87800de57a91db81b">nullDev</a> () { <span class="keywordflow">return</span> <a class="code" href="classutl_1_1__1wire__id__t.html#a9d1d7610961adf2ae3669cbbcace74d2">nullDev_</a>; }</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>&#160;</div><div class="line"><a name="l00054"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#adb30b65bcab59bdad980793377a8e52f"> 54</a></span>&#160; uint8_t&amp; <a class="code" href="classutl_1_1__1wire__id__t.html#adb30b65bcab59bdad980793377a8e52f">family</a>() noexcept { <span class="keywordflow">return</span> <a class="code" href="structutl_1_1id__t.html#a00d98ffd688e3c146b7dca509487b821">front</a>(); }</div><div class="line"><a name="l00055"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#a6ed0d86d1fce0073776d83092a874b91"> 55</a></span>&#160; <span class="keyword">const</span> uint8_t&amp; <a class="code" href="classutl_1_1__1wire__id__t.html#a6ed0d86d1fce0073776d83092a874b91">family</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="structutl_1_1id__t.html#a00d98ffd688e3c146b7dca509487b821">front</a>(); }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>&#160;</div><div class="line"><a name="l00060"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#a03a112d8910c67611a3b302fe7c0706b"> 60</a></span>&#160; uint8_t&amp; <a class="code" href="classutl_1_1__1wire__id__t.html#a03a112d8910c67611a3b302fe7c0706b">crc8</a>() noexcept { <span class="keywordflow">return</span> <a class="code" href="structutl_1_1id__t.html#a9a289ddc68f8ceec5368bf63334a2829">back</a>(); }</div><div class="line"><a name="l00061"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#af3a0ea2c575f96ac01b0aac91166d767"> 61</a></span>&#160; <span class="keyword">const</span> uint8_t&amp; <a class="code" href="classutl_1_1__1wire__id__t.html#af3a0ea2c575f96ac01b0aac91166d767">crc8</a>() const noexcept { <span class="keywordflow">return</span> <a class="code" href="structutl_1_1id__t.html#a9a289ddc68f8ceec5368bf63334a2829">back</a>(); }</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>&#160;</div><div class="line"><a name="l00072"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#aef89950aeb9d40ca058fabcc5532e01d"> 72</a></span>&#160; <span class="keyword">static</span> <span class="keywordtype">int</span> <a class="code" href="classutl_1_1__1wire__id__t.html#aef89950aeb9d40ca058fabcc5532e01d">compare</a> (<span class="keyword">const</span> <a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a>&amp; lhs, <span class="keyword">const</span> <a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a>&amp; rhs) noexcept {</div><div class="line"><a name="l00073"></a><span class="lineno"> 73</span>&#160; <span class="keyword">auto</span> p = std::mismatch (lhs.rbegin(), lhs.rend(), rhs.rbegin());</div><div class="line"><a name="l00074"></a><span class="lineno"> 74</span>&#160; <span class="keywordflow">if</span> (p.first == lhs.rend()) <span class="keywordflow">return</span> 0;</div><div class="line"><a name="l00075"></a><span class="lineno"> 75</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*p.first &lt; *p.second) <span class="keywordflow">return</span> -1;</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>&#160; <span class="keywordflow">else</span> <span class="keywordflow">return</span> 1;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>&#160; }</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span>&#160;</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>&#160; <span class="keyword">private</span>:</div><div class="line"><a name="l00083"></a><span class="lineno"><a class="line" href="classutl_1_1__1wire__id__t.html#a9d1d7610961adf2ae3669cbbcace74d2"> 83</a></span>&#160; <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a> <a class="code" href="classutl_1_1__1wire__id__t.html#a9d1d7610961adf2ae3669cbbcace74d2">nullDev_</a>;</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>&#160; };</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>&#160;</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span>&#160; <span class="comment">// Init static member</span></div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>&#160; <span class="keyword">const</span> <a class="code" href="classutl_1_1__1wire__id__t.html">_1wire_id_t</a> <a class="code" href="classutl_1_1__1wire__id__t.html#a9d1d7610961adf2ae3669cbbcace74d2">_1wire_id_t::nullDev_</a> { };</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>&#160;</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>&#160;} <span class="comment">// namespace tbx</span></div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>&#160;</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>&#160;<span class="preprocessor">#endif </span><span class="comment">/* __utl_com_1wire_id_h__ */</span><span class="preprocessor"></span></div><div class="ttc" id="structutl_1_1id__t_html_a9a289ddc68f8ceec5368bf63334a2829"><div class="ttname"><a href="structutl_1_1id__t.html#a9a289ddc68f8ceec5368bf63334a2829">utl::id_t&lt; uint8_t, 8 &gt;::back</a></div><div class="ttdeci">reference back() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="id_8h_source.html#l00184">id.h:184</a></div></div>
  92. <div class="ttc" id="structutl_1_1id__t_html_ad3e1553b24e43c71b64d080922c42148"><div class="ttname"><a href="structutl_1_1id__t.html#ad3e1553b24e43c71b64d080922c42148">utl::id_t&lt; uint8_t, 8 &gt;::end</a></div><div class="ttdeci">iterator end() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="id_8h_source.html#l00109">id.h:109</a></div></div>
  93. <div class="ttc" id="classutl_1_1__1wire__id__t_html_a042aa65cc13c6040f795c8198f5afc23"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#a042aa65cc13c6040f795c8198f5afc23">utl::_1wire_id_t::_1wire_id_t</a></div><div class="ttdeci">_1wire_id_t(const _1wire_id_t &amp;id) noexcept</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00041">_1wire_id.h:41</a></div></div>
  94. <div class="ttc" id="classutl_1_1__1wire__id__t_html_aef89950aeb9d40ca058fabcc5532e01d"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#aef89950aeb9d40ca058fabcc5532e01d">utl::_1wire_id_t::compare</a></div><div class="ttdeci">static int compare(const _1wire_id_t &amp;lhs, const _1wire_id_t &amp;rhs) noexcept</div><div class="ttdoc">Full compare two dev_ids. </div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00072">_1wire_id.h:72</a></div></div>
  95. <div class="ttc" id="structutl_1_1id__t_html_a00d98ffd688e3c146b7dca509487b821"><div class="ttname"><a href="structutl_1_1id__t.html#a00d98ffd688e3c146b7dca509487b821">utl::id_t&lt; uint8_t, 8 &gt;::front</a></div><div class="ttdeci">reference front() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="id_8h_source.html#l00176">id.h:176</a></div></div>
  96. <div class="ttc" id="classutl_1_1__1wire__id__t_html_a03a112d8910c67611a3b302fe7c0706b"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#a03a112d8910c67611a3b302fe7c0706b">utl::_1wire_id_t::crc8</a></div><div class="ttdeci">uint8_t &amp; crc8() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00060">_1wire_id.h:60</a></div></div>
  97. <div class="ttc" id="id_8h_html"><div class="ttname"><a href="id_8h.html">id.h</a></div><div class="ttdoc">A container for device IDs. </div></div>
  98. <div class="ttc" id="classutl_1_1__1wire__id__t_html"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html">utl::_1wire_id_t</a></div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00032">_1wire_id.h:32</a></div></div>
  99. <div class="ttc" id="classutl_1_1__1wire__id__t_html_adb30b65bcab59bdad980793377a8e52f"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#adb30b65bcab59bdad980793377a8e52f">utl::_1wire_id_t::family</a></div><div class="ttdeci">uint8_t &amp; family() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00054">_1wire_id.h:54</a></div></div>
  100. <div class="ttc" id="classutl_1_1__1wire__id__t_html_a6ed0d86d1fce0073776d83092a874b91"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#a6ed0d86d1fce0073776d83092a874b91">utl::_1wire_id_t::family</a></div><div class="ttdeci">const uint8_t &amp; family() const noexcept</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00055">_1wire_id.h:55</a></div></div>
  101. <div class="ttc" id="classutl_1_1__1wire__id__t_html_af3a0ea2c575f96ac01b0aac91166d767"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#af3a0ea2c575f96ac01b0aac91166d767">utl::_1wire_id_t::crc8</a></div><div class="ttdeci">const uint8_t &amp; crc8() const noexcept</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00061">_1wire_id.h:61</a></div></div>
  102. <div class="ttc" id="namespaceutl_html"><div class="ttname"><a href="namespaceutl.html">utl</a></div><div class="ttdoc">STL&amp;#39;s core language concepts. </div><div class="ttdef"><b>Definition:</b> <a href="__1wire_8h_source.html#l00030">_1wire.h:30</a></div></div>
  103. <div class="ttc" id="classutl_1_1__1wire__id__t_html_a9d1d7610961adf2ae3669cbbcace74d2"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#a9d1d7610961adf2ae3669cbbcace74d2">utl::_1wire_id_t::nullDev_</a></div><div class="ttdeci">static const _1wire_id_t nullDev_</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00083">_1wire_id.h:83</a></div></div>
  104. <div class="ttc" id="structutl_1_1id__t_html"><div class="ttname"><a href="structutl_1_1id__t.html">utl::id_t</a></div><div class="ttdoc">A standard container for storing IDs as a fixed size sequence of bytes. This type is based on etl::ar...</div><div class="ttdef"><b>Definition:</b> <a href="id_8h_source.html#l00078">id.h:78</a></div></div>
  105. <div class="ttc" id="classutl_1_1__1wire__id__t_html_adad08aa5ce38e1a87800de57a91db81b"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#adad08aa5ce38e1a87800de57a91db81b">utl::_1wire_id_t::nullDev</a></div><div class="ttdeci">static constexpr const _1wire_id_t &amp; nullDev()</div><div class="ttdoc">Return nullDev reference. </div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00050">_1wire_id.h:50</a></div></div>
  106. <div class="ttc" id="classutl_1_1__1wire__id__t_html_a813f69adfff7bcdcba6b07bf52e3546e"><div class="ttname"><a href="classutl_1_1__1wire__id__t.html#a813f69adfff7bcdcba6b07bf52e3546e">utl::_1wire_id_t::_1wire_id_t</a></div><div class="ttdeci">_1wire_id_t() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="__1wire__id_8h_source.html#l00039">_1wire_id.h:39</a></div></div>
  107. <div class="ttc" id="structutl_1_1id__t_html_abf6354098b87ecd333bfb3a160e757df"><div class="ttname"><a href="structutl_1_1id__t.html#abf6354098b87ecd333bfb3a160e757df">utl::id_t&lt; uint8_t, 8 &gt;::begin</a></div><div class="ttdeci">iterator begin() noexcept</div><div class="ttdef"><b>Definition:</b> <a href="id_8h_source.html#l00107">id.h:107</a></div></div>
  108. <div class="ttc" id="impl_8h_html"><div class="ttname"><a href="impl_8h.html">impl.h</a></div><div class="ttdoc">Implementation detail main forward header. </div></div>
  109. </div><!-- fragment --></div><!-- contents -->
  110. </div><!-- doc-content -->
  111. <!-- start footer part -->
  112. <div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  113. <ul>
  114. <li class="navelem"><a class="el" href="dir_d44c64559bbebec7f509842c48db8b23.html">include</a></li><li class="navelem"><a class="el" href="dir_82754f54d9380477ef02477185c1f103.html">utl</a></li><li class="navelem"><a class="el" href="dir_b2ad3c1a6521a4924fa9194d98c323e2.html">com</a></li><li class="navelem"><a class="el" href="__1wire__id_8h.html">_1wire_id.h</a></li>
  115. <li class="footer">Generated by
  116. <a href="http://www.doxygen.org/index.html">
  117. <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.14 </li>
  118. </ul>
  119. </div>
  120. </body>
  121. </html>