aboutsummaryrefslogblamecommitdiffstatshomepage
path: root/classwinapi_1_1SharedObject.html
blob: 786f40dcff132e7f70b646a0bb53e29d5a8eb254 (plain) (tree)






















































































































































































































































































                                                                                                                                                                                                                                                                                                                                                                                                                       
<!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.9.1"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>winapi_common: winapi::SharedObject&lt; T &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" />
</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">winapi_common
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.1 -->
<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','.html');
/* @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"><b>winapi</b></li><li class="navelem"><a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-types">Public Types</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="classwinapi_1_1SharedObject-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">winapi::SharedObject&lt; T &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>Easy way to represent a C++ object as a shared memory region.  
 <a href="classwinapi_1_1SharedObject.html#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a>
Public Types</h2></td></tr>
<tr class="memitem:a481a8ba345bccaa036f0655473daf0f5"><td class="memItemLeft" align="right" valign="top"><a id="a481a8ba345bccaa036f0655473daf0f5"></a>
typedef std::aligned_storage&lt; sizeof(T), __alignof(T)&gt;::type&#160;</td><td class="memItemRight" valign="bottom"><b>AlignedType</b></td></tr>
<tr class="separator:a481a8ba345bccaa036f0655473daf0f5"><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>
Public Member Functions</h2></td></tr>
<tr class="memitem:a7548e763d3ba25bc843aec3d0adf37d7"><td class="memItemLeft" align="right" valign="top"><a id="a7548e763d3ba25bc843aec3d0adf37d7"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>SharedObject</b> (<a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a> &amp;&amp;other) noexcept=default</td></tr>
<tr class="separator:a7548e763d3ba25bc843aec3d0adf37d7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a13aa02b4a7b10419803eeadaaddc6b91"><td class="memItemLeft" align="right" valign="top"><a id="a13aa02b4a7b10419803eeadaaddc6b91"></a>
<a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a> &amp;other) noexcept=default</td></tr>
<tr class="separator:a13aa02b4a7b10419803eeadaaddc6b91"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3042c30573e1f9c39decc0a316a3173d"><td class="memItemLeft" align="right" valign="top"><a id="a3042c30573e1f9c39decc0a316a3173d"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>SharedObject</b> (const <a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a> &amp;)=delete</td></tr>
<tr class="separator:a3042c30573e1f9c39decc0a316a3173d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0dfaad2c143d60af8dc6c010a13d513a"><td class="memItemLeft" align="right" valign="top">T *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1SharedObject.html#a0dfaad2c143d60af8dc6c010a13d513a">ptr</a> () const</td></tr>
<tr class="separator:a0dfaad2c143d60af8dc6c010a13d513a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85d0943708ab0da78e1a189b1bbbd1eb"><td class="memItemLeft" align="right" valign="top">T &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1SharedObject.html#a85d0943708ab0da78e1a189b1bbbd1eb">get</a> () const</td></tr>
<tr class="separator:a85d0943708ab0da78e1a189b1bbbd1eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa8b94a969eb4db7998c059d27e3f6ff8"><td class="memItemLeft" align="right" valign="top"><a id="aa8b94a969eb4db7998c059d27e3f6ff8"></a>
T *&#160;</td><td class="memItemRight" valign="bottom"><b>operator-&gt;</b> () const</td></tr>
<tr class="separator:aa8b94a969eb4db7998c059d27e3f6ff8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9a2b1d0f607e3109e47c4f147d5b85bd"><td class="memItemLeft" align="right" valign="top"><a id="a9a2b1d0f607e3109e47c4f147d5b85bd"></a>
T &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator*</b> () const</td></tr>
<tr class="separator:a9a2b1d0f607e3109e47c4f147d5b85bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:acb4ef5283256d7463fe81c8b312b6745"><td class="memTemplParams" colspan="2">template&lt;typename... Args&gt; </td></tr>
<tr class="memitem:acb4ef5283256d7463fe81c8b312b6745"><td class="memTemplItemLeft" align="right" valign="top">static <a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a>&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="classwinapi_1_1SharedObject.html#acb4ef5283256d7463fe81c8b312b6745">create</a> (const std::string &amp;name, Args &amp;&amp;... args)</td></tr>
<tr class="separator:acb4ef5283256d7463fe81c8b312b6745"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a08fda6ddde26e0a10170efaf07232761"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a>&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classwinapi_1_1SharedObject.html#a08fda6ddde26e0a10170efaf07232761">open</a> (const std::string &amp;name)</td></tr>
<tr class="separator:a08fda6ddde26e0a10170efaf07232761"><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 T&gt;<br />
class winapi::SharedObject&lt; T &gt;</h3>

<p>Easy way to represent a C++ object as a shared memory region. </p>

<p class="definition">Definition at line <a class="el" href="shmem_8hpp_source.html#l00053">53</a> of file <a class="el" href="shmem_8hpp_source.html">shmem.hpp</a>.</p>
</div><h2 class="groupheader">Member Function Documentation</h2>
<a id="acb4ef5283256d7463fe81c8b312b6745"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acb4ef5283256d7463fe81c8b312b6745">&#9670;&nbsp;</a></span>create()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<div class="memtemplate">
template&lt;typename... Args&gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a> <a class="el" href="classwinapi_1_1SharedObject.html">winapi::SharedObject</a>&lt; T &gt;::create </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">Args &amp;&amp;...&#160;</td>
          <td class="paramname"><em>args</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Create the object &amp; construct a shared memory region to store it. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>UTF-8 string, name of the shared memory region. </td></tr>
    <tr><td class="paramname">args</td><td>Arguments to construct the object. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="shmem_8hpp_source.html#l00063">63</a> of file <a class="el" href="shmem_8hpp_source.html">shmem.hpp</a>.</p>

</div>
</div>
<a id="a08fda6ddde26e0a10170efaf07232761"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a08fda6ddde26e0a10170efaf07232761">&#9670;&nbsp;</a></span>open()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="classwinapi_1_1SharedObject.html">SharedObject</a> <a class="el" href="classwinapi_1_1SharedObject.html">winapi::SharedObject</a>&lt; T &gt;::open </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>name</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Open a shared memory region that stores the object. </p><dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">name</td><td>UTF-8 string, name of the shared memory region. </td></tr>
  </table>
  </dd>
</dl>

<p class="definition">Definition at line <a class="el" href="shmem_8hpp_source.html#l00074">74</a> of file <a class="el" href="shmem_8hpp_source.html">shmem.hpp</a>.</p>

</div>
</div>
<a id="a0dfaad2c143d60af8dc6c010a13d513a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0dfaad2c143d60af8dc6c010a13d513a">&#9670;&nbsp;</a></span>ptr()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T* <a class="el" href="classwinapi_1_1SharedObject.html">winapi::SharedObject</a>&lt; T &gt;::ptr </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>Get pointer to the object. </p>

<p class="definition">Definition at line <a class="el" href="shmem_8hpp_source.html#l00090">90</a> of file <a class="el" href="shmem_8hpp_source.html">shmem.hpp</a>.</p>

</div>
</div>
<a id="a85d0943708ab0da78e1a189b1bbbd1eb"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a85d0943708ab0da78e1a189b1bbbd1eb">&#9670;&nbsp;</a></span>get()</h2>

<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename T &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">T&amp; <a class="el" href="classwinapi_1_1SharedObject.html">winapi::SharedObject</a>&lt; T &gt;::get </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>Get reference to the object. </p>

<p class="definition">Definition at line <a class="el" href="shmem_8hpp_source.html#l00092">92</a> of file <a class="el" href="shmem_8hpp_source.html">shmem.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li>include/winapi/<a class="el" href="shmem_8hpp_source.html">shmem.hpp</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by&#160;<a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.1
</small></address>
</body>
</html>