3 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
4 <title>Class template attribute_value_impl</title>
5 <link rel="stylesheet" href="../../../../../../../doc/src/boostbook.css" type="text/css">
6 <meta name="generator" content="DocBook XSL Stylesheets V1.79.1">
7 <link rel="home" href="../../../index.html" title="Chapter 1. Boost.Log v2">
8 <link rel="up" href="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_hpp" title="Header <boost/log/attributes/attribute_value_impl.hpp>">
9 <link rel="prev" href="../swap_idm45711349029984.html" title="Function swap">
10 <link rel="next" href="make_attribute_value.html" title="Function template make_attribute_value">
12 <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
13 <table cellpadding="2" width="100%"><tr><td valign="top"><img alt="Boost C++ Libraries" width="277" height="86" src="../../../../../../../boost.png"></td></tr></table>
15 <div class="spirit-nav">
16 <a accesskey="p" href="../swap_idm45711349029984.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_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="make_attribute_value.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
18 <div class="refentry">
19 <a name="boost.log.attributes.attribute_value_impl"></a><div class="titlepage"></div>
20 <div class="refnamediv">
21 <h2><span class="refentrytitle">Class template attribute_value_impl</span></h2>
22 <p>boost::log::attributes::attribute_value_impl — Basic attribute value implementation class. </p>
24 <h2 xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" class="refsynopsisdiv-title">Synopsis</h2>
25 <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="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_hpp" title="Header <boost/log/attributes/attribute_value_impl.hpp>">boost/log/attributes/attribute_value_impl.hpp</a>>
27 </span><span class="keyword">template</span><span class="special"><</span><span class="keyword">typename</span> T<span class="special">></span>
28 <span class="keyword">class</span> <a class="link" href="attribute_value_impl.html" title="Class template attribute_value_impl">attribute_value_impl</a> <span class="special">:</span> <span class="keyword">public</span> <span class="identifier">attribute_value</span><span class="special">::</span><span class="identifier">impl</span> <span class="special">{</span>
29 <span class="keyword">public</span><span class="special">:</span>
30 <span class="comment">// types</span>
31 <span class="keyword">typedef</span> <span class="identifier">T</span> <a name="boost.log.attributes.attribute_value_impl.value_type"></a><span class="identifier">value_type</span><span class="special">;</span> <span class="comment">// Value type. </span>
33 <span class="comment">// <a class="link" href="attribute_value_impl.html#boost.log.attributes.attribute_value_implconstruct-copy-destruct">construct/copy/destruct</a></span>
34 <span class="keyword">explicit</span> <a class="link" href="attribute_value_impl.html#idm45711349009376-bb"><span class="identifier">attribute_value_impl</span></a><span class="special">(</span><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
35 <span class="keyword">explicit</span> <a class="link" href="attribute_value_impl.html#idm45711349007680-bb"><span class="identifier">attribute_value_impl</span></a><span class="special">(</span><span class="identifier">value_type</span> <span class="special">&&</span><span class="special">)</span><span class="special">;</span>
37 <span class="comment">// <a class="link" href="attribute_value_impl.html#idm45711349018928-bb">public member functions</a></span>
38 <span class="keyword">virtual</span> <span class="keyword">bool</span> <a class="link" href="attribute_value_impl.html#idm45711349018368-bb"><span class="identifier">dispatch</span></a><span class="special">(</span><span class="identifier">type_dispatcher</span> <span class="special">&</span><span class="special">)</span><span class="special">;</span>
39 <span class="keyword">virtual</span> <span class="identifier">typeindex</span><span class="special">::</span><span class="identifier">type_index</span> <a class="link" href="attribute_value_impl.html#idm45711349014064-bb"><span class="identifier">get_type</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
40 <span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&</span> <a class="link" href="attribute_value_impl.html#idm45711349011664-bb"><span class="identifier">get</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
41 <span class="special">}</span><span class="special">;</span></pre></div>
42 <div class="refsect1">
43 <a name="idm45554753579456"></a><h2>Description</h2>
44 <p>This class can be used as a boilerplate for simple attribute values. The class implements all needed interfaces of attribute values and allows to store a single value of the type specified as a template parameter. The stored value can be dispatched with type dispatching mechanism. </p>
45 <div class="refsect2">
46 <a name="idm45554753578480"></a><h3>
47 <a name="boost.log.attributes.attribute_value_implconstruct-copy-destruct"></a><code class="computeroutput">attribute_value_impl</code>
49 construct/copy/destruct</h3>
50 <div class="orderedlist"><ol class="orderedlist" type="1">
52 <pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45711349009376-bb"></a><span class="identifier">attribute_value_impl</span><span class="special">(</span><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&</span> v<span class="special">)</span><span class="special">;</span></pre>
53 <p>Constructor with initialization of the stored value </p>
56 <pre class="literallayout"><span class="keyword">explicit</span> <a name="idm45711349007680-bb"></a><span class="identifier">attribute_value_impl</span><span class="special">(</span><span class="identifier">value_type</span> <span class="special">&&</span> v<span class="special">)</span><span class="special">;</span></pre>
57 <p>Constructor with initialization of the stored value </p>
61 <div class="refsect2">
62 <a name="idm45554753563376"></a><h3>
63 <a name="idm45711349018928-bb"></a><code class="computeroutput">attribute_value_impl</code> public member functions</h3>
64 <div class="orderedlist"><ol class="orderedlist" type="1">
66 <pre class="literallayout"><span class="keyword">virtual</span> <span class="keyword">bool</span> <a name="idm45711349018368-bb"></a><span class="identifier">dispatch</span><span class="special">(</span><span class="identifier">type_dispatcher</span> <span class="special">&</span> dispatcher<span class="special">)</span><span class="special">;</span></pre>
67 <p>Attribute value dispatching method.</p>
71 <div class="variablelist"><table border="0" class="variablelist compact">
73 <col align="left" valign="top">
78 <td><p><span class="term">Parameters:</span></p></td>
79 <td><div class="variablelist"><table border="0" class="variablelist compact">
81 <col align="left" valign="top">
85 <td><p><span class="term"><code class="computeroutput">dispatcher</code></span></p></td>
86 <td><p>The dispatcher that receives the stored value</p></td>
91 <td><p><span class="term">Returns:</span></p></td>
92 <td><p><code class="computeroutput">true</code> if the value has been dispatched, <code class="computeroutput">false</code> otherwise </p></td>
98 <pre class="literallayout"><span class="keyword">virtual</span> <span class="identifier">typeindex</span><span class="special">::</span><span class="identifier">type_index</span> <a name="idm45711349014064-bb"></a><span class="identifier">get_type</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
101 <div class="variablelist"><table border="0" class="variablelist compact">
103 <col align="left" valign="top">
107 <td><p><span class="term">Returns:</span></p></td>
108 <td><p>The attribute value type </p></td>
112 <li class="listitem">
113 <pre class="literallayout"><span class="identifier">value_type</span> <span class="keyword">const</span> <span class="special">&</span> <a name="idm45711349011664-bb"></a><span class="identifier">get</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
116 <div class="variablelist"><table border="0" class="variablelist compact">
118 <col align="left" valign="top">
122 <td><p><span class="term">Returns:</span></p></td>
123 <td><p>Reference to the contained value. </p></td>
131 <table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
132 <td align="left"></td>
133 <td align="right"><div class="copyright-footer">Copyright © 2007-2016 Andrey Semashev<p>
134 Distributed under the Boost Software License, Version 1.0. (See accompanying
135 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>).
140 <div class="spirit-nav">
141 <a accesskey="p" href="../swap_idm45711349029984.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../attributes.html#header.boost.log.attributes.attribute_value_impl_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="make_attribute_value.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>