• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 frame</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="../../stacktrace/reference.html#header.boost.stacktrace.detail.frame_decl_hpp" title="Header &lt;boost/stacktrace/detail/frame_decl.hpp&gt;">
10<link rel="prev" href="operator__1_3_37_7_3_1_1_4.html" title="Function template operator==">
11<link rel="next" href="safe_dump_1_3_37_7_6_2_1_1.html" title="Function safe_dump_to">
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="operator__1_3_37_7_3_1_1_4.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../stacktrace/reference.html#header.boost.stacktrace.detail.frame_decl_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="safe_dump_1_3_37_7_6_2_1_1.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
25</div>
26<div class="refentry">
27<a name="boost.stacktrace.frame"></a><div class="titlepage"></div>
28<div class="refnamediv">
29<h2><span class="refentrytitle">Class frame</span></h2>
30<p>boost::stacktrace::frame — Class that stores frame/function address and can get information about it at runtime. </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: &lt;<a class="link" href="../../stacktrace/reference.html#header.boost.stacktrace.detail.frame_decl_hpp" title="Header &lt;boost/stacktrace/detail/frame_decl.hpp&gt;">boost/stacktrace/detail/frame_decl.hpp</a>&gt;
34
35</span>
36<span class="keyword">class</span> <a class="link" href="frame.html" title="Class frame">frame</a> <span class="special">{</span>
37<span class="keyword">public</span><span class="special">:</span>
38  <span class="comment">// types</span>
39  <span class="keyword">typedef</span> <span class="emphasis"><em><span class="identifier">unspecified</span></em></span> <a name="boost.stacktrace.frame.native_frame_ptr_t"></a><span class="identifier">native_frame_ptr_t</span><span class="special">;</span>
40
41  <span class="comment">// <a class="link" href="frame.html#boost.stacktrace.frameconstruct-copy-destruct">construct/copy/destruct</a></span>
42  <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_4-bb"><span class="identifier">frame</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
43  <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_5-bb"><span class="identifier">frame</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="frame.html" title="Class frame">frame</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
44  <span class="keyword">explicit</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_7-bb"><span class="identifier">frame</span></a><span class="special">(</span><span class="identifier">native_frame_ptr_t</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
45  <span class="keyword">template</span><span class="special">&lt;</span><span class="keyword">typename</span> T<span class="special">&gt;</span> <span class="keyword">explicit</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_8-bb"><span class="identifier">frame</span></a><span class="special">(</span><span class="identifier">T</span> <span class="special">*</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span>
46  <span class="keyword">constexpr</span> <a class="link" href="frame.html" title="Class frame">frame</a> <span class="special">&amp;</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_6-bb"><span class="keyword">operator</span><span class="special">=</span></a><span class="special">(</span><span class="keyword">const</span> <a class="link" href="frame.html" title="Class frame">frame</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span>
47
48  <span class="comment">// <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_3-bb">public member functions</a></span>
49  <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_3_1-bb"><span class="identifier">name</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
50  <span class="keyword">constexpr</span> <span class="identifier">native_frame_ptr_t</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_3_2-bb"><span class="identifier">address</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
51  <span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_3_3-bb"><span class="identifier">source_file</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
52  <span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_3_4-bb"><span class="identifier">source_line</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span>
53  <span class="keyword">constexpr</span> <span class="keyword">bool</span> <a class="link" href="frame.html#id-1_3_37_7_4_2_1_1_3_5-bb"><span class="identifier">empty</span></a><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span>
54<span class="special">}</span><span class="special">;</span></pre></div>
55<div class="refsect1">
56<a name="id-1.3.37.7.3.4.4"></a><h2>Description</h2>
57<div class="refsect2">
58<a name="id-1.3.37.7.3.4.4.2"></a><h3>
59<a name="boost.stacktrace.frameconstruct-copy-destruct"></a><code class="computeroutput">frame</code>
60        public
61       construct/copy/destruct</h3>
62<div class="orderedlist"><ol class="orderedlist" type="1">
63<li class="listitem">
64<pre class="literallayout"><a name="id-1_3_37_7_4_2_1_1_4-bb"></a><span class="identifier">frame</span><span class="special">(</span><span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Constructs frame that references NULL address. Calls to source_file() and source_line() will return empty string. Calls to source_line() will return 0. <p><span class="bold"><strong>Complexity:</strong></span> O(1).</p>
65<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe.
66</p>
67<div class="variablelist"><table border="0" class="variablelist compact">
68<colgroup>
69<col align="left" valign="top">
70<col>
71</colgroup>
72<tbody><tr>
73<td><p><span class="term">Throws:</span></p></td>
74<td>Nothing. </td>
75</tr></tbody>
76</table></div>
77</li>
78<li class="listitem">
79<pre class="literallayout"><a name="id-1_3_37_7_4_2_1_1_5-bb"></a><span class="identifier">frame</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="frame.html" title="Class frame">frame</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre>Copy constructs frame. <p><span class="bold"><strong>Complexity:</strong></span> O(1).</p>
80<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe.
81</p>
82<div class="variablelist"><table border="0" class="variablelist compact">
83<colgroup>
84<col align="left" valign="top">
85<col>
86</colgroup>
87<tbody><tr>
88<td><p><span class="term">Throws:</span></p></td>
89<td>Nothing. </td>
90</tr></tbody>
91</table></div>
92</li>
93<li class="listitem">
94<pre class="literallayout"><span class="keyword">explicit</span> <a name="id-1_3_37_7_4_2_1_1_7-bb"></a><span class="identifier">frame</span><span class="special">(</span><span class="identifier">native_frame_ptr_t</span> addr<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Constructs frame that references addr and could later generate information about that address using platform specific features. <p><span class="bold"><strong>Complexity:</strong></span> O(1).</p>
95<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe.
96</p>
97<div class="variablelist"><table border="0" class="variablelist compact">
98<colgroup>
99<col align="left" valign="top">
100<col>
101</colgroup>
102<tbody><tr>
103<td><p><span class="term">Throws:</span></p></td>
104<td>Nothing. </td>
105</tr></tbody>
106</table></div>
107</li>
108<li class="listitem">
109<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="keyword">explicit</span> <a name="id-1_3_37_7_4_2_1_1_8-bb"></a><span class="identifier">frame</span><span class="special">(</span><span class="identifier">T</span> <span class="special">*</span> function_addr<span class="special">)</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Constructs frame that references function_addr and could later generate information about that function using platform specific features. <p><span class="bold"><strong>Complexity:</strong></span> O(1).</p>
110<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe.
111</p>
112<div class="variablelist"><table border="0" class="variablelist compact">
113<colgroup>
114<col align="left" valign="top">
115<col>
116</colgroup>
117<tbody><tr>
118<td><p><span class="term">Throws:</span></p></td>
119<td>Nothing. </td>
120</tr></tbody>
121</table></div>
122</li>
123<li class="listitem">
124<pre class="literallayout"><span class="keyword">constexpr</span> <a class="link" href="frame.html" title="Class frame">frame</a> <span class="special">&amp;</span> <a name="id-1_3_37_7_4_2_1_1_6-bb"></a><span class="keyword">operator</span><span class="special">=</span><span class="special">(</span><span class="keyword">const</span> <a class="link" href="frame.html" title="Class frame">frame</a> <span class="special">&amp;</span><span class="special">)</span> <span class="special">=</span> <span class="keyword">default</span><span class="special">;</span></pre>Copy assigns frame. <p><span class="bold"><strong>Complexity:</strong></span> O(1).</p>
125<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe.
126</p>
127<div class="variablelist"><table border="0" class="variablelist compact">
128<colgroup>
129<col align="left" valign="top">
130<col>
131</colgroup>
132<tbody><tr>
133<td><p><span class="term">Throws:</span></p></td>
134<td>Nothing. </td>
135</tr></tbody>
136</table></div>
137</li>
138</ol></div>
139</div>
140<div class="refsect2">
141<a name="id-1.3.37.7.3.4.4.3"></a><h3>
142<a name="id-1_3_37_7_4_2_1_1_3-bb"></a><code class="computeroutput">frame</code> public member functions</h3>
143<div class="orderedlist"><ol class="orderedlist" type="1">
144<li class="listitem">
145<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="id-1_3_37_7_4_2_1_1_3_1-bb"></a><span class="identifier">name</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
146<p>
147<span class="bold"><strong>Complexity:</strong></span> unknown (lots of platform specific work).</p>
148<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Unsafe.
149</p>
150<div class="variablelist"><table border="0" class="variablelist compact">
151<colgroup>
152<col align="left" valign="top">
153<col>
154</colgroup>
155<tbody>
156<tr>
157<td><p><span class="term">Returns:</span></p></td>
158<td><p>Name of the frame (function name in a human readable form).</p></td>
159</tr>
160<tr>
161<td><p><span class="term">Throws:</span></p></td>
162<td>std::bad_alloc if not enough memory to construct resulting string. </td>
163</tr>
164</tbody>
165</table></div>
166</li>
167<li class="listitem">
168<pre class="literallayout"><span class="keyword">constexpr</span> <span class="identifier">native_frame_ptr_t</span> <a name="id-1_3_37_7_4_2_1_1_3_2-bb"></a><span class="identifier">address</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>
169<p>
170<span class="bold"><strong>Complexity:</strong></span> O(1).</p>
171<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe.
172</p>
173<div class="variablelist"><table border="0" class="variablelist compact">
174<colgroup>
175<col align="left" valign="top">
176<col>
177</colgroup>
178<tbody>
179<tr>
180<td><p><span class="term">Returns:</span></p></td>
181<td><p>Address of the frame function.</p></td>
182</tr>
183<tr>
184<td><p><span class="term">Throws:</span></p></td>
185<td>Nothing. </td>
186</tr>
187</tbody>
188</table></div>
189</li>
190<li class="listitem">
191<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">string</span> <a name="id-1_3_37_7_4_2_1_1_3_3-bb"></a><span class="identifier">source_file</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
192<p>
193
194<span class="bold"><strong>Complexity:</strong></span> unknown (lots of platform specific work).</p>
195<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Unsafe. </p>
196<div class="variablelist"><table border="0" class="variablelist compact">
197<colgroup>
198<col align="left" valign="top">
199<col>
200</colgroup>
201<tbody>
202<tr>
203<td><p><span class="term">Returns:</span></p></td>
204<td><p>Path to the source file, were the function of the frame is defined. Returns empty string if this-&gt;source_line() == 0. </p></td>
205</tr>
206<tr>
207<td><p><span class="term">Throws:</span></p></td>
208<td>std::bad_alloc if not enough memory to construct resulting string.</td>
209</tr>
210</tbody>
211</table></div>
212</li>
213<li class="listitem">
214<pre class="literallayout"><span class="identifier">std</span><span class="special">::</span><span class="identifier">size_t</span> <a name="id-1_3_37_7_4_2_1_1_3_4-bb"></a><span class="identifier">source_line</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span><span class="special">;</span></pre>
215<p>
216
217<span class="bold"><strong>Complexity:</strong></span> unknown (lots of platform specific work).</p>
218<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Unsafe. </p>
219<div class="variablelist"><table border="0" class="variablelist compact">
220<colgroup>
221<col align="left" valign="top">
222<col>
223</colgroup>
224<tbody>
225<tr>
226<td><p><span class="term">Returns:</span></p></td>
227<td><p>Code line in the source file, were the function of the frame is defined. </p></td>
228</tr>
229<tr>
230<td><p><span class="term">Throws:</span></p></td>
231<td>std::bad_alloc if not enough memory to construct string for internal needs.</td>
232</tr>
233</tbody>
234</table></div>
235</li>
236<li class="listitem">
237<pre class="literallayout"><span class="keyword">constexpr</span> <span class="keyword">bool</span> <a name="id-1_3_37_7_4_2_1_1_3_5-bb"></a><span class="identifier">empty</span><span class="special">(</span><span class="special">)</span> <span class="keyword">const</span> <span class="keyword">noexcept</span><span class="special">;</span></pre>Checks that frame is not references NULL address. <p>
238<span class="bold"><strong>Complexity:</strong></span> O(1)</p>
239<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe. Checks that frame references NULL address.
240<span class="bold"><strong>Complexity:</strong></span> O(1)</p>
241<p><span class="bold"><strong>Async-Handler-Safety</strong></span>: Safe. </p>
242<div class="variablelist"><table border="0" class="variablelist compact">
243<colgroup>
244<col align="left" valign="top">
245<col>
246</colgroup>
247<tbody>
248<tr>
249<td><p><span class="term">Returns:</span></p></td>
250<td><p><code class="computeroutput">true</code> if <code class="computeroutput">this-&gt;address() != 0</code></p></td>
251</tr>
252<tr>
253<td><p><span class="term">Returns:</span></p></td>
254<td><p><code class="computeroutput">true</code> if <code class="computeroutput">this-&gt;address() == 0</code></p></td>
255</tr>
256</tbody>
257</table></div>
258</li>
259</ol></div>
260</div>
261</div>
262</div>
263<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
264<td align="left"></td>
265<td align="right"><div class="copyright-footer">Copyright © 2016-2020 Antony Polukhin<p>
266        Distributed under the Boost Software License, Version 1.0. (See accompanying
267        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>)
268      </p>
269</div></td>
270</tr></table>
271<hr>
272<div class="spirit-nav">
273<a accesskey="p" href="operator__1_3_37_7_3_1_1_4.html"><img src="../../../../doc/src/images/prev.png" alt="Prev"></a><a accesskey="u" href="../../stacktrace/reference.html#header.boost.stacktrace.detail.frame_decl_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="safe_dump_1_3_37_7_6_2_1_1.html"><img src="../../../../doc/src/images/next.png" alt="Next"></a>
274</div>
275</body>
276</html>
277