blob: a900cbf2c94cf2281d3bf268ad401b1bc33a191b [file] [log] [blame]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://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.14"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Crashpad: crashpad::CheckedRange&lt; ValueType, SizeType &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.14 -->
<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_1CheckedRange.html">CheckedRange</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classcrashpad_1_1CheckedRange-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">crashpad::CheckedRange&lt; ValueType, SizeType &gt; Class Template Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Ensures that a range, composed of a base and size, does not overflow its data type.
<a href="classcrashpad_1_1CheckedRange.html#details">More...</a></p>
<p><code>#include &quot;util/numeric/checked_range.h&quot;</code></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:ae41dee37e05c348351d147665a876752"><td class="memItemLeft" align="right" valign="top"><a id="ae41dee37e05c348351d147665a876752"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>CheckedRange</b> (ValueType <a class="el" href="classcrashpad_1_1CheckedRange.html#a341469d31eeb59dcefd60c10ee3a57fe">base</a>, SizeType <a class="el" href="classcrashpad_1_1CheckedRange.html#a185760aec935f2274f223107c3cd2944">size</a>)</td></tr>
<tr class="separator:ae41dee37e05c348351d147665a876752"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8656cee91c06baef01d6a0cfb0d03996"><td class="memItemLeft" align="right" valign="top"><a id="a8656cee91c06baef01d6a0cfb0d03996"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#a8656cee91c06baef01d6a0cfb0d03996">SetRange</a> (ValueType <a class="el" href="classcrashpad_1_1CheckedRange.html#a341469d31eeb59dcefd60c10ee3a57fe">base</a>, SizeType <a class="el" href="classcrashpad_1_1CheckedRange.html#a185760aec935f2274f223107c3cd2944">size</a>)</td></tr>
<tr class="memdesc:a8656cee91c06baef01d6a0cfb0d03996"><td class="mdescLeft">&#160;</td><td class="mdescRight">Sets the range’s base and size to <em>base</em> and <em>size</em>, respectively. <br /></td></tr>
<tr class="separator:a8656cee91c06baef01d6a0cfb0d03996"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a341469d31eeb59dcefd60c10ee3a57fe"><td class="memItemLeft" align="right" valign="top"><a id="a341469d31eeb59dcefd60c10ee3a57fe"></a>
ValueType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#a341469d31eeb59dcefd60c10ee3a57fe">base</a> () const</td></tr>
<tr class="memdesc:a341469d31eeb59dcefd60c10ee3a57fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">The range’s base. <br /></td></tr>
<tr class="separator:a341469d31eeb59dcefd60c10ee3a57fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a185760aec935f2274f223107c3cd2944"><td class="memItemLeft" align="right" valign="top"><a id="a185760aec935f2274f223107c3cd2944"></a>
SizeType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#a185760aec935f2274f223107c3cd2944">size</a> () const</td></tr>
<tr class="memdesc:a185760aec935f2274f223107c3cd2944"><td class="mdescLeft">&#160;</td><td class="mdescRight">The range’s size. <br /></td></tr>
<tr class="separator:a185760aec935f2274f223107c3cd2944"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa83d5d906d8fec629f6f36b26aa70d50"><td class="memItemLeft" align="right" valign="top"><a id="aa83d5d906d8fec629f6f36b26aa70d50"></a>
ValueType&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#aa83d5d906d8fec629f6f36b26aa70d50">end</a> () const</td></tr>
<tr class="memdesc:aa83d5d906d8fec629f6f36b26aa70d50"><td class="mdescLeft">&#160;</td><td class="mdescRight">The range’s end (its base plus its size). <br /></td></tr>
<tr class="separator:aa83d5d906d8fec629f6f36b26aa70d50"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9e047340710a211a2e1a1837a418ea24"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#a9e047340710a211a2e1a1837a418ea24">IsValid</a> () const</td></tr>
<tr class="memdesc:a9e047340710a211a2e1a1837a418ea24"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the validity of the range. <a href="#a9e047340710a211a2e1a1837a418ea24">More...</a><br /></td></tr>
<tr class="separator:a9e047340710a211a2e1a1837a418ea24"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a34a4bb80b92a18c52f698f43986d2220"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#a34a4bb80b92a18c52f698f43986d2220">ContainsValue</a> (ValueType value) const</td></tr>
<tr class="memdesc:a34a4bb80b92a18c52f698f43986d2220"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the range contains another value. <a href="#a34a4bb80b92a18c52f698f43986d2220">More...</a><br /></td></tr>
<tr class="separator:a34a4bb80b92a18c52f698f43986d2220"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa10ddb034043ac1c53a1d78d9c07db71"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#aa10ddb034043ac1c53a1d78d9c07db71">ContainsRange</a> (const <a class="el" href="classcrashpad_1_1CheckedRange.html">CheckedRange</a>&lt; ValueType, SizeType &gt; &amp;that) const</td></tr>
<tr class="memdesc:aa10ddb034043ac1c53a1d78d9c07db71"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the range contains another range. <a href="#aa10ddb034043ac1c53a1d78d9c07db71">More...</a><br /></td></tr>
<tr class="separator:aa10ddb034043ac1c53a1d78d9c07db71"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa0c87cac2cc7b9429b0005646c8dad0a"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcrashpad_1_1CheckedRange.html#aa0c87cac2cc7b9429b0005646c8dad0a">OverlapsRange</a> (const <a class="el" href="classcrashpad_1_1CheckedRange.html">CheckedRange</a>&lt; ValueType, SizeType &gt; &amp;that) const</td></tr>
<tr class="memdesc:aa0c87cac2cc7b9429b0005646c8dad0a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns whether the range overlaps another range. <a href="#aa0c87cac2cc7b9429b0005646c8dad0a">More...</a><br /></td></tr>
<tr class="separator:aa0c87cac2cc7b9429b0005646c8dad0a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c05b26033559ae24ac1bf62c75e9d09"><td class="memItemLeft" align="right" valign="top"><a id="a5c05b26033559ae24ac1bf62c75e9d09"></a>
bool&#160;</td><td class="memItemRight" valign="bottom"><b>operator&lt;</b> (const <a class="el" href="classcrashpad_1_1CheckedRange.html">CheckedRange</a> &amp;other) const</td></tr>
<tr class="separator:a5c05b26033559ae24ac1bf62c75e9d09"><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;typename ValueType, typename SizeType = ValueType&gt;<br />
class crashpad::CheckedRange&lt; ValueType, SizeType &gt;</h3>
<p>Ensures that a range, composed of a base and size, does not overflow its data type. </p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="aa10ddb034043ac1c53a1d78d9c07db71"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa10ddb034043ac1c53a1d78d9c07db71">&#9670;&nbsp;</a></span>ContainsRange()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ValueType, typename SizeType = ValueType&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classcrashpad_1_1CheckedRange.html">crashpad::CheckedRange</a>&lt; ValueType, SizeType &gt;::ContainsRange </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classcrashpad_1_1CheckedRange.html">CheckedRange</a>&lt; ValueType, SizeType &gt; &amp;&#160;</td>
<td class="paramname"><em>that</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>Returns whether the range contains another range. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">that</td><td>The (possibly) contained range.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if <code>this</code> range, the containing range, contains <em>that</em>, the contained range. <code>false</code> otherwise.</dd></dl>
<p>A range contains another range when the contained range’s base is greater than or equal to the containing range’s base, and the contained range’s end is less than or equal to the containing range’s end.</p>
<p>This method must only be called if <a class="el" href="classcrashpad_1_1CheckedRange.html#a9e047340710a211a2e1a1837a418ea24" title="Returns the validity of the range. ">IsValid()</a> would return <code>true</code> for both <a class="el" href="classcrashpad_1_1CheckedRange.html" title="Ensures that a range, composed of a base and size, does not overflow its data type. ">CheckedRange</a> objects involved. </p>
</div>
</div>
<a id="a34a4bb80b92a18c52f698f43986d2220"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a34a4bb80b92a18c52f698f43986d2220">&#9670;&nbsp;</a></span>ContainsValue()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ValueType, typename SizeType = ValueType&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classcrashpad_1_1CheckedRange.html">crashpad::CheckedRange</a>&lt; ValueType, SizeType &gt;::ContainsValue </td>
<td>(</td>
<td class="paramtype">ValueType&#160;</td>
<td class="paramname"><em>value</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>Returns whether the range contains another value. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">value</td><td>The (possibly) contained value.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the range contains <em>value</em>, <code>false</code> otherwise.</dd></dl>
<p>A range contains a value if the value is greater than or equal to its base, and less than its end (base plus size).</p>
<p>This method must only be called if <a class="el" href="classcrashpad_1_1CheckedRange.html#a9e047340710a211a2e1a1837a418ea24" title="Returns the validity of the range. ">IsValid()</a> would return <code>true</code>. </p>
</div>
</div>
<a id="a9e047340710a211a2e1a1837a418ea24"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9e047340710a211a2e1a1837a418ea24">&#9670;&nbsp;</a></span>IsValid()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ValueType, typename SizeType = ValueType&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classcrashpad_1_1CheckedRange.html">crashpad::CheckedRange</a>&lt; ValueType, SizeType &gt;::IsValid </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> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Returns the validity of the range. </p>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if the range is valid, <code>false</code> otherwise.</dd></dl>
<p>A range is valid if its size can be converted to the range’s data type without data loss, and if its end (base plus size) can be computed without overflowing its data type. </p>
</div>
</div>
<a id="aa0c87cac2cc7b9429b0005646c8dad0a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa0c87cac2cc7b9429b0005646c8dad0a">&#9670;&nbsp;</a></span>OverlapsRange()</h2>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename ValueType, typename SizeType = ValueType&gt; </div>
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">bool <a class="el" href="classcrashpad_1_1CheckedRange.html">crashpad::CheckedRange</a>&lt; ValueType, SizeType &gt;::OverlapsRange </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classcrashpad_1_1CheckedRange.html">CheckedRange</a>&lt; ValueType, SizeType &gt; &amp;&#160;</td>
<td class="paramname"><em>that</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>Returns whether the range overlaps another range. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">that</td><td>The (possibly) overlapping range.</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><code>true</code> if <code>this</code> range, the first range, overlaps <em>that</em>, the provided range. <code>false</code> otherwise.</dd></dl>
<p>Ranges are considered to be closed-open [base, end) for this test. Zero length ranges are never considered to overlap another range.</p>
<p>This method must only be called if <a class="el" href="classcrashpad_1_1CheckedRange.html#a9e047340710a211a2e1a1837a418ea24" title="Returns the validity of the range. ">IsValid()</a> would return <code>true</code> for both <a class="el" href="classcrashpad_1_1CheckedRange.html" title="Ensures that a range, composed of a base and size, does not overflow its data type. ">CheckedRange</a> objects involved. </p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>util/numeric/checked_range.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.14
</small></address>
</body>
</html>