1 Star 0 Fork 0

mobangjack / memory

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
classfoonathan_1_1memory_1_1reference__storage.html 15.40 KB
一键复制 编辑 原始数据 按行查看 历史
Jonathan Müller 提交于 2020-05-05 17:04 . Update documentation
<!-- HTML header for doxygen 1.8.16-->
<!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>memory: reference_storage&lt; RawAllocator &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="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">memory
</div>
</td>
</tr>
</tbody>
</table>
</div>
<div id="main-nav">
<ul class="sm sm-dox" id="main-menu">
<li><a href="index.html">Main Page</a></li>
<li><a href="md_doc_tutorial.html">Tutorial</a></li>
<li><a href="namespacefoonathan_1_1memory.html">Index</a></li>
<li><a href="files.html">Files</a></li>
</ul>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.18 -->
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacefoonathan.html">foonathan</a></li><li class="navelem"><a class="el" href="namespacefoonathan_1_1memory.html">memory</a></li><li class="navelem"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-types">Typedefs</a> &#124;
<a href="#pub-methods">Member Functions</a> </div>
<div class="headertitle">
<div class="title">reference_storage&lt; RawAllocator &gt; Class Template Reference<div class="ingroups"><a class="el" href="group__storage.html">Allocator storage</a></div></div> </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;class RawAllocator&gt;<br />
class foonathan::memory::reference_storage&lt; RawAllocator &gt;</h3>
<p>A <a href="md_doc_concepts.html#concept_storagepolicy">StoragePolicy</a> that stores a reference to an allocator. </p>
<p>For stateful allocators it only stores a pointer to an allocator object and copying/moving only copies the pointer. For stateless allocators it does not store anything, an allocator will be constructed as needed. For allocators that are already shared (determined through <a class="el" href="structfoonathan_1_1memory_1_1is__shared__allocator.html">is_shared_allocator</a>) it will store the allocator type directly. </p><dl class="section note"><dt>Note</dt><dd>It does not take ownership over the allocator in the stateful case, the user has to ensure that the allocator object stays valid. In the other cases the lifetime does not matter. </dd></dl>
</div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Typedefs</h2></td></tr>
<tr class="memitem:a822c89378d2400636a878d6e43ea066e"><td class="memItemLeft" align="right" valign="top"><a id="a822c89378d2400636a878d6e43ea066e"></a>
using&#160;</td><td class="memItemRight" valign="bottom"><b>allocator_type</b> = typename <a class="el" href="classfoonathan_1_1memory_1_1allocator__traits.html">allocator_traits</a>&lt; RawAllocator &gt;::allocator_type</td></tr>
<tr class="separator:a822c89378d2400636a878d6e43ea066e"><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>
Member Functions</h2></td></tr>
<tr class="memitem:aa4d78cedf879eacbb2956c3e54e62c8d"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#aa4d78cedf879eacbb2956c3e54e62c8d">reference_storage</a> () noexcept=default</td></tr>
<tr class="memdesc:aa4d78cedf879eacbb2956c3e54e62c8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor. <a href="classfoonathan_1_1memory_1_1reference__storage.html#aa4d78cedf879eacbb2956c3e54e62c8d">More...</a><br /></td></tr>
<tr class="separator:aa4d78cedf879eacbb2956c3e54e62c8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abc9082c55180c91a3f9b762ce7b6a9c6"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#abc9082c55180c91a3f9b762ce7b6a9c6">reference_storage</a> (const allocator_type &amp;alloc) noexcept</td></tr>
<tr class="separator:abc9082c55180c91a3f9b762ce7b6a9c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:addc2fea0bd7cde7b4781f47b217defaf"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#addc2fea0bd7cde7b4781f47b217defaf">reference_storage</a> (allocator_type &amp;alloc) noexcept</td></tr>
<tr class="separator:addc2fea0bd7cde7b4781f47b217defaf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a420e60e9788bfa3b52aa3aab72ea3a5e"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#a420e60e9788bfa3b52aa3aab72ea3a5e">operator bool</a> () const noexcept</td></tr>
<tr class="separator:a420e60e9788bfa3b52aa3aab72ea3a5e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a63c2ce62648bfde50384f249c4d77cf5"><td class="memItemLeft" align="right" valign="top">allocator_type &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#a63c2ce62648bfde50384f249c4d77cf5">get_allocator</a> () const noexcept</td></tr>
<tr class="separator:a63c2ce62648bfde50384f249c4d77cf5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr><td colspan="2"><div class="groupHeader"></div></td></tr>
<tr class="memitem:aaff3b70fb06a4132e91c5f7e3e3931c0"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#aaff3b70fb06a4132e91c5f7e3e3931c0">reference_storage</a> (const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &amp;) noexcept=default</td></tr>
<tr class="separator:aaff3b70fb06a4132e91c5f7e3e3931c0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8057733ed13a54a708f9e9806d8b401d"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html#a8057733ed13a54a708f9e9806d8b401d">operator=</a> (const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> &amp;) noexcept=default</td></tr>
<tr class="separator:a8057733ed13a54a708f9e9806d8b401d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Constructors</h2>
<a id="aa4d78cedf879eacbb2956c3e54e62c8d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa4d78cedf879eacbb2956c3e54e62c8d">&#9670;&nbsp;</a></span>reference_storage() <span class="overload">[1/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Default constructor. </p>
<dl class="section user"><dt>Effects:</dt><dd>If the allocator is stateless, this has no effect and the object is usable as an allocator. If the allocator is stateful, creates an invalid reference without any associated allocator. Then it must not be used. If the allocator is shared, default constructs the shared allocator. If the shared allocator does not have a default constructor, this constructor is ill-formed. </dd></dl>
</div>
</div>
<a id="abc9082c55180c91a3f9b762ce7b6a9c6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abc9082c55180c91a3f9b762ce7b6a9c6">&#9670;&nbsp;</a></span>reference_storage() <span class="overload">[2/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramtype">const allocator_type &amp;&#160;</td>
<td class="paramname"><em>alloc</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Creates it from a stateless or shared allocator. It will not store anything, only creates the allocator as needed. </dd></dl>
<dl class="section user"><dt>Requires:</dt><dd>The <code>RawAllocator</code> is stateless or shared. </dd></dl>
</div>
</div>
<a id="addc2fea0bd7cde7b4781f47b217defaf"></a>
<h2 class="memtitle"><span class="permalink"><a href="#addc2fea0bd7cde7b4781f47b217defaf">&#9670;&nbsp;</a></span>reference_storage() <span class="overload">[3/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramtype">allocator_type &amp;&#160;</td>
<td class="paramname"><em>alloc</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Creates it from a reference to a stateful allocator. It will store a pointer to this allocator object. </dd></dl>
<dl class="section note"><dt>Note</dt><dd>The user has to take care that the lifetime of the reference does not exceed the allocator lifetime. </dd></dl>
</div>
</div>
<a id="aaff3b70fb06a4132e91c5f7e3e3931c0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaff3b70fb06a4132e91c5f7e3e3931c0">&#9670;&nbsp;</a></span>reference_storage() <span class="overload">[4/4]</span></h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a> </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a>&lt; RawAllocator &gt; &amp;&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Copies the <code>allocator_reference</code> object. Only copies the pointer to it in the stateful case. </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Functions</h2>
<a id="a8057733ed13a54a708f9e9806d8b401d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8057733ed13a54a708f9e9806d8b401d">&#9670;&nbsp;</a></span>operator=()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname"><a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a>&amp; operator= </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classfoonathan_1_1memory_1_1reference__storage.html">reference_storage</a>&lt; RawAllocator &gt; &amp;&#160;</td>
<td class="paramname"></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">default</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Effects:</dt><dd>Copies the <code>allocator_reference</code> object. Only copies the pointer to it in the stateful case. </dd></dl>
</div>
</div>
<a id="a420e60e9788bfa3b52aa3aab72ea3a5e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a420e60e9788bfa3b52aa3aab72ea3a5e">&#9670;&nbsp;</a></span>operator bool()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">operator bool </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">explicit</span><span class="mlabel">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>Whether or not the reference is valid. It is only invalid, if it was created by the default constructor and the allocator is stateful. </dd></dl>
</div>
</div>
<a id="a63c2ce62648bfde50384f249c4d77cf5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a63c2ce62648bfde50384f249c4d77cf5">&#9670;&nbsp;</a></span>get_allocator()</h2>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">allocator_type&amp; get_allocator </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">noexcept</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<dl class="section user"><dt>Returns:</dt><dd>Returns a reference to the allocator. </dd></dl>
<dl class="section user"><dt>Requires:</dt><dd>The reference must be valid. </dd></dl>
</div>
</div>
</div><!-- contents -->
<!-- HTML footer for doxygen 1.8.16-->
<!-- 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>
1
https://gitee.com/mobangjack/memory.git
git@gitee.com:mobangjack/memory.git
mobangjack
memory
memory
gh-pages

搜索帮助