blob: 2eabe6cc5328eb78f486635fd5a743920a63dd74 [file] [log] [blame]
<!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.8.18"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crashpad: crashpad::TSimpleStringDictionary&lt; KeySize, ValueSize, NumEntries &gt; Class Template 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="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="crashpad_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">Crashpad
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<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');
/* @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>
<!-- 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="namespacecrashpad.html">crashpad</a></li><li class="navelem"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html">TSimpleStringDictionary</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcrashpad_1_1TSimpleStringDictionary-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::TSimpleStringDictionary&lt; KeySize, ValueSize, NumEntries &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>A map/dictionary collection implementation using a fixed amount of storage, so that it does not perform any dynamic allocations for its operations.
<a href="classcrashpad_1_1TSimpleStringDictionary.html#details">More...</a></p>
<p><code>#include &quot;client/simple_string_dictionary.h&quot;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="structcrashpad_1_1TSimpleStringDictionary_1_1Entry.html">Entry</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">A single entry in the map. <a href="structcrashpad_1_1TSimpleStringDictionary_1_1Entry.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary_1_1Iterator.html">Iterator</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">An iterator to traverse all of the active entries in a <a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html" title="A map/dictionary collection implementation using a fixed amount of storage, so that it does not perfo...">TSimpleStringDictionary</a>. <a href="classcrashpad_1_1TSimpleStringDictionary_1_1Iterator.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><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:ac5434ad1d05fbe7959372e030ac66e49"><td class="memItemLeft" align="right" valign="top"><a id="ac5434ad1d05fbe7959372e030ac66e49"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>TSimpleStringDictionary</b> (const <a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html">TSimpleStringDictionary</a> &amp;other)</td></tr>
<tr class="separator:ac5434ad1d05fbe7959372e030ac66e49"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aed1ad111853dd30f04e192ee1aa9b4c3"><td class="memItemLeft" align="right" valign="top"><a id="aed1ad111853dd30f04e192ee1aa9b4c3"></a>
<a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html">TSimpleStringDictionary</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html">TSimpleStringDictionary</a> &amp;other)</td></tr>
<tr class="separator:aed1ad111853dd30f04e192ee1aa9b4c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a606dc2d68cdb216a2f4e364786f0390e"><td class="memItemLeft" align="right" valign="top"><a id="a606dc2d68cdb216a2f4e364786f0390e"></a>
size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html#a606dc2d68cdb216a2f4e364786f0390e">GetCount</a> () const</td></tr>
<tr class="memdesc:a606dc2d68cdb216a2f4e364786f0390e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of active key/value pairs. The upper limit for this is <em>NumEntries</em>. <br /></td></tr>
<tr class="separator:a606dc2d68cdb216a2f4e364786f0390e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8825b994344348fa88bca8ce8cd95e96"><td class="memItemLeft" align="right" valign="top">const char *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html#a8825b994344348fa88bca8ce8cd95e96">GetValueForKey</a> (base::StringPiece key) const</td></tr>
<tr class="memdesc:a8825b994344348fa88bca8ce8cd95e96"><td class="mdescLeft">&#160;</td><td class="mdescRight">Given <em>key</em>, returns its corresponding value. <a href="classcrashpad_1_1TSimpleStringDictionary.html#a8825b994344348fa88bca8ce8cd95e96">More...</a><br /></td></tr>
<tr class="separator:a8825b994344348fa88bca8ce8cd95e96"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ace17ad658c3504eabd4be00addf626a0"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html#ace17ad658c3504eabd4be00addf626a0">SetKeyValue</a> (base::StringPiece key, base::StringPiece value)</td></tr>
<tr class="memdesc:ace17ad658c3504eabd4be00addf626a0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stores <em>value</em> into <em>key</em>, replacing the existing value if <em>key</em> is already present. <a href="classcrashpad_1_1TSimpleStringDictionary.html#ace17ad658c3504eabd4be00addf626a0">More...</a><br /></td></tr>
<tr class="separator:ace17ad658c3504eabd4be00addf626a0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5947c58111c3d6a596de78c90a545e26"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html#a5947c58111c3d6a596de78c90a545e26">RemoveKey</a> (base::StringPiece key)</td></tr>
<tr class="memdesc:a5947c58111c3d6a596de78c90a545e26"><td class="mdescLeft">&#160;</td><td class="mdescRight">Removes <em>key</em> from the map. <a href="classcrashpad_1_1TSimpleStringDictionary.html#a5947c58111c3d6a596de78c90a545e26">More...</a><br /></td></tr>
<tr class="separator:a5947c58111c3d6a596de78c90a545e26"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-attribs"></a>
Static Public Attributes</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:acafb62dfc7bd68d9744124779b84a926"><td class="memItemLeft" align="right" valign="top"><a id="acafb62dfc7bd68d9744124779b84a926"></a>
static const size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html#acafb62dfc7bd68d9744124779b84a926">key_size</a> = KeySize</td></tr>
<tr class="memdesc:acafb62dfc7bd68d9744124779b84a926"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constant and publicly accessible versions of the template parameters. <br /></td></tr>
<tr class="separator:acafb62dfc7bd68d9744124779b84a926"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1176a981ba33d55f9b0a5f22e7fe4171"><td class="memItemLeft" align="right" valign="top"><a id="a1176a981ba33d55f9b0a5f22e7fe4171"></a>
static const size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html#a1176a981ba33d55f9b0a5f22e7fe4171">value_size</a> = ValueSize</td></tr>
<tr class="memdesc:a1176a981ba33d55f9b0a5f22e7fe4171"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constant and publicly accessible versions of the template parameters. <br /></td></tr>
<tr class="separator:a1176a981ba33d55f9b0a5f22e7fe4171"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7b3e25235f37f2ea7d0d05e37da6df13"><td class="memItemLeft" align="right" valign="top"><a id="a7b3e25235f37f2ea7d0d05e37da6df13"></a>
static const size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html#a7b3e25235f37f2ea7d0d05e37da6df13">num_entries</a> = NumEntries</td></tr>
<tr class="memdesc:a7b3e25235f37f2ea7d0d05e37da6df13"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constant and publicly accessible versions of the template parameters. <br /></td></tr>
<tr class="separator:a7b3e25235f37f2ea7d0d05e37da6df13"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;size_t KeySize = 256, size_t ValueSize = 256, size_t NumEntries = 64&gt;<br />
class crashpad::TSimpleStringDictionary&lt; KeySize, ValueSize, NumEntries &gt;</h3>
<p>A map/dictionary collection implementation using a fixed amount of storage, so that it does not perform any dynamic allocations for its operations. </p>
<p>The actual map storage (<a class="el" href="structcrashpad_1_1TSimpleStringDictionary_1_1Entry.html" title="A single entry in the map.">TSimpleStringDictionary::Entry</a>) is guaranteed to be POD, so that it can be transmitted over various IPC mechanisms.</p>
<p>The template parameters control the amount of storage used for the key, value, and map. The <em>KeySize</em> and <em>ValueSize</em> are measured in bytes, not glyphs, and include space for a trailing <code>NUL</code> byte. This gives space for <code>KeySize - 1</code> and <code>ValueSize - 1</code> characters in an entry. <em>NumEntries</em> is the total number of entries that will fit in the map. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="a8825b994344348fa88bca8ce8cd95e96"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8825b994344348fa88bca8ce8cd95e96">&#9670;&nbsp;</a></span>GetValueForKey()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t KeySize = 256, size_t ValueSize = 256, size_t NumEntries = 64&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">const char* <a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html">crashpad::TSimpleStringDictionary</a>&lt; KeySize, ValueSize, NumEntries &gt;::GetValueForKey </td>
<td>(</td>
<td class="paramtype">base::StringPiece&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Given <em>key</em>, returns its corresponding value. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>The key to look up. This must not be <code>nullptr</code>, nor an empty string. It must not contain embedded <code>NUL</code>s.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>The corresponding value for <em>key</em>, or if <em>key</em> is not found, <code>nullptr</code>. </dd></dl>
</div>
</div>
<a id="a5947c58111c3d6a596de78c90a545e26"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5947c58111c3d6a596de78c90a545e26">&#9670;&nbsp;</a></span>RemoveKey()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t KeySize = 256, size_t ValueSize = 256, size_t NumEntries = 64&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html">crashpad::TSimpleStringDictionary</a>&lt; KeySize, ValueSize, NumEntries &gt;::RemoveKey </td>
<td>(</td>
<td class="paramtype">base::StringPiece&#160;</td>
<td class="paramname"><em>key</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Removes <em>key</em> from the map. </p>
<p>If <em>key</em> is not found, this is a no-op.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>The key of the entry to remove. This must not be <code>nullptr</code>, nor an empty string. It must not contain embedded <code>NUL</code>s. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a id="ace17ad658c3504eabd4be00addf626a0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ace17ad658c3504eabd4be00addf626a0">&#9670;&nbsp;</a></span>SetKeyValue()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;size_t KeySize = 256, size_t ValueSize = 256, size_t NumEntries = 64&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">void <a class="el" href="classcrashpad_1_1TSimpleStringDictionary.html">crashpad::TSimpleStringDictionary</a>&lt; KeySize, ValueSize, NumEntries &gt;::SetKeyValue </td>
<td>(</td>
<td class="paramtype">base::StringPiece&#160;</td>
<td class="paramname"><em>key</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">base::StringPiece&#160;</td>
<td class="paramname"><em>value</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Stores <em>value</em> into <em>key</em>, replacing the existing value if <em>key</em> is already present. </p>
<p>If <em>key</em> is not yet in the map and the map is already full (containing <em>NumEntries</em> active entries), this operation silently fails.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">key</td><td>The key to store. This must not be <code>nullptr</code>, nor an empty string. It must not contain embedded <code>NUL</code>s. </td></tr>
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The value to store. If <code>nullptr</code>, <em>key</em> is removed from the map. Must not contain embedded <code>NUL</code>s. </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>client/simple_string_dictionary.h</li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.18
</small></address>
</body>
</html>