• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html>
2<head>
3<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
4<title>Class cast_source</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_cast_hpp" title="Header &lt;boost/log/attributes/attribute_cast.hpp&gt;">
9<link rel="prev" href="../swap_idm46079579923840.html" title="Function swap">
10<link rel="next" href="../attribute_cast.html" title="Function template attribute_cast">
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="../swap_idm46079579923840.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../attributes.html#header.boost.log.attributes.attribute_cast_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="../attribute_cast.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
17</div>
18<div class="refentry">
19<a name="boost.log.attributes.cast_source"></a><div class="titlepage"></div>
20<div class="refnamediv">
21<h2><span class="refentrytitle">Class cast_source</span></h2>
22<p>boost::log::attributes::cast_source</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: &lt;<a class="link" href="../../../attributes.html#header.boost.log.attributes.attribute_cast_hpp" title="Header &lt;boost/log/attributes/attribute_cast.hpp&gt;">boost/log/attributes/attribute_cast.hpp</a>&gt;
26
27</span>
28<span class="keyword">class</span> <a class="link" href="cast_source.html" title="Class cast_source">cast_source</a> <span class="special">{</span>
29<span class="keyword">public</span><span class="special">:</span>
30  <span class="comment">// <a class="link" href="cast_source.html#boost.log.attributes.cast_sourceconstruct-copy-destruct">construct/copy/destruct</a></span>
31  <span class="keyword">explicit</span> <a class="link" href="cast_source.html#idm46079579911552-bb"><span class="identifier">cast_source</span></a><span class="special">(</span><a class="link" href="../attribute/impl.html" title="Struct impl">attribute::impl</a> <span class="special">*</span><span class="special">)</span><span class="special">;</span>
32
33  <span class="comment">// <a class="link" href="cast_source.html#idm46079579916080-bb">public member functions</a></span>
34  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <span class="special">*</span> <a class="link" href="cast_source.html#idm46079579915520-bb"><span class="identifier">as</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
35<span class="special">}</span><span class="special">;</span></pre></div>
36<div class="refsect1">
37<a name="idm44984885954608"></a><h2>Description</h2>
38<p>The class holds a reference to the attribute factory implementation being casted </p>
39<div class="refsect2">
40<a name="idm44984885953936"></a><h3>
41<a name="boost.log.attributes.cast_sourceconstruct-copy-destruct"></a><code class="computeroutput">cast_source</code>
42        public
43       construct/copy/destruct</h3>
44<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
45<pre class="literallayout"><span class="keyword">explicit</span> <a name="idm46079579911552-bb"></a><span class="identifier">cast_source</span><span class="special">(</span><a class="link" href="../attribute/impl.html" title="Struct impl">attribute::impl</a> <span class="special">*</span> p<span class="special">)</span><span class="special">;</span></pre>
46<p>Initializing constructor. Creates a source that refers to the specified factory implementation. </p>
47</li></ol></div>
48</div>
49<div class="refsect2">
50<a name="idm44984885945472"></a><h3>
51<a name="idm46079579916080-bb"></a><code class="computeroutput">cast_source</code> public member functions</h3>
52<div class="orderedlist"><ol class="orderedlist" type="1"><li class="listitem">
53<pre class="literallayout"><span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="identifier">T</span> <span class="special">*</span> <a name="idm46079579915520-bb"></a><span class="identifier">as</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
54<p>The function attempts to cast the aggregated pointer to the implementation to the specified type.</p>
55<p>
56</p>
57<div class="variablelist"><table border="0" class="variablelist compact">
58<colgroup>
59<col align="left" valign="top">
60<col>
61</colgroup>
62<tbody><tr>
63<td><p><span class="term">Returns:</span></p></td>
64<td><p>The converted pointer or <code class="computeroutput">NULL</code>, if the conversion fails. </p></td>
65</tr></tbody>
66</table></div>
67</li></ol></div>
68</div>
69</div>
70</div>
71<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
72<td align="left"></td>
73<td align="right"><div class="copyright-footer">Copyright © 2007-2019 Andrey Semashev<p>
74        Distributed under the Boost Software License, Version 1.0. (See accompanying
75        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>).
76      </p>
77</div></td>
78</tr></table>
79<hr>
80<div class="spirit-nav">
81<a accesskey="p" href="../swap_idm46079579923840.html"><img src="../../../../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../../attributes.html#header.boost.log.attributes.attribute_cast_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="../attribute_cast.html"><img src="../../../../../../../doc/src/images/next.png" alt="Next"></a>
82</div>
83</body>
84</html>
85