1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>Class xsi_key</title> 6<link rel="stylesheet" href="../../../../doc/src/boostbook.css" type="text/css"> 7<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 8<link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> 9<link rel="up" href="../../interprocess/indexes_reference.html#header.boost.interprocess.xsi_key_hpp" title="Header <boost/interprocess/xsi_key.hpp>"> 10<link rel="prev" href="windows_shared_memory.html" title="Class windows_shared_memory"> 11<link rel="next" href="xsi_shared_memory.html" title="Class xsi_shared_memory"> 12</head> 13<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 14<table cellpadding="2" width="100%"><tr> 15<td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> 16<td align="center"><a href="../../../../index.html">Home</a></td> 17<td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> 18<td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> 19<td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> 20<td align="center"><a href="../../../../more/index.htm">More</a></td> 21</tr></table> 22<hr> 23<div class="spirit-nav"> 24<a accesskey="p" href="windows_shared_memory.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.xsi_key_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="xsi_shared_memory.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 25</div> 26<div class="refentry"> 27<a name="boost.interprocess.xsi_key"></a><div class="titlepage"></div> 28<div class="refnamediv"> 29<h2><span class="refentrytitle">Class xsi_key</span></h2> 30<p>boost::interprocess::xsi_key</p> 31</div> 32<h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> 33<div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="comment">// In header: <<a class="link" href="../../interprocess/indexes_reference.html#header.boost.interprocess.xsi_key_hpp" title="Header <boost/interprocess/xsi_key.hpp>">boost/interprocess/xsi_key.hpp</a>> 34 35</span> 36<span class="keyword">class</span> <a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a> <span class="special">{</span> 37<span class="keyword">public</span><span class="special">:</span> 38 <span class="comment">// <a class="link" href="xsi_key.html#boost.interprocess.xsi_keyconstruct-copy-destruct">construct/copy/destruct</a></span> 39 <a class="link" href="xsi_key.html#idm45304009629696-bb"><span class="identifier">xsi_key</span></a><span class="special">(</span><span class="special">)</span><span class="special">;</span> 40 <span class="keyword">explicit</span> <a class="link" href="xsi_key.html#idm45304009628224-bb"><span class="identifier">xsi_key</span></a><span class="special">(</span><span class="identifier">key_t</span><span class="special">)</span><span class="special">;</span> 41 <a class="link" href="xsi_key.html#idm45304009626608-bb"><span class="identifier">xsi_key</span></a><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span><span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uint8_t</span><span class="special">)</span><span class="special">;</span> 42 43 <span class="comment">// <a class="link" href="xsi_key.html#idm45304009631840-bb">public member functions</a></span> 44 <span class="identifier">key_t</span> <a class="link" href="xsi_key.html#idm45304009631280-bb"><span class="identifier">get_key</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span> 45<span class="special">}</span><span class="special">;</span></pre></div> 46<div class="refsect1"> 47<a name="id-1.3.19.17.3.79.4.4"></a><h2>Description</h2> 48<p>A class that wraps XSI (System V) key_t type. This type calculates key_t from path and id using ftok, sets key to a specified value, or sets key to IPC_PRIVATE using the default constructor. </p> 49<div class="refsect2"> 50<a name="id-1.3.19.17.3.79.4.4.3"></a><h3> 51<a name="boost.interprocess.xsi_keyconstruct-copy-destruct"></a><code class="computeroutput">xsi_key</code> 52 public 53 construct/copy/destruct</h3> 54<div class="orderedlist"><ol class="orderedlist" type="1"> 55<li class="listitem"> 56<pre class="literallayout"><a name="idm45304009629696-bb"></a><span class="identifier">xsi_key</span><span class="special">(</span><span class="special">)</span><span class="special">;</span></pre> 57<p>Default constructor. Represents a private <code class="computeroutput"><a class="link" href="xsi_key.html" title="Class xsi_key">xsi_key</a></code>. </p> 58</li> 59<li class="listitem"> 60<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45304009628224-bb"></a><span class="identifier">xsi_key</span><span class="special">(</span><span class="identifier">key_t</span> key<span class="special">)</span><span class="special">;</span></pre>Creates a new XSI key using a specified value. Constructor is explicit to avoid ambiguity with shmid. </li> 61<li class="listitem"> 62<pre class="literallayout"><a name="idm45304009626608-bb"></a><span class="identifier">xsi_key</span><span class="special">(</span><span class="keyword">const</span> <span class="keyword">char</span> <span class="special">*</span> path<span class="special">,</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">uint8_t</span> id<span class="special">)</span><span class="special">;</span></pre> 63<p>Creates a new XSI shared memory with a key obtained from a call to ftok (with path "path" and id "id"), of size "size" and permissions "perm". If the shared memory previously exists, throws an error. </p> 64</li> 65</ol></div> 66</div> 67<div class="refsect2"> 68<a name="id-1.3.19.17.3.79.4.4.4"></a><h3> 69<a name="idm45304009631840-bb"></a><code class="computeroutput">xsi_key</code> public member functions</h3> 70<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> 71<pre class="literallayout"><span class="identifier">key_t</span> <a name="idm45304009631280-bb"></a><span class="identifier">get_key</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>Returns the internal key_t value. </li></ol></div> 72</div> 73</div> 74</div> 75<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 76<td align="left"></td> 77<td align="right"><div class="copyright-footer">Copyright © 2005-2015 Ion Gaztanaga<p> 78 Distributed under the Boost Software License, Version 1.0. (See accompanying 79 file LICENSE_1_0.txt or copy at <a href="http://www.boost.org/LICENSE_1_0.txt" target="_top">http://www.boost.org/LICENSE_1_0.txt</a>) 80 </p> 81</div></td> 82</tr></table> 83<hr> 84<div class="spirit-nav"> 85<a accesskey="p" href="windows_shared_memory.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../interprocess/indexes_reference.html#header.boost.interprocess.xsi_key_hpp"><img src="../../../../doc/src/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/src/images/home.png" alt="Home"></a><a accesskey="n" href="xsi_shared_memory.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 86</div> 87</body> 88</html> 89