Skip to content

Commit

Permalink
intrusive_ptr MutableControlBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
vitamin committed Jul 29, 2021
1 parent 8bb0e60 commit c7bd9bb
Show file tree
Hide file tree
Showing 12 changed files with 312 additions and 94 deletions.
11 changes: 11 additions & 0 deletions docs/autoptr/common.html
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,17 @@ <h2>Manifest constants</h2>
<td>
</td>
<td>Return number of ControlBlocks in type <code class="lang-d"><span class="typ">Type</span></code>.
</td>
</tr>
<tr>
<td>
<a id="isMutableControlBlock" class="public" href="../autoptr/common/isMutableControlBlock.html">
<code>isMutableControlBlock</code>
</a>
</td>
<td>
</td>
<td>Check if type <code class="lang-d"><span class="pln">T</span></code> is of type <code class="lang-d"><a href="../autoptr/common/ControlBlock.html"><span class="typ">ControlBlock</span></a><span class="pun">!(...)</span></code>.
</td>
</tr>
</table>
Expand Down
98 changes: 98 additions & 0 deletions docs/autoptr/common/isMutableControlBlock.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,98 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>Enum member isMutableControlBlock</title>
<link rel="stylesheet" type="text/css" href="../../styles/ddox.css"/>
<link rel="stylesheet" href="../../prettify/prettify.css" type="text/css"/>
<script type="text/javascript" src="../../scripts/jquery.js">/**/</script><script type="text/javascript" src="../../scripts/ddox.js">/**/</script>
</head>
<body onload="setupDdox();">
<nav id="main-nav">
<noscript>
<p style="color: red">The search functionality needs JavaScript enabled</p>
</noscript>
<div id="symbolSearchPane" style="display: none">
<form action="#" method="GET">
<input id="symbolSearch" type="text" name="q" placeholder="Search for symbols" autocomplete="off" onchange="performSymbolSearch(40);" onkeypress="this.onchange();" onpaste="this.onchange();" oninput="this.onchange();"/>
</form>
<ul id="symbolSearchResults" class="symbolList" style="display: none"></ul><script type="application/javascript" src="../../symbols.js"></script><script type="application/javascript">var symbolSearchRootDir = "../../";
$('#symbolSearchPane').show();</script>
</div>
<ul class="tree-view">
<li class="tree-view ">
<div class="package ">autoptr
</div>
<ul class="tree-view">
<li>
<div class="module selected">
<a href="../../autoptr/common.html">common</a>
</div>
</li>
<li>
<div class="module ">
<a href="../../autoptr/intrusive_ptr.html">intrusive_ptr</a>
</div>
</li>
<li>
<div class="module ">
<a href="../../autoptr/rc_ptr.html">rc_ptr</a>
</div>
</li>
<li>
<div class="module ">
<a href="../../autoptr/shared_ptr.html">shared_ptr</a>
</div>
</li>
<li>
<div class="module ">
<a href="../../autoptr/unique_ptr.html">unique_ptr</a>
</div>
</li>
</ul>
</li>
</ul>
</nav>
<div id="main-contents">
<h1>Enum member isMutableControlBlock</h1><p>Check if type <code class="lang-d"><span class="pln">T</span></code> is of type <code class="lang-d"><a href="../../autoptr/common/ControlBlock.html"><span class="typ">ControlBlock</span></a><span class="pun">!(...)</span></code>.
</p>
<div class="prototype">
<code class="lang-d">
<div class="single-prototype">
<span class="kwd">enum</span> <span class="pln">isMutableControlBlock</span>(T...)
<span class="pun">=</span> <span class="kwd">is</span><span class="pun">(</span><span class="typ">Unqual</span><span class="pun">!(</span><span class="pln">T</span><span class="pun">[</span><span class="lit">0</span><span class="pun">]) == </span><span class="typ">MutableControlBlock</span><span class="pun">!</span><span class="typ">Args</span><span class="pun">, </span><span class="typ">Args</span><span class="pun">...)</span><span class="pun">;</span>
</div>
</code>
</div>


<footer>
<table class="license-info">
<tr>
<th>Authors</th>
<td>
<p>github.com/submada/basic_string, Adam Búš
</p>

</td>
</tr>
<tr>
<th>Copyright</th>
<td>

</td>
</tr>
<tr>
<th>License</th>
<td>
<p>www.boost.org/LICENSE_1_0.txt, Boost License 1.0.
</p>

</td>
</tr>
</table>
<p class="faint">Generated using the DDOX documentation generator</p>
</footer>
</div>
</body>
</html>
2 changes: 1 addition & 1 deletion docs/autoptr/intrusive_ptr.html
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ <h2>Aliases</h2>
</a>
</td>
<td>
<code class="prettyprint lang-d"><a href="../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,_mutableControl,false)</code>
<code class="prettyprint lang-d"><a href="../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,false)</code>
</td>
<td><code class="lang-d"><span class="typ">IntrusivePtr</span></code> is a smart pointer that retains shared ownership of an object through a pointer.
</td>
Expand Down
2 changes: 1 addition & 1 deletion docs/autoptr/intrusive_ptr/IntrusivePtr.SharedType.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h1>Alias IntrusivePtr.SharedType</h1><p>Type of non weak ptr (must have weak co
&nbsp;&nbsp;<span class="com">// ...</span>
<br/>
&nbsp;&nbsp;<span class="kwd">alias</span> <span class="pln">SharedType</span>
<span class="pun">=</span> <a href="../../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,_mutableControl,false)<span class="pun">;</span>
<span class="pun">=</span> <a href="../../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,false)<span class="pun">;</span>
<br/>
&nbsp;&nbsp;<span class="com">// ...</span>
<br/>
Expand Down
2 changes: 1 addition & 1 deletion docs/autoptr/intrusive_ptr/IntrusivePtr.WeakType.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ <h1>Alias IntrusivePtr.WeakType</h1><p>Weak pointer
&nbsp;&nbsp;<span class="com">// ...</span>
<br/>
&nbsp;&nbsp;<span class="kwd">alias</span> <span class="pln">WeakType</span>
<span class="pun">=</span> <a href="../../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,_mutableControl,true)<span class="pun">;</span>
<span class="pun">=</span> <a href="../../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,true)<span class="pun">;</span>
<br/>
&nbsp;&nbsp;<span class="com">// ...</span>
<br/>
Expand Down
10 changes: 2 additions & 8 deletions docs/autoptr/intrusive_ptr/IntrusivePtr.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,15 @@ <h1>Struct IntrusivePtr</h1><p><code class="lang-d"><span class="typ">IntrusiveP
<div class="prototype">
<code class="lang-d">
<div class="single-prototype">
<span class="kwd">struct</span> <span class="typ">IntrusivePtr</span>(_Type, _DestructorType, <span class="typ">bool</span> _mutableControl<span class="pln"> </span><span class="pun">= </span><span class="kwd">false</span>, <span class="typ">bool</span> _weakPtr<span class="pln"> </span><span class="pun">= </span><span class="kwd">false</span>)
<span class="kwd">struct</span> <span class="typ">IntrusivePtr</span>(_Type, _DestructorType, <span class="typ">bool</span> _weakPtr<span class="pln"> </span><span class="pun">= </span><span class="kwd">false</span>)
<br/>
&nbsp;&nbsp;
<br/>
<span class="kwd">if</span> <span class="pun">(</span><span class="pln">isIntrusive</span><span class="pun">!</span><span class="pln">_Type </span><span class="pun">&amp;&amp; </span><span class="pln">isDestructorType</span><span class="pun">!</span><span class="pln">_DestructorType</span><span class="pun">);</span>
</div>
<div class="single-prototype">
<span class="kwd">alias</span> <span class="pln">IntrusivePtr</span>(_Type, <span class="typ">bool</span> _mutableControl, _DestructorType)
<span class="pun">=</span> <a href="../../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,_mutableControl,false)<span class="pun">;</span>
<span class="pun">=</span> <a href="../../autoptr/intrusive_ptr/IntrusivePtr.html"><span class="typ">IntrusivePtr</span></a>!(_Type,_DestructorType,false)<span class="pun">;</span>
</div>
</code>
</div>
Expand Down Expand Up @@ -99,9 +99,6 @@ <h1>Struct IntrusivePtr</h1><p><code class="lang-d"><span class="typ">IntrusiveP
<p> If <code class="lang-d"><span class="pln">_Type</span></code> is const/immutable then ControlBlock cannot be modified =&gt; ref counting doesn't work and <code class="lang-d"><span class="typ">IntrusivePtr</span></code> can be only moved.
</p>

<p> If parameter <code class="lang-d"><span class="pln">_mutableControl</span></code> is <code class="lang-d"><span class="kwd">true</span></code> then <code class="lang-d"><span class="kwd">const</span></code>/<code class="lang-d"><span class="kwd">immutable</span></code> qualifiers for intrusive control block in managed objects are ignored.
</p>

<p> If multiple threads of execution access the same <code class="lang-d"><span class="typ">IntrusivePtr</span></code> (<code class="lang-d"><span class="kwd">shared </span><span class="typ">IntrusivePtr</span></code>) then only some methods can be called (<code class="lang-d"><a href="../../autoptr/intrusive_ptr/IntrusivePtr.load.html"><span class="pln">load</span></a></code>, <code class="lang-d"><a href="../../autoptr/intrusive_ptr/IntrusivePtr.store.html"><span class="pln">store</span></a></code>, <code class="lang-d"><a href="../../autoptr/intrusive_ptr/IntrusivePtr.exchange.html"><span class="pln">exchange</span></a></code>, <code class="lang-d"><span class="pln">compareExchange</span></code>, <code class="lang-d"><a href="../../autoptr/intrusive_ptr/IntrusivePtr.useCount.html"><span class="pln">useCount</span></a></code>).
</p>

Expand All @@ -114,9 +111,6 @@ <h1>Struct IntrusivePtr</h1><p><code class="lang-d"><span class="typ">IntrusiveP
<p> <code class="lang-d"><span class="pln">_DestructorType</span></code> function pointer with attributes of destructor, to get attributes of destructor from type use <code class="lang-d"><a href="../../autoptr/common/DestructorType.html" title="autoptr.common.DestructorType"><span class="typ">DestructorType</span></a><span class="pun">!</span><span class="pln">T</span></code>. Destructor of type <code class="lang-d"><span class="pln">_Type</span></code> must be compatible with <code class="lang-d"><span class="pln">_DestructorType</span></code>
</p>

<p> <code class="lang-d"><span class="pln">_mutableControl</span></code> allow modify <code class="lang-d"><span class="kwd">const</span></code> / <code class="lang-d"><span class="kwd">immutable</span></code> intrusive control block
</p>

<p> <code class="lang-d"><span class="pln">_weakPtr</span></code> if <code class="lang-d"><span class="kwd">true</span></code> then <code class="lang-d"><span class="typ">IntrusivePtr</span></code> represent weak ptr
</p>
</section>
Expand Down
4 changes: 2 additions & 2 deletions docs/autoptr/intrusive_ptr/IntrusivePtr.mutableControl.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
</ul>
</nav>
<div id="main-contents">
<h1>Enum member IntrusivePtr.mutableControl</h1><p>TODO
<h1>Enum member IntrusivePtr.mutableControl</h1><p><code class="lang-d"><span class="kwd">true</span></code> if <code class="lang-d"><a href="../../autoptr/intrusive_ptr/IntrusivePtr.ElementType.html"><span class="typ">ElementType</span></a></code> has mutable intrusive control block even if <code class="lang-d"><a href="../../autoptr/intrusive_ptr/IntrusivePtr.ElementType.html"><span class="typ">ElementType</span></a></code> is <code class="lang-d"><span class="kwd">const</span></code>/<code class="lang-d"><span class="kwd">immutable</span></code>.
</p>
<div class="prototype">
<code class="lang-d">
Expand All @@ -68,7 +68,7 @@ <h1>Enum member IntrusivePtr.mutableControl</h1><p>TODO
&nbsp;&nbsp;<span class="com">// ...</span>
<br/>
&nbsp;&nbsp;<span class="kwd">enum</span> <span class="pln">mutableControl</span>
<span class="pun">=</span> <span class="pln">_mutableControl</span><span class="pun">;</span>
<span class="pun">=</span> <span class="pln">isMutable</span><span class="pun">!(</span><span class="typ">IntrusivControlBlock</span><span class="pun">!(</span><span class="kwd">const</span><span class="pun">(</span><span class="typ">ElementType</span><span class="pun">)))</span><span class="pun">;</span>
<br/>
&nbsp;&nbsp;<span class="com">// ...</span>
<br/>
Expand Down
Loading

0 comments on commit c7bd9bb

Please sign in to comment.