/usr/share/doc/libloki-doc/html/a00129.html is in libloki-doc 0.1.7-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
<title>Loki: Loki::SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.5.8 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li>
<form action="search.php" method="get">
<table cellspacing="0" cellpadding="0" border="0">
<tr>
<td><label> <u>S</u>earch for </label></td>
<td><input type="text" name="query" value="" size="20" accesskey="s"/></td>
</tr>
</table>
</form>
</li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="classes.html"><span>Class Index</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
<div class="navpath"><a class="el" href="a00192.html">Loki</a>::<a class="el" href="a00129.html">SmallObjectBase</a>
</div>
</div>
<div class="contents">
<h1>Loki::SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy > Class Template Reference<br>
<small>
[<a class="el" href="a00216.html">Small objects</a>]</small>
</h1><!-- doxytag: class="Loki::SmallObjectBase" --><code>#include <SmallObj.h></code>
<p>
<div class="dynheader">
Inheritance diagram for Loki::SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >:</div>
<div class="dynsection">
<center><font size="2">[<a target="top" href="graph_legend.html">legend</a>]</font></center></div>
<p>
<a href="a00399.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Types</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="a00002.html">AllocatorSingleton</a><br class="typebreak">
< ThreadingModel, chunkSize, <br class="typebreak">
maxSmallObjectSize, <br class="typebreak">
objectAlignSize, <br class="typebreak">
LifetimePolicy > </td><td class="memItemRight" valign="bottom"><a class="el" href="a00129.html#d07df1c9ec9c41580e07e32eddcda82d">ObjAllocatorSingleton</a></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="39f9c8d5b17c09bece34c8a400981970"></a><!-- doxytag: member="Loki::SmallObjectBase::operator new" ref="39f9c8d5b17c09bece34c8a400981970" args="(std::size_t size)" -->
static void * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00129.html#39f9c8d5b17c09bece34c8a400981970">operator new</a> (std::size_t size) throw ( std::bad_alloc )</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Throwing single-object new throws bad_alloc when allocation fails. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d212efa68b48292bf8fd2dd158b49400"></a><!-- doxytag: member="Loki::SmallObjectBase::operator new" ref="d212efa68b48292bf8fd2dd158b49400" args="(std::size_t size, const std::nothrow_t &)" -->
static void * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00129.html#d212efa68b48292bf8fd2dd158b49400">operator new</a> (std::size_t size, const std::nothrow_t &) throw ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Non-throwing single-object new returns NULL if allocation fails. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="dbbe1bde0960a38502af0940004d942f"></a><!-- doxytag: member="Loki::SmallObjectBase::operator new" ref="dbbe1bde0960a38502af0940004d942f" args="(std::size_t size, void *place)" -->
static void * </td><td class="memItemRight" valign="bottom"><a class="el" href="a00129.html#dbbe1bde0960a38502af0940004d942f">operator new</a> (std::size_t size, void *place)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Placement single-object new merely calls global placement new. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="698e8b9ebac9df8c03e557c842a59bc5"></a><!-- doxytag: member="Loki::SmallObjectBase::operator delete" ref="698e8b9ebac9df8c03e557c842a59bc5" args="(void *p, std::size_t size)" -->
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00129.html#698e8b9ebac9df8c03e557c842a59bc5">operator delete</a> (void *p, std::size_t size) throw ()</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Single-object delete. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00129.html#b835d84fa8bc1ed3a558dc2e7a7e39ec">operator delete</a> (void *p, const std::nothrow_t &) throw ()</td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e2da17da13c6c6a0d7e33c9df9eb27f2"></a><!-- doxytag: member="Loki::SmallObjectBase::operator delete" ref="e2da17da13c6c6a0d7e33c9df9eb27f2" args="(void *p, void *place)" -->
static void </td><td class="memItemRight" valign="bottom"><a class="el" href="a00129.html#e2da17da13c6c6a0d7e33c9df9eb27f2">operator delete</a> (void *p, void *place)</td></tr>
<tr><td class="mdescLeft"> </td><td class="mdescRight">Placement single-object delete merely calls global placement delete. <br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
<h3>template<template< class, class > class ThreadingModel, std::size_t chunkSize, std::size_t maxSmallObjectSize, std::size_t objectAlignSize, template< class > class LifetimePolicy, class MutexPolicy><br>
class Loki::SmallObjectBase< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy ></h3>
Base class for small object allocation classes. The shared implementation of the new and delete operators are here instead of being duplicated in both <a class="el" href="a00128.html">SmallObject</a> or <a class="el" href="a00130.html">SmallValueObject</a>, later just called Small-Objects. This class is not meant to be used directly by clients, or derived from by clients. Class has no data members so compilers can use Empty-Base-Optimization.<p>
<dl class="user" compact><dt><b>ThreadingModel</b></dt><dd>This class doesn't support ObjectLevelLockable policy for ThreadingModel. The allocator is a singleton, so a per-instance mutex is not necessary. Nor is using ObjectLevelLockable recommended with <a class="el" href="a00124.html">SingletonHolder</a> since the SingletonHolder::MakeInstance function requires a mutex that exists prior to when the object is created - which is not possible if the mutex is inside the object, such as required for ObjectLevelLockable. If you attempt to use ObjectLevelLockable, the compiler will emit errors because it can't use the default constructor in ObjectLevelLockable. If you need a thread-safe allocator, use the ClassLevelLockable policy.</dd></dl>
<dl class="user" compact><dt><b>Lifetime Policy</b></dt><dd></dd></dl>
The <a class="el" href="a00129.html">SmallObjectBase</a> template needs a lifetime policy because it owns a singleton of <a class="el" href="a00127.html">SmallObjAllocator</a> which does all the low level functions. When using a Small-Object in combination with the <a class="el" href="a00124.html">SingletonHolder</a> template you have to choose two lifetimes, that of the Small-Object and that of the singleton. The rule is: The Small-Object lifetime must be greater than the lifetime of the singleton hosting the Small-Object. Violating this rule results in a crash on exit, because the hosting singleton tries to delete the Small-Object which is then already destroyed.<p>
The lifetime policies recommended for use with Small-Objects hosted by a <a class="el" href="a00124.html">SingletonHolder</a> template are<ul>
<li><a class="el" href="a00046.html">LongevityLifetime::DieAsSmallObjectParent</a> / <a class="el" href="a00045.html">LongevityLifetime::DieAsSmallObjectChild</a></li><li><a class="el" href="a00125.html">SingletonWithLongevity</a></li><li><a class="el" href="a00057.html">FollowIntoDeath</a> (not supported by MSVC 7.1)</li><li><a class="el" href="a00089.html">NoDestroy</a></li></ul>
<p>
The default lifetime of Small-Objects is <a class="el" href="a00046.html">LongevityLifetime::DieAsSmallObjectParent</a> to insure that memory is not released before a object with the lifetime <a class="el" href="a00045.html">LongevityLifetime::DieAsSmallObjectChild</a> using that memory is destroyed. The <a class="el" href="a00046.html">LongevityLifetime::DieAsSmallObjectParent</a> lifetime has the highest possible value of a SetLongevity lifetime, so you can use it in combination with your own lifetime not having also the highest possible value.<p>
The <a class="el" href="a00037.html">DefaultLifetime</a> and <a class="el" href="a00097.html">PhoenixSingleton</a> policies are *not* recommended since they can cause the allocator to be destroyed and release memory for singletons hosting a object which inherit from either <a class="el" href="a00128.html">SmallObject</a> or <a class="el" href="a00130.html">SmallValueObject</a>.<p>
<dl class="user" compact><dt><b>Lifetime usage</b></dt><dd></dd></dl>
<ul>
<li><a class="el" href="a00196.html" title="In this namespace are special lifetime policies to manage lifetime dependencies.">LongevityLifetime</a>: The Small-Object has <a class="el" href="a00046.html">LongevityLifetime::DieAsSmallObjectParent</a> policy and the <a class="el" href="a00122.html">Singleton</a> hosting the Small-Object has <a class="el" href="a00045.html">LongevityLifetime::DieAsSmallObjectChild</a>. The child lifetime has a hard coded SetLongevity lifetime which is shorter than the lifetime of the parent, thus the child dies before the parent.</li></ul>
<p>
<ul>
<li>Both Small-Object and <a class="el" href="a00122.html">Singleton</a> use <a class="el" href="a00125.html">SingletonWithLongevity</a> policy. The longevity level for the singleton must be lower than that for the Small-Object. This is why the AllocatorSingleton's GetLongevity function returns the highest value.</li></ul>
<p>
<ul>
<li><a class="el" href="a00057.html">FollowIntoDeath</a> lifetime: The Small-Object has FollowIntoDeath::With<LIFETIME>::AsMasterLiftime policy and the <a class="el" href="a00122.html">Singleton</a> has FollowIntoDeath::AfterMaster<MASTERSINGLETON>::IsDestroyed policy, where you could choose the LIFETIME.</li></ul>
<p>
<ul>
<li>Both Small-Object and <a class="el" href="a00122.html">Singleton</a> use <a class="el" href="a00089.html">NoDestroy</a> policy. Since neither is ever destroyed, the destruction order does not matter. Note: you will get memory leaks!</li></ul>
<p>
<ul>
<li>The Small-Object has <a class="el" href="a00089.html">NoDestroy</a> policy but the <a class="el" href="a00122.html">Singleton</a> has <a class="el" href="a00125.html">SingletonWithLongevity</a> policy. Note: you will get memory leaks!</li></ul>
<p>
You should *not* use <a class="el" href="a00089.html">NoDestroy</a> for the singleton, and then use <a class="el" href="a00125.html">SingletonWithLongevity</a> for the Small-Object.<p>
<dl class="user" compact><dt><b>Examples:</b></dt><dd></dd></dl>
<ul>
<li>test/SmallObj/SmallSingleton.cpp</li><li>test/Singleton/Dependencies.cpp </li></ul>
<hr><h2>Member Typedef Documentation</h2>
<a class="anchor" name="d07df1c9ec9c41580e07e32eddcda82d"></a><!-- doxytag: member="Loki::SmallObjectBase::ObjAllocatorSingleton" ref="d07df1c9ec9c41580e07e32eddcda82d" args="" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<template< class, class > class ThreadingModel, std::size_t chunkSize, std::size_t maxSmallObjectSize, std::size_t objectAlignSize, template< class > class LifetimePolicy, class MutexPolicy> </div>
<table class="memname">
<tr>
<td class="memname">typedef <a class="el" href="a00002.html">AllocatorSingleton</a>< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy > <a class="el" href="a00129.html">Loki::SmallObjectBase</a>< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >::<a class="el" href="a00002.html">ObjAllocatorSingleton</a> </td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Defines type of allocator singleton, must be public to handle singleton lifetime dependencies.
</div>
</div><p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="b835d84fa8bc1ed3a558dc2e7a7e39ec"></a><!-- doxytag: member="Loki::SmallObjectBase::operator delete" ref="b835d84fa8bc1ed3a558dc2e7a7e39ec" args="(void *p, const std::nothrow_t &)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template<template< class, class > class ThreadingModel, std::size_t chunkSize, std::size_t maxSmallObjectSize, std::size_t objectAlignSize, template< class > class LifetimePolicy, class MutexPolicy> </div>
<table class="memname">
<tr>
<td class="memname">static void <a class="el" href="a00129.html">Loki::SmallObjectBase</a>< ThreadingModel, chunkSize, maxSmallObjectSize, objectAlignSize, LifetimePolicy, MutexPolicy >::operator delete </td>
<td>(</td>
<td class="paramtype">void * </td>
<td class="paramname"> <em>p</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const std::nothrow_t & </td>
<td class="paramname"></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td> throw ()<code> [inline, static]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Non-throwing single-object delete is only called when nothrow new operator is used, and the constructor throws an exception.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>SmallObj.h</ul>
</div>
<hr size="1"><address style="text-align: right;"><small>Generated on Thu Jan 29 18:51:45 2009 for Loki by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.8 </small></address>
</body>
</html>
|