1<html> 2<head> 3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 4<title>Macro BOOST_LOG_ATTRIBUTE_KEYWORD_TYPE</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="expressions.html#header.boost.log.expressions.keyword_hpp" title="Header <boost/log/expressions/keyword.hpp>"> 9<link rel="prev" href="boost/log/expressions/keyword_descriptor.html" title="Struct keyword_descriptor"> 10<link rel="next" href="BOOST_LO_idm46079578189088.html" title="Macro BOOST_LOG_ATTRIBUTE_KEYWORD"> 11</head> 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> 14<hr> 15<div class="spirit-nav"> 16<a accesskey="p" href="boost/log/expressions/keyword_descriptor.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="expressions.html#header.boost.log.expressions.keyword_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="BOOST_LO_idm46079578189088.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 17</div> 18<div class="refentry"> 19<a name="BOOST_LO_idm46079578196832"></a><div class="titlepage"></div> 20<div class="refnamediv"> 21<h2><span class="refentrytitle">Macro BOOST_LOG_ATTRIBUTE_KEYWORD_TYPE</span></h2> 22<p>BOOST_LOG_ATTRIBUTE_KEYWORD_TYPE — The macro declares an attribute keyword type. </p> 23</div> 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="expressions.html#header.boost.log.expressions.keyword_hpp" title="Header <boost/log/expressions/keyword.hpp>">boost/log/expressions/keyword.hpp</a>> 26 27</span>BOOST_LOG_ATTRIBUTE_KEYWORD_TYPE(keyword_, name_, value_type_)</pre></div> 28<div class="refsect1"> 29<a name="idm44984874910160"></a><h2>Description</h2> 30<p>The macro should be used at a namespace scope. It expands into an attribute keyword type definition, including the <code class="computeroutput">tag</code> namespace and the keyword tag type within which has the following layout:</p> 31<pre class="programlisting"><span class="keyword">namespace</span> <span class="identifier">tag</span> 32<span class="special">{</span> 33 <span class="keyword">struct</span> <span class="identifier">keyword_</span> <span class="special">:</span> 34 <span class="keyword">public</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">log</span><span class="special">::</span><span class="identifier">expressions</span><span class="special">::</span><span class="identifier">keyword_descriptor</span> 35 <span class="special">{</span> 36 <span class="keyword">typedef</span> <span class="identifier">value_type_</span> <span class="identifier">value_type</span><span class="special">;</span> 37 <span class="keyword">static</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">log</span><span class="special">::</span><span class="identifier">attribute_name</span> <span class="identifier">get_name</span><span class="special">(</span><span class="special">)</span><span class="special">;</span> 38 <span class="special">}</span><span class="special">;</span> 39<span class="special">}</span> 40 41<span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">log</span><span class="special">::</span><span class="identifier">expressions</span><span class="special">::</span><span class="identifier">attribute_keyword</span><span class="special"><</span> <span class="identifier">tag</span><span class="special">::</span><span class="identifier">keyword_</span> <span class="special">></span> <span class="identifier">keyword_type</span><span class="special">;</span> 42</pre> 43<p>The <code class="computeroutput">get_name</code> method returns the attribute name.</p> 44<div class="note"><table border="0" summary="Note"> 45<tr> 46<td rowspan="2" align="center" valign="top" width="25"><img alt="[Note]" src="../../../../doc/src/images/note.png"></td> 47<th align="left">Note</th> 48</tr> 49<tr><td align="left" valign="top"><p>This macro only defines the type of the keyword. To also define the keyword object, use the <code class="computeroutput">BOOST_LOG_ATTRIBUTE_KEYWORD</code> macro instead.</p></td></tr> 50</table></div> 51<p> 52 53</p> 54<div class="variablelist"><table border="0" class="variablelist compact"> 55<colgroup> 56<col align="left" valign="top"> 57<col> 58</colgroup> 59<tbody><tr> 60<td><p><span class="term">Parameters:</span></p></td> 61<td><div class="variablelist"><table border="0" class="variablelist compact"> 62<colgroup> 63<col align="left" valign="top"> 64<col> 65</colgroup> 66<tbody> 67<tr> 68<td><p><span class="term"><code class="computeroutput">keyword_</code></span></p></td> 69<td><p>Keyword name </p></td> 70</tr> 71<tr> 72<td><p><span class="term"><code class="computeroutput">name_</code></span></p></td> 73<td><p>Attribute name string </p></td> 74</tr> 75<tr> 76<td><p><span class="term"><code class="computeroutput">value_type_</code></span></p></td> 77<td><p>Attribute value type </p></td> 78</tr> 79</tbody> 80</table></div></td> 81</tr></tbody> 82</table></div> 83</div> 84</div> 85<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr> 86<td align="left"></td> 87<td align="right"><div class="copyright-footer">Copyright © 2007-2019 Andrey Semashev<p> 88 Distributed under the Boost Software License, Version 1.0. (See accompanying 89 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>). 90 </p> 91</div></td> 92</tr></table> 93<hr> 94<div class="spirit-nav"> 95<a accesskey="p" href="boost/log/expressions/keyword_descriptor.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="expressions.html#header.boost.log.expressions.keyword_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="BOOST_LO_idm46079578189088.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a> 96</div> 97</body> 98</html> 99