Files
simdjson-simdjson/classsimdjson_1_1implementation.html
T
2023-12-08 17:21:07 +00:00

268 lines
13 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>simdjson: simdjson::implementation Class Reference</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="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.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" />
<link href="doxygen-awesome.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only.css" rel="stylesheet" type="text/css"/>
<link href="doxygen-awesome-sidebar-only-darkmode-toggle.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="projectlogo"><img alt="Logo" src="logotiny.png"/></td>
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">simdjson
&#160;<span id="projectnumber">3.6.3</span>
</div>
<div id="projectbrief">Ridiculously Fast JSON</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
initMenu('',true,false,'search.php','Search');
$(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
<div id="nav-tree">
<div id="nav-tree-contents">
<div id="nav-sync" class="sync"></div>
</div>
</div>
<div id="splitbar" style="-moz-user-select:none;"
class="ui-resizable-handle">
</div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('classsimdjson_1_1implementation.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- 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 class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classsimdjson_1_1implementation-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">simdjson::implementation Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div> </div>
</div><!--header-->
<div class="contents">
<p>An implementation of simdjson for a particular CPU architecture.
<a href="classsimdjson_1_1implementation.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a404c32ec6187ac0fb5b2ec6b5aea4abd"><td class="memItemLeft" align="right" valign="top">virtual const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsimdjson_1_1implementation.html#a404c32ec6187ac0fb5b2ec6b5aea4abd">name</a> () const</td></tr>
<tr class="memdesc:a404c32ec6187ac0fb5b2ec6b5aea4abd"><td class="mdescLeft">&#160;</td><td class="mdescRight">The name of this implementation. <a href="classsimdjson_1_1implementation.html#a404c32ec6187ac0fb5b2ec6b5aea4abd">More...</a><br /></td></tr>
<tr class="separator:a404c32ec6187ac0fb5b2ec6b5aea4abd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4f41daefefc573e20fccd591b158e063"><td class="memItemLeft" align="right" valign="top">virtual const std::string &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsimdjson_1_1implementation.html#a4f41daefefc573e20fccd591b158e063">description</a> () const</td></tr>
<tr class="memdesc:a4f41daefefc573e20fccd591b158e063"><td class="mdescLeft">&#160;</td><td class="mdescRight">The description of this implementation. <a href="classsimdjson_1_1implementation.html#a4f41daefefc573e20fccd591b158e063">More...</a><br /></td></tr>
<tr class="separator:a4f41daefefc573e20fccd591b158e063"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adf77c9bc0869eff8fd46e942c4532135"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsimdjson_1_1implementation.html#adf77c9bc0869eff8fd46e942c4532135">supported_by_runtime_system</a> () const</td></tr>
<tr class="memdesc:adf77c9bc0869eff8fd46e942c4532135"><td class="mdescLeft">&#160;</td><td class="mdescRight">The instruction sets this implementation is compiled against and the current CPU match. <a href="classsimdjson_1_1implementation.html#adf77c9bc0869eff8fd46e942c4532135">More...</a><br /></td></tr>
<tr class="separator:adf77c9bc0869eff8fd46e942c4532135"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3a7b818d56a54cca272191ec176f8f1"><td class="memItemLeft" align="right" valign="top">virtual simdjson_warn_unused bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsimdjson_1_1implementation.html#aa3a7b818d56a54cca272191ec176f8f1">validate_utf8</a> (const char *buf, size_t len) const noexcept=0</td></tr>
<tr class="memdesc:aa3a7b818d56a54cca272191ec176f8f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Validate the UTF-8 string. <a href="classsimdjson_1_1implementation.html#aa3a7b818d56a54cca272191ec176f8f1">More...</a><br /></td></tr>
<tr class="separator:aa3a7b818d56a54cca272191ec176f8f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>An implementation of simdjson for a particular CPU architecture. </p>
<p>Also used to maintain the currently active implementation. The active implementation is automatically initialized on first use to the most advanced implementation supported by the host. </p>
<p class="definition">Definition at line <a class="el" href="implementation_8h_source.html#l00045">45</a> of file <a class="el" href="implementation_8h_source.html">implementation.h</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a4f41daefefc573e20fccd591b158e063"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a4f41daefefc573e20fccd591b158e063">&#9670;&nbsp;</a></span>description()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const std::string&amp; simdjson::implementation::description </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The description of this implementation. </p>
<pre class="fragment">const implementation *impl = simdjson::get_active_implementation();
cout &lt;&lt; "simdjson is optimized for " &lt;&lt; impl-&gt;name() &lt;&lt; "(" &lt;&lt; impl-&gt;description() &lt;&lt; ")" &lt;&lt; endl;
</pre> <dl class="section return"><dt>Returns</dt><dd>the description of the implementation, e.g. "Intel/AMD AVX2", "Intel/AMD SSE4.2", "ARM NEON". </dd></dl>
<p class="definition">Definition at line <a class="el" href="implementation_8h_source.html#l00066">66</a> of file <a class="el" href="implementation_8h_source.html">implementation.h</a>.</p>
</div>
</div>
<a id="a404c32ec6187ac0fb5b2ec6b5aea4abd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a404c32ec6187ac0fb5b2ec6b5aea4abd">&#9670;&nbsp;</a></span>name()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual const std::string&amp; simdjson::implementation::name </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">virtual</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>The name of this implementation. </p>
<pre class="fragment">const implementation *impl = simdjson::get_active_implementation();
cout &lt;&lt; "simdjson is optimized for " &lt;&lt; impl-&gt;name() &lt;&lt; "(" &lt;&lt; impl-&gt;description() &lt;&lt; ")" &lt;&lt; endl;
</pre> <dl class="section return"><dt>Returns</dt><dd>the name of the implementation, e.g. "haswell", "westmere", "arm64". </dd></dl>
<p class="definition">Definition at line <a class="el" href="implementation_8h_source.html#l00056">56</a> of file <a class="el" href="implementation_8h_source.html">implementation.h</a>.</p>
</div>
</div>
<a id="adf77c9bc0869eff8fd46e942c4532135"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adf77c9bc0869eff8fd46e942c4532135">&#9670;&nbsp;</a></span>supported_by_runtime_system()</h2>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">bool simdjson::implementation::supported_by_runtime_system </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>The instruction sets this implementation is compiled against and the current CPU match. </p>
<p>This function may poll the current CPU/system and should therefore not be called too often if performance is a concern.</p>
<dl class="section return"><dt>Returns</dt><dd>true if the implementation can be safely used on the current system (determined at runtime). </dd></dl>
</div>
</div>
<a id="aa3a7b818d56a54cca272191ec176f8f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3a7b818d56a54cca272191ec176f8f1">&#9670;&nbsp;</a></span>validate_utf8()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">virtual simdjson_warn_unused bool simdjson::implementation::validate_utf8 </td>
<td>(</td>
<td class="paramtype">const char *&#160;</td>
<td class="paramname"><em>buf</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">size_t&#160;</td>
<td class="paramname"><em>len</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Validate the UTF-8 string. </p>
<p>Overridden by each implementation.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">buf</td><td>the string to validate. </td></tr>
<tr><td class="paramname">len</td><td>the length of the string in bytes. </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>true if and only if the string is valid UTF-8. </dd></dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/simdjson/<a class="el" href="implementation_8h_source.html">implementation.h</a></li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
<ul>
<li class="navelem"><a class="el" href="namespacesimdjson.html">simdjson</a></li><li class="navelem"><a class="el" href="classsimdjson_1_1implementation.html">implementation</a></li>
<li class="footer">Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1 </li>
</ul>
</div>
</body>
</html>