<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> <title>Class template any_member_hook</title> <link rel="stylesheet" href="../../boostbook.css" type="text/css"> <meta name="generator" content="DocBook XSL Stylesheets V1.75.2"> <link rel="home" href="../../index.html" title="The Boost C++ Libraries BoostBook Documentation Subset"> <link rel="up" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp" title="Header <boost/intrusive/any_hook.hpp>"> <link rel="prev" href="make_any_member_hook.html" title="Struct template make_any_member_hook"> <link rel="next" href="any_to_slist_hook.html" title="Struct template any_to_slist_hook"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <table cellpadding="2" width="100%"><tr> <td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../boost.png"></td> <td align="center"><a href="../../../../index.html">Home</a></td> <td align="center"><a href="../../../../libs/libraries.htm">Libraries</a></td> <td align="center"><a href="http://www.boost.org/users/people.html">People</a></td> <td align="center"><a href="http://www.boost.org/users/faq.html">FAQ</a></td> <td align="center"><a href="../../../../more/index.htm">More</a></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="make_any_member_hook.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="any_to_slist_hook.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a> </div> <div class="refentry" title="Class template any_member_hook"> <a name="boost.intrusive.any_member_hook"></a><div class="titlepage"></div> <div class="refnamediv"> <h2><span class="refentrytitle">Class template any_member_hook</span></h2> <p>boost::intrusive::any_member_hook</p> </div> <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2> <div xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv"><pre class="synopsis"><span class="emphasis"><em>// In header: <<a class="link" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp" title="Header <boost/intrusive/any_hook.hpp>">boost/intrusive/any_hook.hpp</a>> </em></span><span class="bold"><strong>template</strong></span><<span class="bold"><strong>class</strong></span>... Options> <span class="bold"><strong>class</strong></span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> { <span class="bold"><strong>public</strong></span>: <span class="emphasis"><em>// <a class="link" href="any_member_hook.html#boost.intrusive.any_member_hookconstruct-copy-destruct">construct/copy/destruct</a></em></span> <a class="link" href="any_member_hook.html#id370455-bb">any_member_hook</a>(); <a class="link" href="any_member_hook.html#id326336-bb">any_member_hook</a>(<span class="bold"><strong>const</strong></span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> &); any_member_hook& <a class="link" href="any_member_hook.html#id348661-bb"><span class="bold"><strong>operator</strong></span>=</a>(<span class="bold"><strong>const</strong></span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> &); <a class="link" href="any_member_hook.html#id399059-bb">~any_member_hook</a>(); <span class="emphasis"><em>// <a class="link" href="any_member_hook.html#id374325-bb">public member functions</a></em></span> <span class="type"><span class="bold"><strong>bool</strong></span></span> <a class="link" href="any_member_hook.html#id374328-bb">is_linked</a>() <span class="bold"><strong>const</strong></span>; };</pre></div> <div class="refsect1" title="Description"> <a name="id1158759"></a><h2>Description</h2> <p>Store this hook in a class to be inserted in an intrusive container.</p> <p>The hook admits the following options: <code class="computeroutput">void_pointer<></code> and <code class="computeroutput">link_mode<></code>.</p> <p><code class="computeroutput">link_mode<></code> will specify the linking mode of the hook (<code class="computeroutput">normal_link</code> or <code class="computeroutput">safe_link</code>).</p> <p><code class="computeroutput">void_pointer<></code> is the pointer type that will be used internally in the hook and the the container configured to use this hook. </p> <div class="refsect2" title="any_member_hook public construct/copy/destruct"> <a name="id1158809"></a><h3> <a name="boost.intrusive.any_member_hookconstruct-copy-destruct"></a><code class="computeroutput">any_member_hook</code> public construct/copy/destruct</h3> <div class="orderedlist"><ol class="orderedlist" type="1"> <li class="listitem"> <pre class="literallayout"><a name="id370455-bb"></a>any_member_hook();</pre> <p><span class="bold"><strong>Effects</strong></span>: If link_mode is or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state.</p> <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p> </li> <li class="listitem"> <pre class="literallayout"><a name="id326336-bb"></a>any_member_hook(<span class="bold"><strong>const</strong></span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> &);</pre> <p><span class="bold"><strong>Effects</strong></span>: If link_mode is or <code class="computeroutput">safe_link</code> initializes the node to an unlinked state. The argument is ignored.</p> <p><span class="bold"><strong>Throws</strong></span>: Nothing.</p> <p><span class="bold"><strong>Rationale</strong></span>: Providing a copy-constructor makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p> </li> <li class="listitem"> <pre class="literallayout">any_member_hook& <a name="id348661-bb"></a><span class="bold"><strong>operator</strong></span>=(<span class="bold"><strong>const</strong></span> <a class="link" href="any_member_hook.html" title="Class template any_member_hook">any_member_hook</a> &);</pre> <p><span class="bold"><strong>Effects</strong></span>: Empty function. The argument is ignored.</p> <p><span class="bold"><strong>Throws</strong></span>: Nothing.</p> <p><span class="bold"><strong>Rationale</strong></span>: Providing an assignment operator makes classes using the hook STL-compliant without forcing the user to do some additional work. <code class="computeroutput">swap</code> can be used to emulate move-semantics. </p> </li> <li class="listitem"> <pre class="literallayout"><a name="id399059-bb"></a>~any_member_hook();</pre> <p><span class="bold"><strong>Effects</strong></span>: If link_mode is <code class="computeroutput">normal_link</code>, the destructor does nothing (ie. no code is generated). If link_mode is <code class="computeroutput">safe_link</code> and the object is stored in a container an assertion is raised.</p> <p><span class="bold"><strong>Throws</strong></span>: Nothing. </p> </li> </ol></div> </div> <div class="refsect2" title="any_member_hook public member functions"> <a name="id1159030"></a><h3> <a name="id374325-bb"></a><code class="computeroutput">any_member_hook</code> public member functions</h3> <div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem"> <pre class="literallayout"><span class="type"><span class="bold"><strong>bool</strong></span></span> <a name="id374328-bb"></a>is_linked() <span class="bold"><strong>const</strong></span>;</pre> <p><span class="bold"><strong>Precondition</strong></span>: link_mode must be <code class="computeroutput">safe_link</code>.</p> <p><span class="bold"><strong>Returns</strong></span>: true, if the node belongs to a container, false otherwise. This function can be used to test whether <code class="computeroutput">container::iterator_to</code> will return a valid iterator.</p> <p><span class="bold"><strong>Complexity</strong></span>: Constant </p> </li></ol></div> </div> </div> </div> <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> <td align="left"></td> <td align="right"><div class="copyright-footer">Copyright © 2005 Olaf Krzikalla, 2006-2009 Ion Gaztanaga<p> Distributed under the Boost Software License, Version 1.0. (See accompanying 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>) </p> </div></td> </tr></table> <hr> <div class="spirit-nav"> <a accesskey="p" href="make_any_member_hook.html"><img src="../../../../doc/html/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../intrusive/reference.html#header.boost.intrusive.any_hook_hpp"><img src="../../../../doc/html/images/up.png" alt="Up"></a><a accesskey="h" href="../../index.html"><img src="../../../../doc/html/images/home.png" alt="Home"></a><a accesskey="n" href="any_to_slist_hook.html"><img src="../../../../doc/html/images/next.png" alt="Next"></a> </div> </body> </html>