-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit bc2d2f5
Showing
856 changed files
with
104,192 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,154 @@ | ||
<!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" lang="en-US"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> | ||
<meta http-equiv="X-UA-Compatible" content="IE=11"/> | ||
<meta name="generator" content="Doxygen 1.9.8"/> | ||
<meta name="viewport" content="width=device-width, initial-scale=1"/> | ||
<title>Topaz: src/tz/core/memory/allocators/adapter.hpp Source File</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> | ||
<script type="text/javascript"> | ||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ | ||
$(document).ready(function() { init_search(); }); | ||
/* @license-end */ | ||
</script> | ||
<link href="doxygen.css" rel="stylesheet" type="text/css" /> | ||
<link href="doxygen-awesome.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 id="projectrow"> | ||
<td id="projectlogo"><img alt="Logo" src="tz.png"/></td> | ||
<td id="projectalign"> | ||
<div id="projectname">Topaz<span id="projectnumber"> 4.1.0.2</span> | ||
</div> | ||
<div id="projectbrief">C++20 Graphics Engine</div> | ||
</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
<!-- end header part --> | ||
<!-- Generated by Doxygen 1.9.8 --> | ||
<script type="text/javascript"> | ||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ | ||
var searchBox = new SearchBox("searchBox", "search/",'.html'); | ||
/* @license-end */ | ||
</script> | ||
<div id="navrow1" class="tabs"> | ||
<ul class="tablist"> | ||
<li><a href="index.html"><span>Topaz Home</span></a></li> | ||
<li><a href="group__tz__cpp.html"><span>C++ API</span></a></li> | ||
<li><a href="tz_lua.html"><span>Lua API</span></a></li> | ||
<li><a href="group__tzsl.html"><span>TZSL API</span></a></li> | ||
<li><a href="https://github.com/harrand/Topaz/wiki"><span>Wiki</span></a></li> | ||
<li> | ||
<div id="MSearchBox" class="MSearchBoxInactive"> | ||
<span class="left"> | ||
<span id="MSearchSelect" onmouseover="return searchBox.OnSearchSelectShow()" onmouseout="return searchBox.OnSearchSelectHide()"> </span> | ||
<input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S" | ||
onfocus="searchBox.OnSearchFieldFocus(true)" | ||
onblur="searchBox.OnSearchFieldFocus(false)" | ||
onkeyup="searchBox.OnSearchFieldChange(event)"/> | ||
</span><span class="right"> | ||
<a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a> | ||
</span> | ||
</div> | ||
</li> | ||
</ul> | ||
</div> | ||
<script type="text/javascript"> | ||
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&dn=expat.txt MIT */ | ||
$(document).ready(function() { init_codefold(0); }); | ||
/* @license-end */ | ||
</script> | ||
<!-- 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"> | ||
<div id="MSearchResults"> | ||
<div class="SRPage"> | ||
<div id="SRIndex"> | ||
<div id="SRResults"></div> | ||
<div class="SRStatus" id="Loading">Loading...</div> | ||
<div class="SRStatus" id="Searching">Searching...</div> | ||
<div class="SRStatus" id="NoMatches">No Matches</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<div id="nav-path" class="navpath"> | ||
<ul> | ||
<li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_173d7eb180c4d4693124e94b33941768.html">tz</a></li><li class="navelem"><a class="el" href="dir_08a9ab9f761476898a1bf8c3b193f50f.html">core</a></li><li class="navelem"><a class="el" href="dir_d2650608e6952a9513fd80a851d6a394.html">memory</a></li><li class="navelem"><a class="el" href="dir_7122b68cae0d86e82e150514ab755870.html">allocators</a></li> </ul> | ||
</div> | ||
</div><!-- top --> | ||
<div class="header"> | ||
<div class="headertitle"><div class="title">adapter.hpp</div></div> | ||
</div><!--header--> | ||
<div class="contents"> | ||
<div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span><span class="preprocessor">#ifndef TOPAZ_CORE_ALLOCATORS_ADAPTER_HPP</span></div> | ||
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno"> 2</span><span class="preprocessor">#define TOPAZ_CORE_ALLOCATORS_ADAPTER_HPP</span></div> | ||
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno"> 3</span><span class="preprocessor">#include "tz/core/memory/memblk.hpp"</span></div> | ||
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno"> 4</span><span class="preprocessor">#include "tz/core/types.hpp"</span></div> | ||
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno"> 5</span><span class="preprocessor">#include "tz/core/debug.hpp"</span></div> | ||
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno"> 6</span> </div> | ||
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno"> 7</span><span class="keyword">namespace </span>tz</div> | ||
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno"> 8</span>{</div> | ||
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span> <span class="keyword">template</span><<span class="keyword">typename</span> T, tz::allocator A></div> | ||
<div class="foldopen" id="foldopen00017" data-start="{" data-end="};"> | ||
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"><a class="line" href="classtz_1_1allocator__adapter.html"> 17</a></span> <span class="keyword">class </span><a class="code hl_class" href="classtz_1_1allocator__adapter.html">allocator_adapter</a> : <span class="keyword">private</span> A</div> | ||
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> {</div> | ||
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span> <span class="keyword">public</span>:</div> | ||
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span> <span class="keyword">using </span>value_type = T;</div> | ||
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span> <span class="keyword">using </span>size_type = std::size_t;</div> | ||
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> <span class="keyword">using </span>difference_type = std::ptrdiff_t;</div> | ||
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> <span class="keyword">using </span>propagate_on_container_move_assignment = std::true_type;</div> | ||
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span> </div> | ||
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span> <a class="code hl_class" href="classtz_1_1allocator__adapter.html">allocator_adapter</a>() = <span class="keywordflow">default</span>;</div> | ||
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span> <a class="code hl_class" href="classtz_1_1allocator__adapter.html">allocator_adapter</a>(<span class="keyword">const</span> A& a):</div> | ||
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span> A(a){}</div> | ||
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div> | ||
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"> 29</span> <span class="keyword">template</span><<span class="keyword">class</span> U></div> | ||
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"> 30</span> <a class="code hl_class" href="classtz_1_1allocator__adapter.html">allocator_adapter</a>(<span class="keyword">const</span> <a class="code hl_class" href="classtz_1_1allocator__adapter.html">allocator_adapter<U, A></a>& other){}</div> | ||
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"> 31</span> </div> | ||
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span> T* allocate(std::size_t n)</div> | ||
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span> {</div> | ||
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> <a class="code hl_struct" href="structtz_1_1memblk.html">tz::memblk</a> blk = A::allocate(n * <span class="keyword">sizeof</span>(T));</div> | ||
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno"> 35</span> <a class="code hl_function" href="group__tz__core.html#ga35faea66fc04dfa33238c863eb740c34">tz::assert</a>(blk != nullblk, <span class="stringliteral">"allocator_adapter -- The underlying tz allocator returned a null-block. Memory allocation failed. The standard library allocator is going to crash."</span>);</div> | ||
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno"> 36</span> <span class="keywordflow">return</span> <span class="keyword">reinterpret_cast<</span>T*<span class="keyword">></span>(blk.<a class="code hl_variable" href="structtz_1_1memblk.html#a1fbc7ecd17b8e88fafd516f747371d5d">ptr</a>);</div> | ||
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno"> 37</span> }</div> | ||
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno"> 38</span> </div> | ||
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"> 39</span> <span class="keywordtype">void</span> deallocate(T* p, std::size_t n)</div> | ||
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span> {</div> | ||
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"> 41</span> A::deallocate({.ptr = p, .size = n});</div> | ||
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"> 42</span> }</div> | ||
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"> 43</span> };</div> | ||
</div> | ||
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"> 44</span>}</div> | ||
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div> | ||
<div class="line"><a id="l00046" name="l00046"></a><span class="lineno"> 46</span><span class="preprocessor">#endif </span><span class="comment">// TOPAZ_CORE_ALLOCATORS_ADAPTER_HPP</span></div> | ||
<div class="ttc" id="aclasstz_1_1allocator__adapter_html"><div class="ttname"><a href="classtz_1_1allocator__adapter.html">tz::allocator_adapter</a></div><div class="ttdoc">A meta-allocator which allows a tz allocator to be used as if it were a std::allocator.</div><div class="ttdef"><b>Definition</b> adapter.hpp:18</div></div> | ||
<div class="ttc" id="agroup__tz__core_html_ga35faea66fc04dfa33238c863eb740c34"><div class="ttname"><a href="group__tz__core.html#ga35faea66fc04dfa33238c863eb740c34">tz::assert</a></div><div class="ttdeci">void assert(bool condition, detail::format_string fmt="<No message>", Args &&... args)</div><div class="ttdoc">Assert on a condition.</div><div class="ttdef"><b>Definition</b> debug.inl:33</div></div> | ||
<div class="ttc" id="astructtz_1_1memblk_html"><div class="ttname"><a href="structtz_1_1memblk.html">tz::memblk</a></div><div class="ttdoc">A non-owning, contiguous block of memory.</div><div class="ttdef"><b>Definition</b> memblk.hpp:12</div></div> | ||
<div class="ttc" id="astructtz_1_1memblk_html_a1fbc7ecd17b8e88fafd516f747371d5d"><div class="ttname"><a href="structtz_1_1memblk.html#a1fbc7ecd17b8e88fafd516f747371d5d">tz::memblk::ptr</a></div><div class="ttdeci">void * ptr</div><div class="ttdoc">Start address of the block.</div><div class="ttdef"><b>Definition</b> memblk.hpp:14</div></div> | ||
</div><!-- fragment --></div><!-- contents --> | ||
<!-- start footer part --> | ||
<hr class="footer"/><address class="footer"><small> | ||
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.8 | ||
</small></address> | ||
</body> | ||
</html> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.