forked from boostorg/exception
Compare commits
41 Commits
boost-1.31
...
boost-1.39
Author | SHA1 | Date | |
---|---|---|---|
9994e3932c | |||
f3b51ae5d1 | |||
4007a8a460 | |||
c408c71e97 | |||
8a7e5abc89 | |||
ef483a2122 | |||
42c4d376e4 | |||
e896b20993 | |||
fcebdfaa01 | |||
794436c3ae | |||
027c0ff919 | |||
0148c3a580 | |||
b10a6da29b | |||
8352f6ef02 | |||
896b487bff | |||
f15f44c7aa | |||
98bd3a5d5c | |||
ce05d53365 | |||
3257e14e02 | |||
6e75ef5803 | |||
88f0b2e863 | |||
d87d1248b1 | |||
5512295ae2 | |||
fa30904618 | |||
1871333223 | |||
6fb2fda988 | |||
aaf8fff6fb | |||
a9b5723d0d | |||
c9fcdf15b2 | |||
e1d7e0fdbf | |||
254f905ac2 | |||
6922781198 | |||
5899c77544 | |||
6bffb18f10 | |||
dc43cc1550 | |||
a1c08eb8e0 | |||
12029f86ba | |||
fb54e7da5d | |||
1e7a50ca2a | |||
ae714358ad | |||
98c7eb7d68 |
23
CMakeLists.txt
Normal file
23
CMakeLists.txt
Normal file
@ -0,0 +1,23 @@
|
||||
#----------------------------------------------------------------------------
|
||||
# This file was automatically generated from the original CMakeLists.txt file
|
||||
# Add a variable to hold the headers for the library
|
||||
set (lib_headers
|
||||
exception.hpp
|
||||
exception_ptr.hpp
|
||||
exception
|
||||
)
|
||||
|
||||
# Add a library target to the build system
|
||||
boost_library_project(
|
||||
exception
|
||||
# SRCDIRS
|
||||
TESTDIRS test
|
||||
HEADERS ${lib_headers}
|
||||
DOCDIRS doc
|
||||
DESCRIPTION "A library for transporting of arbitrary data in exception objects, and transporting of exceptions between threads."
|
||||
MODULARIZED
|
||||
AUTHORS "Emil Dotchevski <emil -at- revergestudios.com>"
|
||||
# MAINTAINERS
|
||||
)
|
||||
|
||||
|
61
doc/BOOST_THROW_EXCEPTION.html
Normal file
61
doc/BOOST_THROW_EXCEPTION.html
Normal file
@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>BOOST_THROW_EXCEPTION</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>BOOST_THROW_EXCEPTION</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>></p>
|
||||
<div class="RenoIncludeDIV"><pre>#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
#include <boost/current_function.hpp>
|
||||
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x)\
|
||||
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
|
||||
#else
|
||||
#define <span class="RenoLink">BOOST_THROW_EXCEPTION</span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
|
||||
#endif</pre>
|
||||
</div></div><p>This macro takes an exception object, records BOOST_CURRENT_FUNCTION, __FILE__ and __LINE__ in it, and forwards it to <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. To recover this information at the catch site, use <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>; the information is also included in the message returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="throw_exception_hpp.html">boost/throw_exception.hpp<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
94
doc/boost-exception.html
Normal file
94
doc/boost-exception.html
Normal file
@ -0,0 +1,94 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><h2>Introduction</h2>
|
||||
<p>The purpose of Boost Exception is to ease the design of exception class hierarchies and to help write exception handling and error reporting code.</p>
|
||||
<p>It supports transporting of arbitrary data to the catch site, which is otherwise tricky due to the no-throw requirements (15.5.1) for exception types. Data can be added to any exception object, either directly in the throw-expression (15.1), or at a later time as the exception object propagates up the call stack.</p>
|
||||
<p>The ability to add data to exception objects after they have been passed to throw is important, because often some of the information needed to handle an exception is unavailable in the context where the failure is detected. </p>
|
||||
<p>Boost Exception also supports <span class="RenoLink"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">N2179</a></span>-style <span class="RenoLink"><a href="tutorial_exception_ptr.html">copying</a></span> of exception objects, implemented non-intrusively and automatically by the boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function.</p>
|
||||
<h2>Contents</h2>
|
||||
<div><ol><li><span class="RenoLink"><a href="motivation.html">Motivation</a></span></li>
|
||||
<li>Tutorial<div><ol><li><span class="RenoLink"><a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></span></li>
|
||||
<li><span class="RenoLink"><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags</a></span></li>
|
||||
<li><span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">Using Virtual Inheritance in Exception Types</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tutorial_diagnostic_information.html">Diagnostic Information</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li>Documentation<div><ol><li>Class <span class="RenoLink"><a href="exception.html">exception</a></span></li>
|
||||
<li>Throwing Exceptions<div><ol><li><span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span></li>
|
||||
<li><span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li>Transporting of Arbitrary Data to the Catch Site<div><ol><li><span class="RenoLink"><a href="error_info.html">error_info</a></span></li>
|
||||
<li><span class="RenoLink"><a href="exception_operator_shl.html">exception/operator<<</a></span></li>
|
||||
<li><span class="RenoLink"><a href="tuple_operator_shl.html">tuple/operator<<</a></span></li>
|
||||
<li><span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span></li>
|
||||
<li><span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li><span class="RenoLink"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">N2179</a></span> Transporting of Exceptions between Threads<div><ol><li><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></li>
|
||||
<li><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span></li>
|
||||
<li><span class="RenoLink"><a href="current_exception.html">current_exception</a></span></li>
|
||||
<li><span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span></li>
|
||||
<li><span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span></li>
|
||||
<li><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li>Diagnostic Information<div><ol><li><span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span></li>
|
||||
<li><span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li><span class="RenoLink"><a href="current_exception_cast.html">current_exception_cast</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li>API<div><ol><li><span class="RenoLink"><a href="synopsis.html">Synopsis</a></span></li>
|
||||
<li><span class="RenoLink"><a href="headers.html">Headers</a></span></li>
|
||||
<li><span class="RenoLink"><a href="types.html">Types</a></span></li>
|
||||
<li><span class="RenoLink"><a href="functions.html">Functions</a></span></li>
|
||||
<li><span class="RenoLink"><a href="macros.html">Macros</a></span></li>
|
||||
<li><span class="RenoLink"><a href="configuration_macros.html">Configuration Macros</a></span></li>
|
||||
</ol></div>
|
||||
</li>
|
||||
<li><span class="RenoLink"><a href="frequently_asked_questions.html">Frequently Asked Questions</a></span></li>
|
||||
<li><span class="RenoLink"><a href="page_idx.html">Page Index</a></span></li>
|
||||
</ol></div>
|
||||
<h3>Acknowledgements</h3>
|
||||
<p>Thanks to Peter Dimov for his continuing help. Also thanks to Tobias Schwinger, Tom Brinkman, Pavel Vozenilek and everyone who participated in the review process.</p>
|
||||
</div><!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
54
doc/boost_exception_current_exception_cast_hpp.html
Normal file
54
doc/boost_exception_current_exception_cast_hpp.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/current_exception_cast.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/current_exception_cast.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class E>
|
||||
E * <span class="RenoLink"><a href="current_exception_cast.html">current_exception_cast</a></span>();</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="current_exception_cast.html">current_exception_cast<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
58
doc/configuration_macros.html
Normal file
58
doc/configuration_macros.html
Normal file
@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>configuration macros</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Configuration Macros</h2>
|
||||
</div>
|
||||
<p>Boost Exception responds to the following configuration macros:</p>
|
||||
<p><b>BOOST_NO_RTTI</b><span class="RenoBR"> </span><br/><b>BOOST_NO_TYPEID</b></p>
|
||||
<p>The first macro prevents Boost Exception from using dynamic_cast and dynamic typeid. If the second macro is also defined, Boost Exception does not use static typeid either. There are no observable degrading effects on the library functionality, except for the following:</p>
|
||||
<blockquote><p>By default, the <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template can be called with any exception type. If BOOST_NO_RTTI is defined, <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> can be used only with objects of type boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p></blockquote>
|
||||
<h4>Note:</h4>
|
||||
<p>The library needs RTTI functionality. Disabling the language RTTI support enables an internal RTTI system, which may have more or less overhead depending on the platform.</p>
|
||||
<p><b>BOOST_EXCEPTION_DISABLE</b></p>
|
||||
<p>By default, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> and <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> are integrated directly in the <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function. Defining BOOST_EXCEPTION_DISABLE disables this integration.</p>
|
||||
<p>Note that on some non-conformant compilers, for example MSVC 7.0 and older, as well as BCC, BOOST_EXCEPTION_DISABLE is implicitly defined in <span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>.</p>
|
||||
<p><b>BOOST_NO_EXCEPTIONS</b></p>
|
||||
<p>This macro disables exception handling in Boost, forwarding all exceptions to a user-defined non-template version of boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. However, unless BOOST_EXCEPTION_DISABLE is also defined, users can still examine the exception object for any data added at the point of the throw, or use boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> (of course under BOOST_NO_EXCEPTIONS, the user-defined boost::throw_exception is not allowed to return to the caller.)</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="get_error_info.html">get_error_info<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
64
doc/copy_exception.html
Normal file
64
doc/copy_exception.html
Normal file
@ -0,0 +1,64 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>copy_exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>copy_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class T>
|
||||
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink">copy_exception</span>( T const & e );</span>
|
||||
}</pre>
|
||||
</div><h4>Effects:</h4>
|
||||
<p>As if</p>
|
||||
<pre>try
|
||||
{
|
||||
throw <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(e);
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();
|
||||
}</pre>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
70
doc/current_exception.html
Normal file
70
doc/current_exception.html
Normal file
@ -0,0 +1,70 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>current_exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>current_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink">current_exception</span>();</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>The <span class="RenoLink">current_exception</span> function must not be called outside of a catch block.</p>
|
||||
<h4>Returns:</h4>
|
||||
<div><ul><li> An <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to the currently handled exception or a copy of the currently handled exception.</li>
|
||||
<li> If the function needs to allocate memory and the attempt fails, it returns an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of std::bad_alloc.</li>
|
||||
</ul></div>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
<h4>Notes:</h4>
|
||||
<div><ul><li> It is unspecified whether the return values of two successive calls to <span class="RenoLink">current_exception</span> refer to the same exception object.</li>
|
||||
<li> Correct implementation of <span class="RenoLink">current_exception</span> may require compiler support, unless <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was used at the time the currently handled exception object was passed to throw. If <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was not used, and if the compiler does not provide the necessary support, then <span class="RenoLink">current_exception</span> may return an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> that refers to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>. In this case, if the original exception object derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, then the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> sub-object of the <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span> object is initialized by the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> copy constructor.</li>
|
||||
</ul></div>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
|
||||
</a><a href="copy_exception.html">copy_exception<br/>
|
||||
</a><a href="enable_current_exception.html">enable_current_exception<br/>
|
||||
</a><a href="exception_ptr.html">exception_ptr<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="unknown_exception.html">unknown_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
60
doc/current_exception_cast.html
Normal file
60
doc/current_exception_cast.html
Normal file
@ -0,0 +1,60 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>current_exception_cast</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>current_exception_cast</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class E>
|
||||
E * <span class="RenoLink">current_exception_cast</span>();</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>This function must not be called outside of a catch block.</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>A pointer of type E to the current exception object, or null if the current exception object can not be converted to E *.</p>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
77
doc/current_exception_diagnostic_information.html
Normal file
77
doc/current_exception_diagnostic_information.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>current_exception_diagnostic_information</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>current_exception_diagnostic_information</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>><span class="RenoBR"> </span><br/></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> std::string <span class="RenoLink">current_exception_diagnostic_information</span>();</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>This function must not be called outside of a catch block.</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>If the current exception object can be converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span> or std::exception, this function returns the same string value returned by <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> for the current exception object. Otherwise, an unspecified non-empty string is returned.</p>
|
||||
<p>Typical use is to call <span class="RenoLink">current_exception_diagnostic_information</span> from a top-level function to output diagnostic information about unhandled exceptions:</p>
|
||||
<pre>int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
run_program();
|
||||
}
|
||||
catch(
|
||||
error & e )
|
||||
{
|
||||
//handle error
|
||||
}
|
||||
catch(
|
||||
...)
|
||||
{
|
||||
std::cerr << "Unhandled exception!" << std::endl <<
|
||||
boost::<span class="RenoLink">current_exception_diagnostic_information</span>();
|
||||
}
|
||||
}</pre>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
90
doc/diagnostic_information.html
Normal file
90
doc/diagnostic_information.html
Normal file
@ -0,0 +1,90 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>diagnostic_information</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>diagnostic_information</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>><span class="RenoBR"> </span><br/></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class E>
|
||||
std::string <span class="RenoLink">diagnostic_information</span>( E const & e );</span>
|
||||
}</pre>
|
||||
</div><h4>Returns:</h4>
|
||||
<p>A string value that contains varying amount of implementation-specific diagnostic information about the passed exception object:</p>
|
||||
<div><ul><li>If E can be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, the returned value contains the string representations of all <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects stored in the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span>, along with other diagnostic information relevant to the exception. If e can be dynamically converted to std::exception, the returned value also contains the what() string.</li>
|
||||
<li>Otherwise, if E can be statically converted std::exception:<div><ul><li>if e can be dynamically converted to boost::exception, the returned value is the same as if E could be statically converted to boost::<span class="RenoLink"><a href="exception.html">exception</a></span>;</li>
|
||||
<li>otherwise the returned value contains the what() string.</li>
|
||||
</ul></div>
|
||||
</li>
|
||||
<li>Otherwise, the boost::<span class="RenoLink">diagnostic_information</span> template is not available.</li>
|
||||
</ul></div>
|
||||
<p>The string representation of each <span class="RenoLink"><a href="error_info.html">error_info</a></span> object is deduced by a function call that is bound at the time the <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> template is instantiated. The following overload resolutions are attempted in order:</p>
|
||||
<div><ol><li>Unqualified call to to_string(x), where x is of type <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> (the return value is expected to be of type std::string.)</li>
|
||||
<li>Unqualified call to to_string(x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>()) (the return value is expected to be of type std::string.)</li>
|
||||
<li>Unqualified call to s << x.<span class="RenoLink"><a href="error_info_value.html">value</a></span>(), where s is a std::ostringstream.</li>
|
||||
</ol></div>
|
||||
<p>The first successfully bound function is used at the time <span class="RenoLink">diagnostic_information</span> is called; if all 3 overload resolutions are unsuccessful, the system is unable to convert the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object to string, and <i>an unspecified stub string value is used without issuing a compile error.</i></p>
|
||||
<h4>Notes:</h4>
|
||||
<div><ul><li>The format of the returned string is unspecified.</li>
|
||||
<li>The returned string is <i>not</i> user-friendly.</li>
|
||||
<li>The returned string may include additional platform-specific diagnostic information.</li>
|
||||
</ul></div>
|
||||
<div class="RenoIncludeDIV"><h4>Example:</h4>
|
||||
<p>this is a possible output from the <span class="RenoLink">diagnostic_information</span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
|
||||
<pre>example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
|
||||
Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error>
|
||||
std::exception::what: example_io error
|
||||
[struct tag_errno *] = 2, OS says "No such file or directory"
|
||||
[struct tag_file_name *] = tmp1.txt
|
||||
[struct tag_function *] = fopen
|
||||
[struct tag_open_mode *] = rb</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
|
||||
</a><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/>
|
||||
</a><a href="configuration_macros.html">Configuration Macros<br/>
|
||||
</a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/>
|
||||
</a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a><a href="throw_exception.html">throw_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
77
doc/enable_current_exception.html
Normal file
77
doc/enable_current_exception.html
Normal file
@ -0,0 +1,77 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>enable_current_exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>enable_current_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class T>
|
||||
---unspecified--- <span class="RenoLink">enable_current_exception</span>( T const & e );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>T must be a class with an accessible no-throw copy constructor.</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>An object of <i>unspecified</i> type which derives publicly from T. That is, the returned object can be intercepted by a catch(T &).</p>
|
||||
<h4>Description:</h4>
|
||||
<p>This function is designed to be used directly in a throw-expression to enable the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> support in Boost Exception. For example:</p>
|
||||
<pre>class
|
||||
my_exception:
|
||||
public std::exception
|
||||
{
|
||||
};
|
||||
|
||||
....
|
||||
throw boost::<span class="RenoLink">enable_current_exception</span>(my_exception());</pre>
|
||||
<p>Unless <span class="RenoLink">enable_current_exception</span> is called at the time an exception object is used in a throw-expression, an attempt to copy it using <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> may return an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> which refers to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>. See <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> for details.</p>
|
||||
<h4>Note:</h4>
|
||||
<p>Instead of using the throw keyword directly, it is preferable to call boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. This is guaranteed to throw an exception that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and supports the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> functionality.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/>
|
||||
</a><a href="configuration_macros.html">Configuration Macros<br/>
|
||||
</a><a href="copy_exception.html">copy_exception<br/>
|
||||
</a><a href="current_exception.html">current_exception<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads<br/>
|
||||
</a><a href="throw_exception.html">throw_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
67
doc/enable_error_info.html
Normal file
67
doc/enable_error_info.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>enable_error_info</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>enable_error_info</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class T>
|
||||
---unspecified--- <span class="RenoLink">enable_error_info</span>( T const & x );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>T must be a class with an accessible no-throw copy constructor as per (15.5.1).</p>
|
||||
<h4>Returns:</h4>
|
||||
<div><ul><li> If T derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, the returned object is of type T and is a copy of x.</li>
|
||||
<li> Otherwise, the returned object is of an unspecified type that derives publicly from both T and boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. The T sub-object is initialized from x by the T copy constructor.</li>
|
||||
</ul></div>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
|
||||
</a><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/>
|
||||
</a><a href="configuration_macros.html">Configuration Macros<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
|
||||
</a><a href="throw_exception.html">throw_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
98
doc/error_info.html
Normal file
98
doc/error_info.html
Normal file
@ -0,0 +1,98 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>error_info</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>error_info</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class Tag,class T>
|
||||
class
|
||||
<span class="RenoLink">error_info</span>
|
||||
{
|
||||
public:
|
||||
|
||||
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & v );</span>
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & <span class="RenoLink"><a href="error_info_value.html">value</a></span>() const;</span>
|
||||
};</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>T must have accessible copy constructor and must not be a reference (there is no requirement that T's copy constructor does not throw.)</p>
|
||||
<h4>Description:</h4>
|
||||
<p>This class template is used to associate a Tag type with a value type T. Objects of type <span class="RenoLink">error_info</span><Tag,T> can be passed to <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span> to be stored in objects of type boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<h4>Usage:</h4>
|
||||
<p>The header <<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>> provides a declaration of the <span class="RenoLink">error_info</span> template, which is sufficient for the purpose of typedefing an instance for specific Tag and T, for example:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>>
|
||||
|
||||
struct tag_errno;
|
||||
typedef boost::<span class="RenoLink">error_info</span><tag_errno,int> errno_info;</pre>
|
||||
<p>Or, the shorter equivalent:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>>
|
||||
|
||||
typedef boost::<span class="RenoLink">error_info</span><struct tag_errno,int> errno_info;</pre>
|
||||
<p>This errno_info typedef can be passed to <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span> (#include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>> first) to store an int named tag_errno in exceptions of types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p>
|
||||
<pre>throw file_read_error() <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> errno_info(errno);</pre>
|
||||
<p>It can also be passed to <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> (#include <<span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>> first) to retrieve the tag_errno int from a boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p>
|
||||
<pre>catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> & x )
|
||||
{
|
||||
if( int const * e=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span><errno_info>(x) )
|
||||
....
|
||||
}</pre>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp<br/>
|
||||
</a><a href="exception_exception_hpp.html">boost/exception/exception.hpp<br/>
|
||||
</a><a href="exception_error_info_hpp.html">boost/exception/info.hpp<br/>
|
||||
</a><a href="diagnostic_information.html">diagnostic_information<br/>
|
||||
</a><a href="error_info_error_info.html">error_info::error_info<br/>
|
||||
</a><a href="error_info_value.html">error_info::value<br/>
|
||||
</a><a href="error_info_value_type.html">error_info::value_type<br/>
|
||||
</a><a href="exception.html">exception<br/>
|
||||
</a><a href="exception_operator_shl.html">exception/operator<<<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="get_error_info.html">get_error_info<br/>
|
||||
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a><a href="tuple_operator_shl.html">tuple/operator<<<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
52
doc/error_info_error_info.html
Normal file
52
doc/error_info_error_info.html
Normal file
@ -0,0 +1,52 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>error_info::error_info</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>error_info::error_info</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN"><span class="RenoLink">error_info</span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & v );</span></pre>
|
||||
</div><h4>Effects:</h4>
|
||||
<p>Stores a copy of v in the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object.</p>
|
||||
<div class="RenoIncludeDIV"><h4>Throws:</h4>
|
||||
<p>Any exception emitted by v's copy constructor.</p>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="error_info.html">error_info<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
53
doc/error_info_value.html
Normal file
53
doc/error_info_value.html
Normal file
@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>error_info::value</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>error_info::value</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN"><span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & <span class="RenoLink">value</span>() const;</span></pre>
|
||||
</div><h4>Description:</h4>
|
||||
<p>Returns a const reference to the copy of the value passed to <span class="RenoLink"><a href="error_info.html">error_info</a></span>'s constructor stored in the <span class="RenoLink"><a href="error_info.html">error_info</a></span> object.</p>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="diagnostic_information.html">diagnostic_information<br/>
|
||||
</a><a href="error_info.html">error_info<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
53
doc/error_info_value_type.html
Normal file
53
doc/error_info_value_type.html
Normal file
@ -0,0 +1,53 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>error_info::value_type</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>error_info::value_type</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">typedef T <span class="RenoLink">value_type</span>;</span></pre>
|
||||
</div><h4>Definition:</h4>
|
||||
<p>The expression <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T>::<span class="RenoLink">value_type</span> evaluates to T.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="error_info.html">error_info<br/>
|
||||
</a><a href="error_info_error_info.html">error_info::error_info<br/>
|
||||
</a><a href="error_info_value.html">error_info::value<br/>
|
||||
</a><a href="get_error_info.html">get_error_info<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
85
doc/exception.html
Normal file
85
doc/exception.html
Normal file
@ -0,0 +1,85 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> class
|
||||
<span class="RenoLink">exception</span>
|
||||
{
|
||||
protected:
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_constructors.html">exception</a></span>();
|
||||
<span class="RenoLink"><a href="exception_constructors.html">exception</a></span>( <span class="RenoLink">exception</span> const & x );</span>
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
|
||||
};</span>
|
||||
}</pre>
|
||||
</div><p>Class boost::<span class="RenoLink">exception</span> is designed to be used as a universal base for user-defined exception types.</p>
|
||||
<p>An object of any type deriving from boost::<span class="RenoLink">exception</span> can store data of arbitrary types, using the <span class="RenoLink"><a href="error_info.html">error_info</a></span> wrapper and <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span>.</p>
|
||||
<p>To retrieve data from a boost::<span class="RenoLink">exception</span> object, use the <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template.</p>
|
||||
</div><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp<br/>
|
||||
</a><a href="exception_exception_hpp.html">boost/exception/exception.hpp<br/>
|
||||
</a><a href="configuration_macros.html">Configuration Macros<br/>
|
||||
</a><a href="current_exception.html">current_exception<br/>
|
||||
</a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/>
|
||||
</a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
|
||||
</a><a href="diagnostic_information.html">diagnostic_information<br/>
|
||||
</a><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags<br/>
|
||||
</a><a href="enable_current_exception.html">enable_current_exception<br/>
|
||||
</a><a href="enable_error_info.html">enable_error_info<br/>
|
||||
</a><a href="error_info.html">error_info<br/>
|
||||
</a><a href="exception_operator_shl.html">exception/operator<<<br/>
|
||||
</a><a href="exception_constructors.html">exception::exception<br/>
|
||||
</a><a href="exception_destructor.html">exception::~exception<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="get_error_info.html">get_error_info<br/>
|
||||
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a><a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site<br/>
|
||||
</a><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads<br/>
|
||||
</a><a href="tuple_operator_shl.html">tuple/operator<<<br/>
|
||||
</a><a href="using_virtual_inheritance_in_exception_types.html">Using Virtual Inheritance in Exception Types<br/>
|
||||
</a><a href="unknown_exception.html">unknown_exception<br/>
|
||||
</a></div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
75
doc/exception_cloning_hpp.html
Normal file
75
doc/exception_cloning_hpp.html
Normal file
@ -0,0 +1,75 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception_ptr.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception_ptr.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
|
||||
<span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>:
|
||||
public std::exception
|
||||
public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
|
||||
{
|
||||
---unspecified---
|
||||
};</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">template <class T>
|
||||
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>( T const & e );</span>
|
||||
|
||||
<span class="RenoIncludeSPAN"><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const & ep );</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
|
||||
</a><a href="copy_exception.html">copy_exception<br/>
|
||||
</a><a href="current_exception.html">current_exception<br/>
|
||||
</a><a href="exception_ptr.html">exception_ptr<br/>
|
||||
</a><a href="rethrow_exception.html">rethrow_exception<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a><a href="unknown_exception.html">unknown_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
54
doc/exception_constructors.html
Normal file
54
doc/exception_constructors.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>exception::exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception::exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><pre><span class="RenoLink">exception</span>();
|
||||
<span class="RenoLink">exception</span>( <span class="RenoLink"><a href="exception.html">exception</a></span> const & x );</pre>
|
||||
</div><h4>Effects:</h4>
|
||||
<div><ul><li> Default constructor: initializes an empty boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object.</li>
|
||||
<li> Copy constructor: initializes a boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object which shares ownership with x of all data added through <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span>, including data that is added at a future time.</li>
|
||||
</ul></div>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception.html">exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
51
doc/exception_destructor.html
Normal file
51
doc/exception_destructor.html
Normal file
@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>exception::~exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception::~exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><pre><span class="RenoLink">~exception</span>();</pre>
|
||||
</div><h4>Effects:</h4>
|
||||
<p>Frees all resources associated with a boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object.</p>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception.html">exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
62
doc/exception_diagnostic_information_hpp.html
Normal file
62
doc/exception_diagnostic_information_hpp.html
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/diagnostic_information.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/diagnostic_information.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>#include <string>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class E>
|
||||
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const & e );</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
|
||||
</a><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information<br/>
|
||||
</a><a href="diagnostic_information.html">diagnostic_information<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
56
doc/exception_enable_current_exception_hpp.html
Normal file
56
doc/exception_enable_current_exception_hpp.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/enable_current_exception.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>boost/exception/enable_current_exception.hpp</h3>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class T>
|
||||
---unspecified--- <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>( T const & e );</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="enable_current_exception.html">enable_current_exception<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
56
doc/exception_enable_error_info_hpp.html
Normal file
56
doc/exception_enable_error_info_hpp.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/enable_error_info.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>boost/exception/enable_error_info.hpp</h3>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class T>
|
||||
---unspecified--- <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>( T const & x );</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="enable_error_info.html">enable_error_info<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
62
doc/exception_error_info_group_hpp.html
Normal file
62
doc/exception_error_info_group_hpp.html
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/info_tuple.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/info_tuple.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>#include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class E, class Tag1, class T1, ..., class TagN, class TN>
|
||||
E const & <span class="RenoLink"><a href="tuple_operator_shl.html">operator<<</a></span>( E const & x,
|
||||
<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span><
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag1,T1>,
|
||||
...,
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><TagN,TN> > const & v );</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a><a href="tuple_operator_shl.html">tuple/operator<<<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
74
doc/exception_error_info_hpp.html
Normal file
74
doc/exception_error_info_hpp.html
Normal file
@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/info.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/info.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class Tag,class T>
|
||||
class
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span>
|
||||
{
|
||||
public:
|
||||
|
||||
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & v );</span>
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & <span class="RenoLink"><a href="error_info_value.html">value</a></span>() const;</span>
|
||||
};</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">template <class E, class Tag, class T>
|
||||
E const & <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span>( E const & x, <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> const & v );</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
|
||||
</a><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp<br/>
|
||||
</a><a href="error_info.html">error_info<br/>
|
||||
</a><a href="error_info_error_info.html">error_info::error_info<br/>
|
||||
</a><a href="error_info_value.html">error_info::value<br/>
|
||||
</a><a href="error_info_value_type.html">error_info::value_type<br/>
|
||||
</a><a href="exception_operator_shl.html">exception/operator<<<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
55
doc/exception_error_info_value_hpp.html
Normal file
55
doc/exception_error_info_value_hpp.html
Normal file
@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/error_info.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/error_info.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class Tag,class T>
|
||||
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
|
||||
</a><a href="error_info.html">error_info<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
74
doc/exception_exception_hpp.html
Normal file
74
doc/exception_exception_hpp.html
Normal file
@ -0,0 +1,74 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/exception.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/exception.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
|
||||
<span class="RenoLink"><a href="exception.html">exception</a></span>
|
||||
{
|
||||
protected:
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_constructors.html">exception</a></span>();
|
||||
<span class="RenoLink"><a href="exception_constructors.html">exception</a></span>( <span class="RenoLink"><a href="exception.html">exception</a></span> const & x );</span>
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
|
||||
};</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">template <class Tag,class T>
|
||||
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
|
||||
|
||||
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_throw_function,char const *> throw_function;
|
||||
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_throw_file,char const *> throw_file;
|
||||
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_throw_line,int> throw_line;</span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
|
||||
</a><a href="exception_hpp.html">boost/exception.hpp<br/>
|
||||
</a><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp<br/>
|
||||
</a><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp<br/>
|
||||
</a><a href="exception_error_info_hpp.html">boost/exception/info.hpp<br/>
|
||||
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
|
||||
</a><a href="exception.html">exception<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
56
doc/exception_get_error_info_hpp.html
Normal file
56
doc/exception_get_error_info_hpp.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception/get_error_info.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception/get_error_info.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre>#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class ErrorInfo,class E>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const * <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>( E const & x );</span></span>
|
||||
}</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
|
||||
</a><a href="error_info.html">error_info<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
56
doc/exception_hpp.html
Normal file
56
doc/exception_hpp.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/exception.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/exception.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#include <<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></span></pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
|
||||
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
71
doc/exception_operator_shl.html
Normal file
71
doc/exception_operator_shl.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>exception/operator<<</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception/operator<<</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>><span class="RenoBR"> </span><br/></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class E, class Tag, class T>
|
||||
E const & <span class="RenoLink">operator<<</span>( E const & x, <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> const & v );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>E must be boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, or a type that derives (indirectly) from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<h4>Effects:</h4>
|
||||
<p>Stores a copy of v into x. If x already contains data of type <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T>, that data is overwritten.</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>x.</p>
|
||||
<div class="RenoIncludeDIV"><h4>Throws:</h4>
|
||||
<p>std::bad_alloc, or any exception emitted by the T copy constructor.</p>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_error_info_hpp.html">boost/exception/info.hpp<br/>
|
||||
</a><a href="tutorial_diagnostic_information.html">Diagnostic Information<br/>
|
||||
</a><a href="diagnostic_information.html">diagnostic_information<br/>
|
||||
</a><a href="error_info.html">error_info<br/>
|
||||
</a><a href="exception.html">exception<br/>
|
||||
</a><a href="exception_constructors.html">exception::exception<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="get_error_info.html">get_error_info<br/>
|
||||
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
67
doc/exception_ptr.html
Normal file
67
doc/exception_ptr.html
Normal file
@ -0,0 +1,67 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>exception_ptr</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>exception_ptr</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> typedef ---unspecified--- <span class="RenoLink">exception_ptr</span>;</span>
|
||||
}</pre>
|
||||
</div><p>The <span class="RenoLink">exception_ptr</span> type can be used to refer to a copy of an exception object. It is Default Constructible, Copy Constructible, Assignable and Equality Comparable; <span class="RenoLink">exception_ptr</span>'s operations do not throw.</p>
|
||||
<p>Two instances of <span class="RenoLink">exception_ptr</span> are equivalent and compare equal if and only if they refer to the same exception.</p>
|
||||
<p>The default constructor of <span class="RenoLink">exception_ptr</span> produces the null value of the type. The null value is equivalent only to itself.</p>
|
||||
<h4>Thread safety</h4>
|
||||
<div><ul><li> It is legal for multiple threads to hold <span class="RenoLink">exception_ptr</span> references to the same exception object.</li>
|
||||
<li> It is illegal for multiple threads to modify the same <span class="RenoLink">exception_ptr</span> object concurrently.</li>
|
||||
<li> While calling <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> makes a copy of the current exception object, it is still possible for the two copies to share internal state. Therefore, in general it is not safe to call <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> concurrently to throw the same exception object into multiple threads.</li>
|
||||
</ul></div>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
|
||||
</a><a href="copy_exception.html">copy_exception<br/>
|
||||
</a><a href="current_exception.html">current_exception<br/>
|
||||
</a><a href="enable_current_exception.html">enable_current_exception<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="rethrow_exception.html">rethrow_exception<br/>
|
||||
</a><a href="unknown_exception.html">unknown_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
56
doc/exception_types_as_simple_semantic_tags.html
Normal file
56
doc/exception_types_as_simple_semantic_tags.html
Normal file
@ -0,0 +1,56 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>exception types as simple semantic tags</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Exception Types as Simple Semantic Tags</h3>
|
||||
</div>
|
||||
<p>Deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> effectively decouples the semantics of a failure from the information that is relevant to each individual instance of reporting a failure with a given semantic.</p>
|
||||
<p>In other words: with boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, what data a given exception object transports depends primarily on the context in which failures are reported (not on its type.) Since exception types need no members, it becomes very natural to throw exceptions that derive from more than one type to indicate multiple appropriate semantics:</p>
|
||||
<pre>struct exception_base: virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
|
||||
struct io_error: virtual exception_base { };
|
||||
struct file_error: virtual io_error { };
|
||||
struct read_error: virtual io_error { };
|
||||
struct file_read_error: virtual file_error, virtual read_error { };</pre>
|
||||
<p>Using this approach, exception types become a simple tagging system for categorizing errors and selecting failures in exception handlers.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a><a href="using_virtual_inheritance_in_exception_types.html">Using Virtual Inheritance in Exception Types<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
105
doc/frequently_asked_questions.html
Normal file
105
doc/frequently_asked_questions.html
Normal file
@ -0,0 +1,105 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>frequently asked questions</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Frequently Asked Questions</h2>
|
||||
</div>
|
||||
<h3>Why doesn't boost::exception derive from std::exception?</h3>
|
||||
<p>Despite that <span class="RenoLink"><a href="using_virtual_inheritance_in_exception_types.html">virtual inheritance should be used in deriving from base exception types</a></span>, many programmers fail to follow this principle when deriving from std::exception. If boost::<span class="RenoLink"><a href="exception.html">exception</a></span> derives from std::exception, using the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function with such user-defined types would introduce dangerous ambiguity which would break all catch(std::exception &) statements.</p>
|
||||
<p>Of course, boost::<span class="RenoLink"><a href="exception.html">exception</a></span> should not be used to replace std::exception as a base type in exception type hierarchies. Instead, it should be included as a virtual base, in addition to std::exception (which should also be derived virtually.)</p>
|
||||
<h3>Why is boost::exception abstract?</h3>
|
||||
<p>To prevent exception-neutral contexts from erroneously erasing the type of the original exception when adding <span class="RenoLink"><a href="error_info.html">error_info</a></span> to an active exception object:</p>
|
||||
<pre>catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> & e )
|
||||
{
|
||||
e <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> foo_info(foo);
|
||||
throw e; //Compile error: boost::<span class="RenoLink"><a href="exception.html">exception</a></span> is abstract
|
||||
}</pre>
|
||||
<p>The correct code is:</p>
|
||||
<pre>catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> & e )
|
||||
{
|
||||
e <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> foo_info(foo);
|
||||
throw; //Okay, re-throwing the original exception object.
|
||||
}</pre>
|
||||
<h3>What is the space overhead of the boost::exception base class?</h3>
|
||||
<p>The space overhead for the boost::exception data members is negligible in the context of exception handling. Throwing objects that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> does not by itself cause dynamic memory allocations.</p>
|
||||
<p>Deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> enables any data to be added to exceptions, which usually does allocate memory. However, this memory is reclaimed when the exception has been handled, and since typically user code does not allocate memory during the unrolling of the stack, adding error info to exceptions should not cause memory fragmentation.</p>
|
||||
<h3>Should I use boost::throw_exception or BOOST_THROW_EXCEPTION or just throw?</h3>
|
||||
<p>The benefit of calling boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> instead of using throw directly is that it ensures that the emitted exception derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and that it is compatible with boost::<span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p>
|
||||
<p>The <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> macro also results in a call to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>, but in addition it records in the exception object the __FILE__ and __LINE__ of the throw, as well as the pretty name of the function that throws. This has virtually no overhead, yet enables boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> to compose a more useful, if not user-friendly message.</p>
|
||||
<p>Typical use of boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> is:</p>
|
||||
<pre>catch( boost::exception & e )
|
||||
{
|
||||
std::cerr << "OMG!" << boost::diagnostic_information(e);
|
||||
}
|
||||
catch( ... )
|
||||
{
|
||||
std::cerr << "OMG!!!";
|
||||
}</pre>
|
||||
<p>This is a possible message it may display, the first line is only possible if <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span> is used:</p>
|
||||
<pre>example_io.cpp(83): Throw in function void parse_file(const char *)
|
||||
Dynamic exception type: class file_open_error
|
||||
std::exception::what: example_io error
|
||||
[struct tag_errno_code *] = 2, OS says "No such file or directory"
|
||||
[struct tag_file_name *] = tmp1.xml
|
||||
[struct tag_function *] = fopen
|
||||
[struct tag_open_mode *] = rb</pre>
|
||||
<h3>Why is boost::exception integrated in boost::throw_exception?</h3>
|
||||
<p>The boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> function predates the Boost Exception library and there has been some concern about its current behavior of injecting boost::<span class="RenoLink"><a href="exception.html">exception</a></span> as a base of any exception passed to boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>. Such concerns are dictated by the typical strict interpretation of a common principle in C and C++, that users only pay for features they actually use.</p>
|
||||
<p>The problem is that users of Boost Exception can't by themselves cause a library to throw types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, and without this they can't use any of the Boost Exception facilities.</p>
|
||||
<p>For example, if a user wants to use Boost Serialization in a separate thread, it is desirable to be able to transport exceptions emitted by that library into the main thread where they can be analyzed to generate a user-friendly message. This can be easily achieved using boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>, but this requires that Boost Serialization throws exceptions using boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>. If Boost Serialization calls boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> to throw, this behavior happens automatically and transparently.</p>
|
||||
<p>The cost of this integration is:</p>
|
||||
<div><ul><li> In terms of space: a pointer and 3 ints are added to the static size of exception objects.</li>
|
||||
<li> In terms of speed: the pointer is initialized to null at the point of the throw.</li>
|
||||
<li> In terms of coupling: about 400 self-contained lines of C++ with no external includes.</li>
|
||||
</ul></div>
|
||||
<h3>Why use operator<< overload for adding info to exceptions?</h3>
|
||||
<p>Before throwing an object of type that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, it is often desirable to add one or more <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects in it. The syntactic sugar provided by <span class="RenoLink"><a href="exception_operator_shl.html">exception/operator<<</a></span> allows this to be done directly in a throw expression:</p>
|
||||
<pre>throw error() <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> foo_info(foo) <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> bar_info(bar);</pre>
|
||||
<p>which saves typing compared to this possible alternative:</p>
|
||||
<pre>error e;
|
||||
e.add(foo_info(foo));
|
||||
e.add(bar_info(bar));
|
||||
throw e;</pre>
|
||||
<p>and looks better than something like:</p>
|
||||
<pre>throw error().add(foo_info(foo)).add(bar_info(bar));</pre>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
69
doc/functions.html
Normal file
69
doc/functions.html
Normal file
@ -0,0 +1,69 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>Functions</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Functions</h2>
|
||||
</div>
|
||||
<div class="RenoIndex"><h3>c</h3>
|
||||
<p><a href="copy_exception.html">copy_exception</a></p>
|
||||
<p><a href="current_exception.html">current_exception</a></p>
|
||||
<p><a href="current_exception_cast.html">current_exception_cast</a></p>
|
||||
<p><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></p>
|
||||
<h3>d</h3>
|
||||
<p><a href="diagnostic_information.html">diagnostic_information</a></p>
|
||||
<h3>e</h3>
|
||||
<p><a href="enable_current_exception.html">enable_current_exception</a></p>
|
||||
<p><a href="enable_error_info.html">enable_error_info</a></p>
|
||||
<p><a href="error_info_error_info.html">error_info::error_info</a></p>
|
||||
<p><a href="error_info_value.html">error_info::value</a></p>
|
||||
<p><a href="exception_operator_shl.html">exception/operator<<</a></p>
|
||||
<p><a href="exception_constructors.html">exception::exception</a></p>
|
||||
<p><a href="exception_destructor.html">exception::~exception</a></p>
|
||||
<h3>g</h3>
|
||||
<p><a href="get_error_info.html">get_error_info</a></p>
|
||||
<h3>r</h3>
|
||||
<p><a href="rethrow_exception.html">rethrow_exception</a></p>
|
||||
<h3>t</h3>
|
||||
<p><a href="throw_exception.html">throw_exception</a></p>
|
||||
<p><a href="tuple_operator_shl.html">tuple/operator<<</a></p>
|
||||
</div>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
71
doc/get_error_info.html
Normal file
71
doc/get_error_info.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>get_error_info</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>get_error_info</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class ErrorInfo,class E>
|
||||
typename ErrorInfo::<span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const * <span class="RenoLink">get_error_info</span>( E const & x );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<div><ul><li> ErrorInfo must be an instance of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template.</li>
|
||||
<li> E must be polymorphic.</li>
|
||||
</ul></div>
|
||||
<h4>Returns:</h4>
|
||||
<div><ul><li> If dynamic_cast<boost::<span class="RenoLink"><a href="exception.html">exception</a></span> const *>(&x) is 0, or if x does not store an object of type ErrorInfo, the returned value is null.</li>
|
||||
<li> Otherwise, the returned pointer points to the stored value (use <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span> to store values in exception objects.) When x is destroyed, any pointers returned by <span class="RenoLink">get_error_info</span> become invalid.</li>
|
||||
</ul></div>
|
||||
<h4>Throws:</h4>
|
||||
<p>Nothing.</p>
|
||||
<h4>Note:</h4>
|
||||
<p>The interface of <span class="RenoLink">get_error_info</span> may be affected by the build <span class="RenoLink"><a href="configuration_macros.html">configuration macros</a></span>.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
|
||||
</a><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp<br/>
|
||||
</a><a href="configuration_macros.html">Configuration Macros<br/>
|
||||
</a><a href="error_info.html">error_info<br/>
|
||||
</a><a href="exception.html">exception<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a><a href="throw_exception.html">throw_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
61
doc/headers.html
Normal file
61
doc/headers.html
Normal file
@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>Headers</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Headers</h2>
|
||||
</div>
|
||||
<div class="RenoIndex"><h3>e</h3>
|
||||
<p><a href="exception_hpp.html">boost/exception.hpp</a></p>
|
||||
<p><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></p>
|
||||
<p><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></p>
|
||||
<p><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></p>
|
||||
<p><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></p>
|
||||
<p><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></p>
|
||||
<p><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></p>
|
||||
<p><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></p>
|
||||
<p><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></p>
|
||||
<p><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></p>
|
||||
<p><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></p>
|
||||
<h3>t</h3>
|
||||
<p><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></p>
|
||||
</div>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
48
doc/macros.html
Normal file
48
doc/macros.html
Normal file
@ -0,0 +1,48 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>Macros</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Macros</h2>
|
||||
</div>
|
||||
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
|
||||
</a></div>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
148
doc/motivation.html
Normal file
148
doc/motivation.html
Normal file
@ -0,0 +1,148 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>Motivation</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Motivation</h3>
|
||||
</div>
|
||||
<p>Traditionally, when using exceptions to report failures, the throw site:</p>
|
||||
<div><ul><li>creates an exception object of the appropriate type, and</li>
|
||||
<li>stuffs it with data relevant to the detected error.</li>
|
||||
</ul></div>
|
||||
<p>A higher context in the program contains a catch statement which:</p>
|
||||
<div><ul><li>selects failures based on exception types, and</li>
|
||||
<li>inspects exception objects for data required to deal with the problem.</li>
|
||||
</ul></div>
|
||||
<p>The main issue with this "traditional" approach is that often, the data available at the point of the throw is insufficient for the catch site to handle the failure.</p>
|
||||
<p>Here is an example of a catch statement:</p>
|
||||
<pre>catch( file_read_error & e )
|
||||
{
|
||||
std::cerr << e.file_name();
|
||||
}</pre>
|
||||
<p>And here is a possible matching throw:</p>
|
||||
<pre>void
|
||||
read_file( FILE * f )
|
||||
{
|
||||
....
|
||||
size_t nr=fread(buf,1,count,f);
|
||||
if( ferror(f) )
|
||||
throw file_read_error(???);
|
||||
....
|
||||
}</pre>
|
||||
<p>Clearly, the problem is that the handler requires a file name but the read_file function does not have a file name to put in the exception object; all it has is a FILE pointer!</p>
|
||||
<p>In an attempt to deal with this problem, we could modify read_file to accept a file name:</p>
|
||||
<pre>void
|
||||
read_file( FILE * f, char const * name )
|
||||
{
|
||||
....
|
||||
size_t nr=fread(buf,1,count,f);
|
||||
if( ferror(f) )
|
||||
throw file_read_error(name);
|
||||
....
|
||||
}</pre>
|
||||
<p>This is not a real solution: it simply shifts the burden of supplying a file name to the immediate caller of the read_file function.</p>
|
||||
<blockquote><p><i>In general, the data required to handle a given library-emitted exception depends on the program that links to it. Many contexts between the throw and the catch may have relevant information which must be transported to the exception handler.</i></p></blockquote>
|
||||
<h3>Exception wrapping</h3>
|
||||
<p>The idea of exception wrapping is to catch an exception from a lower level function (such as the read_file function above), and throw a new exception object that contains the original exception (and also carries a file name.) This method seems to be particularly popular with C++ programmers with Java background.</p>
|
||||
<p>Exception wrapping leads to the following problems:</p>
|
||||
<div><ul><li>To wrap an exception object it must be copied, which may result in slicing.</li>
|
||||
<li>Wrapping is practically impossible to use in generic contexts.</li>
|
||||
</ul></div>
|
||||
<p>The second point is actually special case of violating the exception neutrality principle. Most contexts in a program can not handle exceptions; such contexts should not interfere with the process of exception handling.</p>
|
||||
<h3>The boost::exception solution</h3>
|
||||
<div><ul><li>Simply derive your exception types from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</li>
|
||||
<li>Confidently limit the throw site to provide only data that is available naturally.</li>
|
||||
<li>Use exception-neutral contexts between the throw and the catch to augment exceptions with more relevant data as they bubble up.</li>
|
||||
</ul></div>
|
||||
<p>For example, in the throw statement below we only add the errno code, since this is the only failure-relevant information available in this context:</p>
|
||||
<pre>struct exception_base: virtual std::exception, virtual boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
|
||||
struct io_error: virtual exception_base { };
|
||||
struct file_read_error: virtual io_error { };
|
||||
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_errno_code,int> errno_code;
|
||||
|
||||
void
|
||||
read_file( FILE * f )
|
||||
{
|
||||
....
|
||||
size_t nr=fread(buf,1,count,f);
|
||||
if( ferror(f) )
|
||||
throw file_read_error() <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> errno_code(errno);
|
||||
....
|
||||
}</pre>
|
||||
<p>In a higher exception-neutral context, we add the file name to <i>any</i> exception that derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p>
|
||||
<pre>typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_file_name,std::string> file_name;
|
||||
|
||||
....
|
||||
try
|
||||
{
|
||||
if( FILE * fp=fopen("foo.txt","rt") )
|
||||
{
|
||||
shared_ptr<FILE> f(fp,fclose);
|
||||
....
|
||||
read_file(fp); //throws types deriving from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
|
||||
do_something();
|
||||
....
|
||||
}
|
||||
else
|
||||
throw file_open_error() <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> errno_code(errno);
|
||||
}
|
||||
catch( boost::<span class="RenoLink"><a href="exception.html">exception</a></span> & e )
|
||||
{
|
||||
e <span class="RenoLink"><a href="exception_operator_shl.html"><<</a></span> file_name("foo.txt");
|
||||
throw;
|
||||
}</pre>
|
||||
<p>Finally here is how the handler retrieves data from exceptions that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>:</p>
|
||||
<pre>catch( io_error & e )
|
||||
{
|
||||
std::cerr << "I/O Error!\n";
|
||||
|
||||
if( std::string const * fn=<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span><file_name>(e) )
|
||||
std::cerr << "File name: " << *fn << "\n";
|
||||
|
||||
if( int const * c=<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span><errno_code>(e) )
|
||||
std::cerr << "OS says: " << strerror(*c) << "\n";
|
||||
}</pre>
|
||||
<p>In addition, boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> can be used to compose an automatic (if not user-friendly) message that contains all of the <span class="RenoLink"><a href="error_info.html">error_info</a></span> objects added to a boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. This is useful for inclusion in logs and other diagnostic objects.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
115
doc/page_idx.html
Normal file
115
doc/page_idx.html
Normal file
@ -0,0 +1,115 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>page index</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h1>Page Index</h1>
|
||||
</div>
|
||||
<p>This is an alphabetical list of all Boost Exception documentation pages.</p>
|
||||
<div class="RenoIndex"><h3>B</h3>
|
||||
<p><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></p>
|
||||
<h3>b</h3>
|
||||
<p><a href="exception_hpp.html">boost/exception.hpp</a></p>
|
||||
<p><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></p>
|
||||
<p><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></p>
|
||||
<p><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></p>
|
||||
<p><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></p>
|
||||
<p><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></p>
|
||||
<p><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></p>
|
||||
<p><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></p>
|
||||
<p><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></p>
|
||||
<p><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></p>
|
||||
<p><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></p>
|
||||
<p><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></p>
|
||||
<h3>C</h3>
|
||||
<p><a href="configuration_macros.html">Configuration Macros</a></p>
|
||||
<h3>c</h3>
|
||||
<p><a href="copy_exception.html">copy_exception</a></p>
|
||||
<p><a href="current_exception.html">current_exception</a></p>
|
||||
<p><a href="current_exception_cast.html">current_exception_cast</a></p>
|
||||
<p><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></p>
|
||||
<h3>D</h3>
|
||||
<p><a href="tutorial_diagnostic_information.html">Diagnostic Information</a></p>
|
||||
<h3>d</h3>
|
||||
<p><a href="diagnostic_information.html">diagnostic_information</a></p>
|
||||
<h3>E</h3>
|
||||
<p><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags</a></p>
|
||||
<h3>e</h3>
|
||||
<p><a href="enable_current_exception.html">enable_current_exception</a></p>
|
||||
<p><a href="enable_error_info.html">enable_error_info</a></p>
|
||||
<p><a href="error_info.html">error_info</a></p>
|
||||
<p><a href="error_info_error_info.html">error_info::error_info</a></p>
|
||||
<p><a href="error_info_value.html">error_info::value</a></p>
|
||||
<p><a href="error_info_value_type.html">error_info::value_type</a></p>
|
||||
<p><a href="exception.html">exception</a></p>
|
||||
<p><a href="exception_operator_shl.html">exception/operator<<</a></p>
|
||||
<p><a href="exception_constructors.html">exception::exception</a></p>
|
||||
<p><a href="exception_destructor.html">exception::~exception</a></p>
|
||||
<p><a href="exception_ptr.html">exception_ptr</a></p>
|
||||
<h3>F</h3>
|
||||
<p><a href="frequently_asked_questions.html">Frequently Asked Questions</a></p>
|
||||
<p><a href="functions.html">Functions</a></p>
|
||||
<h3>g</h3>
|
||||
<p><a href="get_error_info.html">get_error_info</a></p>
|
||||
<h3>H</h3>
|
||||
<p><a href="headers.html">Headers</a></p>
|
||||
<h3>I</h3>
|
||||
<p><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies</a></p>
|
||||
<h3>M</h3>
|
||||
<p><a href="macros.html">Macros</a></p>
|
||||
<p><a href="motivation.html">Motivation</a></p>
|
||||
<h3>r</h3>
|
||||
<p><a href="rethrow_exception.html">rethrow_exception</a></p>
|
||||
<h3>S</h3>
|
||||
<p><a href="synopsis.html">Synopsis</a></p>
|
||||
<h3>T</h3>
|
||||
<p><a href="tutorial_transporting_data.html">Transporting of Arbitrary Data to the Catch Site</a></p>
|
||||
<p><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads</a></p>
|
||||
<p><a href="types.html">Types</a></p>
|
||||
<h3>t</h3>
|
||||
<p><a href="throw_exception.html">throw_exception</a></p>
|
||||
<p><a href="tuple_operator_shl.html">tuple/operator<<</a></p>
|
||||
<h3>U</h3>
|
||||
<p><a href="using_virtual_inheritance_in_exception_types.html">Using Virtual Inheritance in Exception Types</a></p>
|
||||
<h3>u</h3>
|
||||
<p><a href="unknown_exception.html">unknown_exception</a></p>
|
||||
</div>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
224
doc/reno.css
Normal file
224
doc/reno.css
Normal file
@ -0,0 +1,224 @@
|
||||
/*
|
||||
* Copyright (c) 2006-2008 Emil Dotchevski and Reverge Studios, Inc.
|
||||
*
|
||||
* Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
* file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
*/
|
||||
|
||||
body
|
||||
{
|
||||
font-family: Trebuchet, Verdana, Arial, Helvetica, Sans;
|
||||
font-size: 10pt;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
background-color: #E5E5E5;
|
||||
}
|
||||
|
||||
.RenoPageList,
|
||||
ol,
|
||||
ul
|
||||
{
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.RenoPageList
|
||||
{
|
||||
margin:0;
|
||||
}
|
||||
|
||||
h1
|
||||
{
|
||||
font-size: 24pt;
|
||||
clear: left;
|
||||
padding-top: 5pt;
|
||||
padding-bottom: 5pt;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
h2
|
||||
{
|
||||
font-size: 18pt;
|
||||
clear: left;
|
||||
padding-top: 20pt;
|
||||
padding-bottom: 5pt;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
h3
|
||||
{
|
||||
font-size: 14pt;
|
||||
clear: left;
|
||||
padding-top: 15pt;
|
||||
padding-bottom: 5pt;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
h4
|
||||
{
|
||||
font-size: 10pt;
|
||||
float: left;
|
||||
clear: left;
|
||||
padding-top: 5pt;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
margin-right: 4pt;
|
||||
}
|
||||
|
||||
p
|
||||
{
|
||||
font-size: 10pt;
|
||||
padding-top: 5pt;
|
||||
padding-bottom: 5pt;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
clear:right;
|
||||
}
|
||||
|
||||
pre
|
||||
{
|
||||
border-top: 1px solid #C5C5C5;
|
||||
border-bottom: 1px solid #C5C5C5;
|
||||
border-left: 1px solid #C5C5C5;
|
||||
border-right: 1px solid #C5C5C5;
|
||||
font-size: 10pt;
|
||||
padding-top: 5pt;
|
||||
padding-bottom: 5pt;
|
||||
padding-left: 5pt;
|
||||
padding-right: 5pt;
|
||||
margin-left: 18pt;
|
||||
margin-right: 18pt;
|
||||
margin-top: 10pt;
|
||||
margin-bottom: 10pt;
|
||||
clear: both;
|
||||
}
|
||||
|
||||
ol,ul
|
||||
{
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
ul li
|
||||
{
|
||||
padding-top: 5pt;
|
||||
padding-bottom: 5pt;
|
||||
margin-top: 0;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.RenoIndex h3
|
||||
{
|
||||
margin: 20pt 0 5pt 0;
|
||||
padding: 2pt;
|
||||
display: inline;
|
||||
border: 1.5pt solid #A0A0A0;
|
||||
float: left;
|
||||
clear: both;
|
||||
width: 15pt;
|
||||
text-align: center;
|
||||
background-color: #EAEAEA;
|
||||
}
|
||||
|
||||
.RenoIndex p
|
||||
{
|
||||
clear: both;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.RenoHookUnbound,
|
||||
.RenoHookBound
|
||||
{
|
||||
background-position: left center;
|
||||
background-image: url('link.gif');
|
||||
background-repeat: no-repeat;
|
||||
padding-left: 10pt;
|
||||
}
|
||||
|
||||
.RenoIncludeDIV
|
||||
{
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.RenoError
|
||||
{
|
||||
background-color: red;
|
||||
color: white;
|
||||
display: inline;
|
||||
}
|
||||
|
||||
a
|
||||
{
|
||||
text-decoration: underline;
|
||||
color: #0000AA;
|
||||
}
|
||||
|
||||
tt
|
||||
{
|
||||
font-size: 10pt;
|
||||
}
|
||||
|
||||
hr
|
||||
{
|
||||
border: 0;
|
||||
color: black;
|
||||
background-color: black;
|
||||
height: 1px;
|
||||
}
|
||||
|
||||
blockquote
|
||||
{
|
||||
padding-top: 0;
|
||||
padding-bottom: 0;
|
||||
padding-right: 0;
|
||||
padding-left: 20pt;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
#boost_logo
|
||||
{
|
||||
float:right;
|
||||
}
|
||||
|
||||
#footer
|
||||
{
|
||||
}
|
||||
|
||||
.logo_pic
|
||||
{
|
||||
border:0;
|
||||
}
|
||||
|
||||
.logo
|
||||
{
|
||||
float:right;
|
||||
margin-left: 6pt;
|
||||
margin-right: -4pt;
|
||||
}
|
||||
|
||||
.body-0
|
||||
{
|
||||
min-width: 40em;
|
||||
padding-left: 30px;
|
||||
background: url(shade-l.png) repeat-y left;
|
||||
}
|
||||
.body-1
|
||||
{
|
||||
padding-right: 30px;
|
||||
background: url(shade-r.png) repeat-y right;
|
||||
}
|
||||
.body-2
|
||||
{
|
||||
background-color: white;
|
||||
padding: 0 8pt 0 8pt;
|
||||
margin-left: 0;
|
||||
border-top: solid 2.5pt #717171;
|
||||
border-bottom: solid 3pt #717171;
|
||||
}
|
58
doc/rethrow_exception.html
Normal file
58
doc/rethrow_exception.html
Normal file
@ -0,0 +1,58 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>rethrow_exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>rethrow_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> void <span class="RenoLink">rethrow_exception</span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const & ep );</span>
|
||||
}</pre>
|
||||
</div><h4>Precondition:</h4>
|
||||
<p>ep shall not be null.</p>
|
||||
<h4>Throws:</h4>
|
||||
<p>The exception to which ep refers.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
|
||||
</a><a href="exception_ptr.html">exception_ptr<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
doc/shade-l.png
Normal file
BIN
doc/shade-l.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 948 B |
BIN
doc/shade-r.png
Normal file
BIN
doc/shade-r.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 946 B |
12312
doc/source/boost-exception.reno
Normal file
12312
doc/source/boost-exception.reno
Normal file
File diff suppressed because it is too large
Load Diff
21
doc/source/html_prefix.txt
Normal file
21
doc/source/html_prefix.txt
Normal file
@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>%s</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
18
doc/source/html_suffix.txt
Normal file
18
doc/source/html_suffix.txt
Normal file
@ -0,0 +1,18 @@
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
201
doc/synopsis.html
Normal file
201
doc/synopsis.html
Normal file
@ -0,0 +1,201 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>Synopsis</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><h2>Synopsis</h2>
|
||||
<p>List of documented definitions, declarations and includes by header file:</p>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
|
||||
<span class="RenoLink"><a href="exception.html">exception</a></span>
|
||||
{
|
||||
protected:
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_constructors.html">exception</a></span>();
|
||||
<span class="RenoLink"><a href="exception_constructors.html">exception</a></span>( <span class="RenoLink"><a href="exception.html">exception</a></span> const & x );</span>
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</span>
|
||||
};</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">template <class Tag,class T>
|
||||
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span>
|
||||
|
||||
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_throw_function,char const *> throw_function;
|
||||
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_throw_file,char const *> throw_file;
|
||||
typedef <span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_throw_line,int> throw_line;</span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class Tag,class T>
|
||||
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class Tag,class T>
|
||||
class
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span>
|
||||
{
|
||||
public:
|
||||
|
||||
<span class="RenoIncludeSPAN"> typedef T <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span>;</span>
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_error_info.html">error_info</a></span>( <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & v );</span>
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoLink"><a href="error_info_value_type.html">value_type</a></span> const & <span class="RenoLink"><a href="error_info_value.html">value</a></span>() const;</span>
|
||||
};</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">template <class E, class Tag, class T>
|
||||
E const & <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span>( E const & x, <span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag,T> const & v );</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">#include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class E, class Tag1, class T1, ..., class TagN, class TN>
|
||||
E const & <span class="RenoLink"><a href="tuple_operator_shl.html">operator<<</a></span>( E const & x,
|
||||
<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span><
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag1,T1>,
|
||||
...,
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><TagN,TN> > const & v );</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class T>
|
||||
---unspecified--- <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>( T const & x );</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">#include <string>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> class <span class="RenoLink"><a href="exception.html">exception</a></span>;</span>
|
||||
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class E>
|
||||
std::string <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>( E const & e );</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">std::string <span class="RenoLink"><a href="current_exception_diagnostic_information.html">current_exception_diagnostic_information</a></span>();</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="boost_exception_current_exception_cast_hpp.html">boost/exception/current_exception_cast.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class E>
|
||||
E * <span class="RenoLink"><a href="current_exception_cast.html">current_exception_cast</a></span>();</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">class
|
||||
<span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>:
|
||||
public std::exception
|
||||
public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
|
||||
{
|
||||
---unspecified---
|
||||
};</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">typedef ---unspecified--- <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>;</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">template <class T>
|
||||
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="copy_exception.html">copy_exception</a></span>( T const & e );</span>
|
||||
|
||||
<span class="RenoIncludeSPAN"><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();</span>
|
||||
|
||||
<span class="RenoIncludeSPAN">void <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>( <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> const & ep );</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_enable_current_exception_hpp.html">boost/exception/enable_current_exception.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN">#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> <span class="RenoIncludeSPAN">template <class T>
|
||||
---unspecified--- <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>( T const & e );</span></span>
|
||||
}</span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>></p>
|
||||
<pre><span class="RenoIncludeSPAN"><div class="RenoIncludeDIV"><span class="RenoIncludeSPAN">#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
#include <boost/current_function.hpp>
|
||||
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
|
||||
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
|
||||
#else
|
||||
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
|
||||
#endif</span>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN">#ifdef BOOST_NO_EXCEPTIONS
|
||||
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( std::exception const & e ); // user defined
|
||||
#else
|
||||
template <class E>
|
||||
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const & e );
|
||||
#endif</span>
|
||||
}</div></span></pre>
|
||||
<p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>></p>
|
||||
<div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#include <<span class="RenoLink"><a href="exception_diagnostic_information_hpp.html">boost/exception/diagnostic_information.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_error_info_value_hpp.html">boost/exception/error_info.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_get_error_info_hpp.html">boost/exception/get_error_info.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>>
|
||||
#include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></span></pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
71
doc/throw_exception.html
Normal file
71
doc/throw_exception.html
Normal file
@ -0,0 +1,71 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>throw_exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>throw_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN">#ifdef BOOST_NO_EXCEPTIONS
|
||||
void <span class="RenoLink">throw_exception</span>( std::exception const & e ); // user defined
|
||||
#else
|
||||
template <class E>
|
||||
void <span class="RenoLink">throw_exception</span>( E const & e );
|
||||
#endif</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>E must derive publicly from std::exception.</p>
|
||||
<h4>Effects:</h4>
|
||||
<div><ul><li> If BOOST_NO_EXCEPTIONS is not defined, boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(e)), unless BOOST_EXCEPTION_DISABLE is defined, in which case boost::<span class="RenoLink">throw_exception</span>(e) is equivalent to throw e;</li>
|
||||
<li> If BOOST_NO_EXCEPTIONS is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <span class="RenoLink">throw_exception</span> are allowed to assume that the function never returns; therefore, if the user-defined <span class="RenoLink">throw_exception</span> returns, the behavior is undefined.</li>
|
||||
</ul></div>
|
||||
<h4>Note:</h4>
|
||||
<p>Under BOOST_NO_EXCEPTIONS, unless BOOST_EXCEPTION_DISABLE is also defined, users can examine the passed exception object using boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>, or format an automatic diagnostic message using boost::<span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
|
||||
</a><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="throw_exception_hpp.html">boost/throw_exception.hpp<br/>
|
||||
</a><a href="configuration_macros.html">Configuration Macros<br/>
|
||||
</a><a href="enable_current_exception.html">enable_current_exception<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a><a href="tutorial_exception_ptr.html">Transporting of Exceptions Between Threads<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
72
doc/throw_exception_hpp.html
Normal file
72
doc/throw_exception_hpp.html
Normal file
@ -0,0 +1,72 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>boost/throw_exception.hpp</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>boost/throw_exception.hpp</h2>
|
||||
</div>
|
||||
<h3>Synopsis</h3>
|
||||
<div class="RenoIncludeDIV"><div class="RenoIncludeDIV"><pre><span class="RenoIncludeSPAN">#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
#include <<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>>
|
||||
#include <boost/current_function.hpp>
|
||||
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x)\
|
||||
::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( ::boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(x) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_function</a></span>(BOOST_CURRENT_FUNCTION) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_file</a></span>(__FILE__) <<\
|
||||
::boost::<span class="RenoLink"><a href="exception_exception_hpp.html">throw_line</a></span>((int)__LINE__) )
|
||||
#else
|
||||
#define <span class="RenoLink"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION</a></span>(x) ::boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(x)
|
||||
#endif</span>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN">#ifdef BOOST_NO_EXCEPTIONS
|
||||
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( std::exception const & e ); // user defined
|
||||
#else
|
||||
template <class E>
|
||||
void <span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>( E const & e );
|
||||
#endif</span>
|
||||
}</pre>
|
||||
</div></div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="BOOST_THROW_EXCEPTION.html">BOOST_THROW_EXCEPTION<br/>
|
||||
</a><a href="configuration_macros.html">Configuration Macros<br/>
|
||||
</a><a href="synopsis.html">Synopsis<br/>
|
||||
</a><a href="throw_exception.html">throw_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
66
doc/tuple_operator_shl.html
Normal file
66
doc/tuple_operator_shl.html
Normal file
@ -0,0 +1,66 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>tuple/operator<<</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>tuple/operator<<</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> template <class E, class Tag1, class T1, ..., class TagN, class TN>
|
||||
E const & <span class="RenoLink">operator<<</span>( E const & x,
|
||||
<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span><
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><Tag1,T1>,
|
||||
...,
|
||||
<span class="RenoLink"><a href="error_info.html">error_info</a></span><TagN,TN> > const & v );</span>
|
||||
}</pre>
|
||||
</div><h4>Requirements:</h4>
|
||||
<p>E must be boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, or a type that derives (indirectly) from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<h4>Effects:</h4>
|
||||
<p>Equivalent to x << v.<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements">get</a></span><0>() << ... << v.<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html#accessing_elements">get</a></span><N>().</p>
|
||||
<h4>Returns:</h4>
|
||||
<p>x.</p>
|
||||
<div class="RenoIncludeDIV"><h4>Throws:</h4>
|
||||
<p>std::bad_alloc, or any exception emitted by T1..TN copy constructor.</p>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
79
doc/tutorial_diagnostic_information.html
Normal file
79
doc/tutorial_diagnostic_information.html
Normal file
@ -0,0 +1,79 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>diagnostic information</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Diagnostic Information</h2>
|
||||
</div>
|
||||
<p>Boost Exception provides a namespace-scope function <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> which takes a boost::<span class="RenoLink"><a href="exception.html">exception</a></span>. The returned string contains:</p>
|
||||
<div><ul><li>the string representation of all data objects added to the boost::<span class="RenoLink"><a href="exception.html">exception</a></span> through <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span>;</li>
|
||||
<li>the output from std::exception::what;</li>
|
||||
<li>additional platform-specific diagnostic information.</li>
|
||||
</ul></div>
|
||||
<p>The returned string is not presentable as a friendly user message, but because it is generated automatically, it is useful for debugging or logging purposes. Here is an example:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>>
|
||||
#include <iostream>
|
||||
|
||||
void f(); //throws unknown types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.
|
||||
|
||||
void
|
||||
g()
|
||||
{
|
||||
try
|
||||
{
|
||||
f();
|
||||
}
|
||||
catch(
|
||||
boost::<span class="RenoLink"><a href="exception.html">exception</a></span> & e )
|
||||
{
|
||||
std::cerr << <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span>(e);
|
||||
}
|
||||
}</pre>
|
||||
<div class="RenoIncludeDIV"><h4>Example:</h4>
|
||||
<p>this is a possible output from the <span class="RenoLink"><a href="diagnostic_information.html">diagnostic_information</a></span> function, as used in <i>libs/exception/example/example_io.cpp:</i></p>
|
||||
<pre>example_io.cpp(83): Throw in function class boost::shared_ptr<struct _iobuf> __cdecl my_fopen(const char *,const char *)
|
||||
Dynamic exception type: class boost::exception_detail::clone_impl<class fopen_error>
|
||||
std::exception::what: example_io error
|
||||
[struct tag_errno *] = 2, OS says "No such file or directory"
|
||||
[struct tag_file_name *] = tmp1.txt
|
||||
[struct tag_function *] = fopen
|
||||
[struct tag_open_mode *] = rb</pre>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
76
doc/tutorial_enable_error_info.html
Normal file
76
doc/tutorial_enable_error_info.html
Normal file
@ -0,0 +1,76 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>integrating boost exception in existing exception class hierarchies</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Integrating Boost Exception in Existing Exception Class Hierarchies</h2>
|
||||
</div>
|
||||
<p>Some exception hierarchies can not be modified to make boost::<span class="RenoLink"><a href="exception.html">exception</a></span> a base type. In this case, the <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span> function template can be used to make exception objects derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> anyway. Here is an example:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>>
|
||||
#include <stdexcept>
|
||||
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_std_range_min,size_t> std_range_min;
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_std_range_max,size_t> std_range_max;
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_std_range_index,size_t> std_range_index;
|
||||
|
||||
template <class T>
|
||||
class
|
||||
my_container
|
||||
{
|
||||
public:
|
||||
|
||||
size_t size() const;
|
||||
|
||||
T const &
|
||||
operator[]( size_t i ) const
|
||||
{
|
||||
if( i > size() )
|
||||
throw boost::<span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>(std::range_error("Index out of range")) <<
|
||||
std_range_min(0) <<
|
||||
std_range_max(size()) <<
|
||||
std_range_index(i);
|
||||
//....
|
||||
}
|
||||
};
|
||||
</pre>
|
||||
<p>The call to <span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span><T> gets us an object of <i>unspecified type</i> which is guaranteed to derive from both boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and T. This makes it possible to use <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span> to store additional information in the exception object. The exception can be intercepted as T &, so existing exception handling will not break. It can also be intercepted as boost::<span class="RenoLink"><a href="exception.html">exception</a></span> &, so that <span class="RenoLink"><a href="tutorial_transporting_data.html">more information can be added to the exception at a later time</a></span>.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="motivation.html">Motivation<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
108
doc/tutorial_exception_ptr.html
Normal file
108
doc/tutorial_exception_ptr.html
Normal file
@ -0,0 +1,108 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>transporting of exceptions between threads</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Transporting of Exceptions Between Threads</h2>
|
||||
</div>
|
||||
<p>Boost Exception supports transporting of exception objects between threads through cloning. This system is similar to <span class="RenoLink"><a href="http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2007/n2179.html">N2179</a></span>, but because Boost Exception can not rely on language support, the use of <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> at the time of the throw is required in order to use cloning.</p>
|
||||
<h4>Note:</h4>
|
||||
<p>All exceptions emitted by the familiar function boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span> are guaranteed to derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> and to support cloning.</p>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Using enable_current_exception at the Time of the Throw</h3>
|
||||
</div>
|
||||
<p>Here is how cloning can be enabled in a throw-expression (15.1):</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef boost::error_info<struct tag_errno,int> errno_info;
|
||||
|
||||
class file_read_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
|
||||
|
||||
void
|
||||
file_read( FILE * f, void * buffer, size_t size )
|
||||
{
|
||||
if( size!=fread(buffer,1,size,f) )
|
||||
throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(file_read_error()) <<
|
||||
errno_info(errno);
|
||||
}</pre>
|
||||
<p>Of course, <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> may be used with any exception type; there is no requirement that it should derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Cloning and Re-Throwing an Exception</h3>
|
||||
</div>
|
||||
<p>When you catch an exception, you can call <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> to get an <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> object:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>>
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
void do_work(); //throws cloning-enabled boost::<span class="RenoLink"><a href="exception.html">exception</a></span>s
|
||||
|
||||
void
|
||||
worker_thread( boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> & error )
|
||||
{
|
||||
try
|
||||
{
|
||||
do_work();
|
||||
error = boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span>();
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
error = boost::<span class="RenoLink"><a href="current_exception.html">current_exception</a></span>();
|
||||
}
|
||||
}</pre>
|
||||
<p>In the above example, note that <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> captures the original type of the exception object. The exception can be thrown again using the <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> function:</p>
|
||||
<pre>// ...continued
|
||||
|
||||
void
|
||||
work()
|
||||
{
|
||||
boost::<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> error;
|
||||
boost::<span class="RenoLink"><a href="http://www.boost.org/doc/html/boost/thread.html">thread</a></span> t( boost::<span class="RenoLink"><a href="http://www.boost.org/libs/bind/bind.html">bind</a></span>(worker_thread,boost::<span class="RenoLink"><a href="http://www.boost.org/doc/html/ref.html">ref</a></span>(error)) );
|
||||
t.<span class="RenoLink"><a href="http://www.boost.org/doc/html/boost/thread.html">join</a></span>();
|
||||
if( error )
|
||||
boost::<span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>(error);
|
||||
}</pre>
|
||||
<p>Note that <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> could fail to copy the original exception object in the following cases:</p>
|
||||
<div><ul><li> if there is not enough memory, in which case the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> points to an instance of std::bad_alloc, or</li>
|
||||
<li> if <span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span> was not used in the throw-expression passed to the original throw statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> points to an instance of <span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span>.</li>
|
||||
</ul></div>
|
||||
<p>Regardless, the use of <span class="RenoLink"><a href="current_exception.html">current_exception</a></span> and <span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span> in the above examples is well-formed.</p>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
171
doc/tutorial_transporting_data.html
Normal file
171
doc/tutorial_transporting_data.html
Normal file
@ -0,0 +1,171 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>transporting of arbitrary data to the catch site</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Transporting of Arbitrary Data to the Catch Site</h2>
|
||||
</div>
|
||||
<p>All exception types that derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span> can be used as type-safe containers of arbitrary data objects, while complying with the no-throw requirements (15.5.1) of the ANSI C++ standard for exception types.</p>
|
||||
<p>When exceptions derive from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, arbitrary data can be added to exception objects:</p>
|
||||
<div><ul><li>At the point of the throw;</li>
|
||||
<li>At a later time as exceptions bubble up the call stack.</li>
|
||||
</ul></div>
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Adding of Arbitrary Data at the Point of the Throw</h3>
|
||||
</div>
|
||||
<p>The following example demonstrates how errno can be stored in exception objects using Boost Exception:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>>
|
||||
#include <errno.h>
|
||||
#include <iostream>
|
||||
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_errno,int> errno_info; //(1)
|
||||
|
||||
class my_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>, public std::exception { }; //(2)
|
||||
|
||||
void
|
||||
f()
|
||||
{
|
||||
throw my_error() << errno_info(errno); //(3)
|
||||
}
|
||||
</pre>
|
||||
<p>First, we instantiate the <span class="RenoLink"><a href="error_info.html">error_info</a></span> template using a unique identifier -- tag_errno, and the type of the info it identifies -- int. This provides compile-time type safety for the various values stored in exception objects.</p>
|
||||
<p>Second, we define class my_error, which derives from boost::<span class="RenoLink"><a href="exception.html">exception</a></span>.</p>
|
||||
<p>Finally, (3) illustrates how the typedef from (1) can be used with <span class="RenoLink"><a href="exception_operator_shl.html">operator<<</a></span> to store values in exception objects at the point of the throw.</p>
|
||||
<p>The stored errno value can be recovered at a later time like this:</p>
|
||||
<pre>// ...continued
|
||||
|
||||
void
|
||||
g()
|
||||
{
|
||||
try
|
||||
{
|
||||
f();
|
||||
}
|
||||
catch(
|
||||
my_error & x )
|
||||
{
|
||||
if( int const * err=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span><errno_info>(x) )
|
||||
std::cerr << "Error code: " << *err;
|
||||
}
|
||||
}</pre>
|
||||
<p>The <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span> function template is instantiated with the typedef from (1), and is passed an exception object of a polymorphic type. If the exception object contains the requested value, err will point to it; otherwise a null pointer is returned.</p>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Adding of Arbitrary Data to Active Exception Objects</h3>
|
||||
</div>
|
||||
<p>Sometimes the throw site does not have all the information that is needed at the catch site to make sense of what went wrong. Let's say we have an exception type file_read_error, which takes a file name in its constructor. Consider the following function:</p>
|
||||
<pre>void
|
||||
file_read( FILE * f, void * buffer, size_t size )
|
||||
{
|
||||
if( size!=fread(buffer,1,size,f) )
|
||||
throw file_read_error(????);
|
||||
}</pre>
|
||||
<p>How can the file_read function pass a file name to the exception type constructor? All it has is a FILE handle.</p>
|
||||
<p>Using boost::<span class="RenoLink"><a href="exception.html">exception</a></span> allows us to free the file_read function from the burden of storing the file name in exceptions it throws:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_errno,int> errno_info;
|
||||
|
||||
class file_read_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
|
||||
|
||||
void
|
||||
file_read( FILE * f, void * buffer, size_t size )
|
||||
{
|
||||
if( size!=fread(buffer,1,size,f) )
|
||||
throw file_read_error() << errno_info(errno);
|
||||
}</pre>
|
||||
<p>If file_read detects a failure, it throws an exception which contains the information that is available at the time, namely the errno. Other relevant information, such as the file name, can be added in a context higher up the call stack, where it is known naturally:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_file_name,std::string> file_name_info;
|
||||
|
||||
boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode );
|
||||
void file_read( FILE * f, void * buffer, size_t size );
|
||||
|
||||
void
|
||||
parse_file( char const * file_name )
|
||||
{
|
||||
boost::shared_ptr<FILE> f = file_open(file_name,"rb");
|
||||
assert(f);
|
||||
try
|
||||
{
|
||||
char buf[1024];
|
||||
file_read( f.get(), buf, sizeof(buf) );
|
||||
}
|
||||
catch(
|
||||
boost::<span class="RenoLink"><a href="exception.html">exception</a></span> & e )
|
||||
{
|
||||
e << file_name_info(file_name);
|
||||
throw;
|
||||
}
|
||||
}</pre>
|
||||
<p>The above function is (almost) exception-neutral -- if an exception is emitted by any function call within the try block, parse_file does not need to do any real work, but it intercepts any boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any boost::<span class="RenoLink"><a href="exception.html">exception</a></span> object is that the file name is relevant to any failure that occurs in parse_file, <i>even if the failure is unrelated to file I/O</i>.</p>
|
||||
</div><div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Adding Grouped Data to Exceptions</h3>
|
||||
</div>
|
||||
<p>The code snippet below demonstrates how boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span> can be used to bundle the name of the function that failed, together with the reported errno so that they can be added to exception objects more conveniently together:</p>
|
||||
<pre>#include <<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <errno.h>
|
||||
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_file_name,std::string> file_name_info;
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_function,char const *> function_info;
|
||||
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span><struct tag_errno,int> errno_info;
|
||||
typedef boost::tuple<function_info,errno_info> clib_failure;
|
||||
|
||||
class file_open_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
|
||||
|
||||
boost::shared_ptr<FILE>
|
||||
file_open( char const * name, char const * mode )
|
||||
{
|
||||
if( FILE * f=fopen(name,mode) )
|
||||
return boost::shared_ptr<FILE>(f,fclose);
|
||||
else
|
||||
throw file_open_error() <<
|
||||
file_name_info(name) <<
|
||||
clib_failure("fopen",errno);
|
||||
}</pre>
|
||||
<p>Note that the members of a boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span> are stored separately in exception objects; they can only be retrieved individually, using <span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>.</p>
|
||||
</div></div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="tutorial_enable_error_info.html">Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
54
doc/types.html
Normal file
54
doc/types.html
Normal file
@ -0,0 +1,54 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>Types</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h2>Types</h2>
|
||||
</div>
|
||||
<div class="RenoIndex"><h3>e</h3>
|
||||
<p><a href="error_info.html">error_info</a></p>
|
||||
<p><a href="error_info_value_type.html">error_info::value_type</a></p>
|
||||
<p><a href="exception.html">exception</a></p>
|
||||
<p><a href="exception_ptr.html">exception_ptr</a></p>
|
||||
<h3>u</h3>
|
||||
<p><a href="unknown_exception.html">unknown_exception</a></p>
|
||||
</div>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
62
doc/unknown_exception.html
Normal file
62
doc/unknown_exception.html
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>unknown_exception</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>unknown_exception</h3>
|
||||
</div>
|
||||
<div class="RenoIncludeDIV"><p><span class="RenoEscape">#<!--<wiki>`#</wiki>--></span>include <<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>></p>
|
||||
<pre>namespace
|
||||
boost
|
||||
{
|
||||
<span class="RenoIncludeSPAN"> class
|
||||
<span class="RenoLink">unknown_exception</span>:
|
||||
public std::exception
|
||||
public boost::<span class="RenoLink"><a href="exception.html">exception</a></span>
|
||||
{
|
||||
---unspecified---
|
||||
};</span>
|
||||
}</pre>
|
||||
</div><p>This type is used by the <span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> support in Boost Exception. Please see <span class="RenoLink"><a href="current_exception.html">current_exception</a></span>.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
|
||||
</a><a href="current_exception.html">current_exception<br/>
|
||||
</a><a href="enable_current_exception.html">enable_current_exception<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
62
doc/using_virtual_inheritance_in_exception_types.html
Normal file
62
doc/using_virtual_inheritance_in_exception_types.html
Normal file
@ -0,0 +1,62 @@
|
||||
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Strict//EN'
|
||||
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<meta http-equiv='Content-Type' content='text/html; charset=utf-8'/>
|
||||
<title>using virtual inheritance in exception types</title>
|
||||
<link href='reno.css' type='text/css' rel='stylesheet'/>
|
||||
</head>
|
||||
<body>
|
||||
<div class="body-0">
|
||||
<div class="body-1">
|
||||
<div class="body-2">
|
||||
<div>
|
||||
<div id="boost_logo">
|
||||
<a href="http://www.boost.org"><img style="border:0" src="http://www.boost.org/boost.png" alt="Boost" width="277" height="86"/></a>
|
||||
</div>
|
||||
<h1>Boost Exception</h1>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div class="RenoIncludeDIV"><div class="RenoAutoDIV"><h3>Using Virtual Inheritance in Exception Types</h3>
|
||||
</div>
|
||||
<p>Exception types should use virtual inheritance when deriving from other exception types. This insight is due to Andrew Koenig. Using virtual inheritance prevents ambiguity problems in the exception handler:</p>
|
||||
<pre>#include <iostream>
|
||||
struct my_exc1 : std::exception { char const* what() const throw(); };
|
||||
struct my_exc2 : std::exception { char const* what() const throw(); };
|
||||
struct your_exc3 : my_exc1, my_exc2 {};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try { throw your_exc3(); }
|
||||
catch(std::exception const& e) {}
|
||||
catch(...) { std::cout << "whoops!" << std::endl; }
|
||||
}</pre>
|
||||
<p>The program above outputs "whoops!" because the conversion to std::exception is ambiguous.</p>
|
||||
<p>The overhead introduced by virtual inheritance is always negligible in the context of exception handling. Note that virtual bases are initialized directly by the constructor of the most-derived-type (the type passed to the throw statement, in case of exceptions.) However, typically this detail is of no concern when boost::<span class="RenoLink"><a href="exception.html">exception</a></span> is used, because it enables exception types to be trivial structs with no members (there's nothing to initialize.) See <span class="RenoLink"><a href="exception_types_as_simple_semantic_tags.html">Exception Types as Simple Semantic Tags</a></span>.</p>
|
||||
</div><div class="RenoAutoDIV"><div class="RenoHR"><hr/></div>
|
||||
<h3>See Also:</h3>
|
||||
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
|
||||
</a><a href="frequently_asked_questions.html">Frequently Asked Questions<br/>
|
||||
</a></div>
|
||||
</div>
|
||||
<!-- Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc. -->
|
||||
<!-- Distributed under the Boost Software License, Version 1.0. (See accompanying -->
|
||||
<!-- file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) -->
|
||||
<div id="footer">
|
||||
<p> </p>
|
||||
<hr/>
|
||||
<p>
|
||||
<a class="logo" href="http://jigsaw.w3.org/css-validator/check/referer"><img class="logo_pic" src="valid-css.png" alt="Valid CSS" height="31" width="88"/></a>
|
||||
<a class="logo" href="http://validator.w3.org/check?uri=referer"><img class="logo_pic" src="valid-xhtml.png" alt="Valid XHTML 1.0" height="31" width="88"/></a>
|
||||
<small>Copyright (c) 2006-2009 by Emil Dotchevski and Reverge Studios, Inc.<br/>
|
||||
Distributed under the <a href="http://www.boost.org/LICENSE_1_0.txt">Boost Software License, Version 1.0</a>.</small>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
BIN
doc/valid-css.png
Normal file
BIN
doc/valid-css.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
BIN
doc/valid-xhtml.png
Normal file
BIN
doc/valid-xhtml.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.7 KiB |
15
example/Jamfile
Normal file
15
example/Jamfile
Normal file
@ -0,0 +1,15 @@
|
||||
# Boost Exception Library example Jamfile
|
||||
#
|
||||
# Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
exe example_io : example_io.cpp ;
|
||||
obj error_info_1 : error_info_1.cpp ;
|
||||
obj error_info_2 : error_info_2.cpp ;
|
||||
obj cloning_1 : cloning_1.cpp ;
|
||||
obj cloning_2 : cloning_2.cpp : <threading>multi ;
|
||||
obj info_tuple : info_tuple.cpp ;
|
||||
obj enable_error_info : enable_error_info.cpp ;
|
||||
obj logging : logging.cpp ;
|
22
example/cloning_1.cpp
Normal file
22
example/cloning_1.cpp
Normal file
@ -0,0 +1,22 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This example shows how to enable cloning when throwing a boost::exception.
|
||||
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
typedef boost::error_info<struct tag_errno,int> errno_info;
|
||||
|
||||
class file_read_error: public boost::exception { };
|
||||
|
||||
void
|
||||
file_read( FILE * f, void * buffer, size_t size )
|
||||
{
|
||||
if( size!=fread(buffer,1,size,f) )
|
||||
throw boost::enable_current_exception(file_read_error()) <<
|
||||
errno_info(errno);
|
||||
}
|
39
example/cloning_2.cpp
Normal file
39
example/cloning_2.cpp
Normal file
@ -0,0 +1,39 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This example shows how to transport cloning-enabled boost::exceptions between threads.
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/thread.hpp>
|
||||
#include <boost/bind.hpp>
|
||||
|
||||
void do_work(); //throws cloning-enabled boost::exceptions
|
||||
|
||||
void
|
||||
worker_thread( boost::exception_ptr & error )
|
||||
{
|
||||
try
|
||||
{
|
||||
do_work();
|
||||
error = boost::exception_ptr();
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
error = boost::current_exception();
|
||||
}
|
||||
}
|
||||
|
||||
// ...continued
|
||||
|
||||
void
|
||||
work()
|
||||
{
|
||||
boost::exception_ptr error;
|
||||
boost::thread t( boost::bind(worker_thread,boost::ref(error)) );
|
||||
t.join();
|
||||
if( error )
|
||||
boost::rethrow_exception(error);
|
||||
}
|
35
example/enable_error_info.cpp
Normal file
35
example/enable_error_info.cpp
Normal file
@ -0,0 +1,35 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This example shows how to throw exception objects that support
|
||||
//transporting of arbitrary data to the catch site, even for types
|
||||
//that do not derive from boost::exception.
|
||||
|
||||
#include <boost/exception.hpp>
|
||||
#include <stdexcept>
|
||||
|
||||
typedef boost::error_info<struct tag_std_range_min,size_t> std_range_min;
|
||||
typedef boost::error_info<struct tag_std_range_max,size_t> std_range_max;
|
||||
typedef boost::error_info<struct tag_std_range_index,size_t> std_range_index;
|
||||
|
||||
template <class T>
|
||||
class
|
||||
my_container
|
||||
{
|
||||
public:
|
||||
|
||||
size_t size() const;
|
||||
|
||||
T const &
|
||||
operator[]( size_t i ) const
|
||||
{
|
||||
if( i > size() )
|
||||
throw boost::enable_error_info(std::range_error("Index out of range")) <<
|
||||
std_range_min(0) <<
|
||||
std_range_max(size()) <<
|
||||
std_range_index(i);
|
||||
//....
|
||||
}
|
||||
};
|
36
example/error_info_1.cpp
Normal file
36
example/error_info_1.cpp
Normal file
@ -0,0 +1,36 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This example shows how to add data to boost::exception objects at the
|
||||
//point of the throw, and how to retrieve that data at the point of the catch.
|
||||
|
||||
#include <boost/exception.hpp>
|
||||
#include <errno.h>
|
||||
#include <iostream>
|
||||
|
||||
typedef boost::error_info<struct tag_errno,int> errno_info; //(1)
|
||||
|
||||
class my_error: public boost::exception, public std::exception { }; //(2)
|
||||
|
||||
void
|
||||
f()
|
||||
{
|
||||
throw my_error() << errno_info(errno); //(3)
|
||||
}
|
||||
|
||||
void
|
||||
g()
|
||||
{
|
||||
try
|
||||
{
|
||||
f();
|
||||
}
|
||||
catch(
|
||||
my_error & x )
|
||||
{
|
||||
if( int const * err=boost::get_error_info<errno_info>(x) )
|
||||
std::cerr << "Error code: " << *err;
|
||||
}
|
||||
}
|
49
example/error_info_2.cpp
Normal file
49
example/error_info_2.cpp
Normal file
@ -0,0 +1,49 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This example shows how to add arbitrary data to active exception objects.
|
||||
|
||||
#include <boost/exception.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
|
||||
//
|
||||
|
||||
typedef boost::error_info<struct tag_errno,int> errno_info;
|
||||
|
||||
class file_read_error: public boost::exception { };
|
||||
|
||||
void
|
||||
file_read( FILE * f, void * buffer, size_t size )
|
||||
{
|
||||
if( size!=fread(buffer,1,size,f) )
|
||||
throw file_read_error() << errno_info(errno);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
|
||||
|
||||
boost::shared_ptr<FILE> file_open( char const * file_name, char const * mode );
|
||||
void file_read( FILE * f, void * buffer, size_t size );
|
||||
|
||||
void
|
||||
parse_file( char const * file_name )
|
||||
{
|
||||
boost::shared_ptr<FILE> f = file_open(file_name,"rb");
|
||||
assert(f);
|
||||
try
|
||||
{
|
||||
char buf[1024];
|
||||
file_read( f.get(), buf, sizeof(buf) );
|
||||
}
|
||||
catch(
|
||||
boost::exception & e )
|
||||
{
|
||||
e << file_name_info(file_name);
|
||||
throw;
|
||||
}
|
||||
}
|
225
example/example_io.cpp
Normal file
225
example/example_io.cpp
Normal file
@ -0,0 +1,225 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This program simulates errors on copying simple data files.
|
||||
//It demonstrates how the proposed Boost exception library can be used.
|
||||
//
|
||||
//The documentation for boost::exception can be found at:
|
||||
//
|
||||
// http://www.revergestudios.com/boost-exception/boost-exception.htm.
|
||||
//
|
||||
//The output from this program can vary depending on the compiler/OS combination.
|
||||
|
||||
#include <boost/exception.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <boost/weak_ptr.hpp>
|
||||
#include <stdio.h>
|
||||
#include <errno.h>
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
typedef boost::error_info<struct tag_errno,int> errno_info;
|
||||
typedef boost::error_info<struct tag_file_stream,boost::weak_ptr<FILE> > file_stream_info;
|
||||
typedef boost::error_info<struct tag_open_mode,std::string> open_mode_info; //The open mode of a failed fopen request.
|
||||
typedef boost::error_info<struct tag_file_name,std::string> file_name_info; //The file name of a failed file operation.
|
||||
typedef boost::error_info<struct tag_file_name_src,std::string> file_name_src_info; //The source file name of a failed copy operation.
|
||||
typedef boost::error_info<struct tag_file_name_dst,std::string> file_name_dst_info; //The destination file name of a failed copy operation.
|
||||
typedef boost::error_info<struct tag_function,std::string> function_info; //The name of the C function which reported the failure.
|
||||
|
||||
std::string
|
||||
to_string( errno_info const & e )
|
||||
{
|
||||
int en=e.value();
|
||||
std::ostringstream s;
|
||||
s << en << ", OS says \"" << strerror(en) << "\"";
|
||||
return s.str();
|
||||
}
|
||||
|
||||
char const data[] = "example";
|
||||
size_t const data_size = sizeof(data);
|
||||
|
||||
class
|
||||
error: //Base for all exception objects we throw.
|
||||
public std::exception,
|
||||
public boost::exception
|
||||
{
|
||||
public:
|
||||
|
||||
char const *
|
||||
what() const throw()
|
||||
{
|
||||
return "example_io error";
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
~error() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
class open_error: public error { };
|
||||
class read_error: public error { };
|
||||
class write_error: public error { };
|
||||
|
||||
class fopen_error: public open_error { };
|
||||
class fread_error: public read_error { };
|
||||
class fwrite_error: public write_error { };
|
||||
|
||||
|
||||
boost::shared_ptr<FILE>
|
||||
my_fopen( char const * name, char const * mode )
|
||||
{
|
||||
if( FILE * f = ::fopen(name,mode) )
|
||||
return boost::shared_ptr<FILE>(f,fclose);
|
||||
else
|
||||
BOOST_THROW_EXCEPTION(fopen_error() <<
|
||||
errno_info(errno) <<
|
||||
file_name_info(name) <<
|
||||
open_mode_info(mode) <<
|
||||
function_info("fopen"));
|
||||
}
|
||||
|
||||
void
|
||||
my_fread( void * buffer, size_t size, size_t count, boost::shared_ptr<FILE> const & stream )
|
||||
{
|
||||
assert(stream);
|
||||
if( count!=fread(buffer,size,count,stream.get()) || ferror(stream.get()) )
|
||||
BOOST_THROW_EXCEPTION(fread_error() <<
|
||||
function_info("fread") <<
|
||||
errno_info(errno) <<
|
||||
file_stream_info(boost::weak_ptr<FILE>(stream)));
|
||||
}
|
||||
|
||||
void
|
||||
my_fwrite( void const * buffer, size_t size, size_t count, boost::shared_ptr<FILE> const & stream )
|
||||
{
|
||||
assert(stream);
|
||||
if( count!=fwrite(buffer,size,count,stream.get()) || ferror(stream.get()) )
|
||||
BOOST_THROW_EXCEPTION(fwrite_error() <<
|
||||
function_info("fwrite") <<
|
||||
errno_info(errno) <<
|
||||
file_stream_info(boost::weak_ptr<FILE>(stream)));
|
||||
}
|
||||
|
||||
void
|
||||
reset_file( char const * file_name )
|
||||
{
|
||||
(void) my_fopen(file_name,"wb");
|
||||
}
|
||||
|
||||
void
|
||||
create_data( char const * file_name )
|
||||
{
|
||||
boost::shared_ptr<FILE> f = my_fopen(file_name,"wb");
|
||||
my_fwrite( data, 1, data_size, f );
|
||||
}
|
||||
|
||||
void
|
||||
copy_data( char const * src_file_name, char const * dst_file_name )
|
||||
{
|
||||
boost::shared_ptr<FILE> src = my_fopen(src_file_name,"rb");
|
||||
boost::shared_ptr<FILE> dst = my_fopen(dst_file_name,"wb");
|
||||
try
|
||||
{
|
||||
char buffer[data_size];
|
||||
my_fread( buffer, 1, data_size, src );
|
||||
my_fwrite( buffer, 1, data_size, dst );
|
||||
}
|
||||
catch(
|
||||
boost::exception & x )
|
||||
{
|
||||
if( boost::weak_ptr<FILE> const * f=boost::get_error_info<file_stream_info>(x) )
|
||||
if( boost::shared_ptr<FILE> fs = f->lock() )
|
||||
{
|
||||
if( fs==src )
|
||||
x << file_name_info(src_file_name);
|
||||
else if( fs==dst )
|
||||
x << file_name_info(dst_file_name);
|
||||
}
|
||||
x <<
|
||||
file_name_src_info(src_file_name) <<
|
||||
file_name_dst_info(dst_file_name);
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
dump_copy_info( boost::exception const & x )
|
||||
{
|
||||
if( std::string const * src = boost::get_error_info<file_name_src_info>(x) )
|
||||
std::cerr << "Source file name: " << *src << "\n";
|
||||
if( std::string const * dst = boost::get_error_info<file_name_dst_info>(x) )
|
||||
std::cerr << "Destination file name: " << *dst << "\n";
|
||||
}
|
||||
|
||||
void
|
||||
dump_file_info( boost::exception const & x )
|
||||
{
|
||||
if( std::string const * fn = boost::get_error_info<file_name_info>(x) )
|
||||
std::cerr << "File name: " << *fn << "\n";
|
||||
}
|
||||
|
||||
void
|
||||
dump_clib_info( boost::exception const & x )
|
||||
{
|
||||
if( int const * err=boost::get_error_info<errno_info>(x) )
|
||||
std::cerr << "OS error: " << *err << "\n";
|
||||
if( std::string const * fn=boost::get_error_info<function_info>(x) )
|
||||
std::cerr << "Failed function: " << *fn << "\n";
|
||||
}
|
||||
|
||||
void
|
||||
dump_all_info( boost::exception const & x )
|
||||
{
|
||||
std::cerr << "-------------------------------------------------\n";
|
||||
dump_copy_info(x);
|
||||
dump_file_info(x);
|
||||
dump_clib_info(x);
|
||||
std::cerr << "\nOutput from diagnostic_information():\n";
|
||||
std::cerr << diagnostic_information(x);
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
create_data( "tmp1.txt" );
|
||||
copy_data( "tmp1.txt", "tmp2.txt" ); //This should succeed.
|
||||
|
||||
reset_file( "tmp1.txt" ); //Creates empty file.
|
||||
try
|
||||
{
|
||||
copy_data( "tmp1.txt", "tmp2.txt" ); //This should fail, tmp1.txt is empty.
|
||||
}
|
||||
catch(
|
||||
read_error & x )
|
||||
{
|
||||
std::cerr << "\nCaught 'read_error' exception.\n";
|
||||
dump_all_info(x);
|
||||
}
|
||||
|
||||
remove( "tmp1.txt" );
|
||||
remove( "tmp2.txt" );
|
||||
try
|
||||
{
|
||||
copy_data( "tmp1.txt", "tmp2.txt" ); //This should fail, tmp1.txt does not exist.
|
||||
}
|
||||
catch(
|
||||
open_error & x )
|
||||
{
|
||||
std::cerr << "\nCaught 'open_error' exception.\n";
|
||||
dump_all_info(x);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
std::cerr << "\nCaught unexpected exception!\n";
|
||||
std::cerr << boost::current_exception_diagnostic_information();
|
||||
}
|
||||
}
|
31
example/info_tuple.cpp
Normal file
31
example/info_tuple.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This example shows how boost::error_info_group can be used to bundle
|
||||
//the name of the function that fails together with the reported errno.
|
||||
|
||||
#include <boost/exception/info_tuple.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <stdio.h>
|
||||
#include <string>
|
||||
#include <errno.h>
|
||||
|
||||
typedef boost::error_info<struct tag_file_name,std::string> file_name_info;
|
||||
typedef boost::error_info<struct tag_function,char const *> function_info;
|
||||
typedef boost::error_info<struct tag_errno,int> errno_info;
|
||||
typedef boost::tuple<function_info,errno_info> clib_failure;
|
||||
|
||||
class file_open_error: public boost::exception { };
|
||||
|
||||
boost::shared_ptr<FILE>
|
||||
file_open( char const * name, char const * mode )
|
||||
{
|
||||
if( FILE * f=fopen(name,mode) )
|
||||
return boost::shared_ptr<FILE>(f,fclose);
|
||||
else
|
||||
throw file_open_error() <<
|
||||
file_name_info(name) <<
|
||||
clib_failure("fopen",errno);
|
||||
}
|
25
example/logging.cpp
Normal file
25
example/logging.cpp
Normal file
@ -0,0 +1,25 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
//This example shows to print all data contained in a boost::exception.
|
||||
|
||||
#include <boost/exception.hpp>
|
||||
#include <iostream>
|
||||
|
||||
void f(); //throws unknown types that derive from boost::exception.
|
||||
|
||||
void
|
||||
g()
|
||||
{
|
||||
try
|
||||
{
|
||||
f();
|
||||
}
|
||||
catch(
|
||||
boost::exception & e )
|
||||
{
|
||||
std::cerr << diagnostic_information(e);
|
||||
}
|
||||
}
|
34
include/boost/exception/current_exception_cast.hpp
Normal file
34
include/boost/exception/current_exception_cast.hpp
Normal file
@ -0,0 +1,34 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_7E83C166200811DE885E826156D89593
|
||||
#define UUID_7E83C166200811DE885E826156D89593
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
template <class E>
|
||||
inline
|
||||
E *
|
||||
current_exception_cast()
|
||||
{
|
||||
try
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(
|
||||
E & e )
|
||||
{
|
||||
return &e;
|
||||
}
|
||||
catch(
|
||||
...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
61
include/boost/exception/detail/error_info_impl.hpp
Normal file
61
include/boost/exception/detail/error_info_impl.hpp
Normal file
@ -0,0 +1,61 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_CE6983AC753411DDA764247956D89593
|
||||
#define UUID_CE6983AC753411DDA764247956D89593
|
||||
|
||||
#include <string>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
class
|
||||
error_info_base
|
||||
{
|
||||
public:
|
||||
|
||||
virtual char const * tag_typeid_name() const = 0;
|
||||
virtual std::string value_as_string() const = 0;
|
||||
|
||||
protected:
|
||||
|
||||
virtual
|
||||
~error_info_base() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
class
|
||||
error_info:
|
||||
public exception_detail::error_info_base
|
||||
{
|
||||
public:
|
||||
|
||||
typedef T value_type;
|
||||
|
||||
error_info( value_type const & value );
|
||||
~error_info() throw();
|
||||
|
||||
value_type const &
|
||||
value() const
|
||||
{
|
||||
return value_;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
char const * tag_typeid_name() const;
|
||||
std::string value_as_string() const;
|
||||
|
||||
value_type const value_;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
38
include/boost/exception/detail/is_output_streamable.hpp
Normal file
38
include/boost/exception/detail/is_output_streamable.hpp
Normal file
@ -0,0 +1,38 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_898984B4076411DD973EDFA055D89593
|
||||
#define UUID_898984B4076411DD973EDFA055D89593
|
||||
|
||||
#include <ostream>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
to_string_detail
|
||||
{
|
||||
template <class T,class CharT,class Traits>
|
||||
char operator<<( std::basic_ostream<CharT,Traits> &, T const & );
|
||||
|
||||
template <class T,class CharT,class Traits>
|
||||
struct
|
||||
is_output_streamable_impl
|
||||
{
|
||||
static std::basic_ostream<CharT,Traits> & f();
|
||||
static T const & g();
|
||||
enum e { value=1!=(sizeof(f()<<g())) };
|
||||
};
|
||||
}
|
||||
|
||||
template <class T, class CharT=char, class Traits=std::char_traits<CharT> >
|
||||
struct
|
||||
is_output_streamable
|
||||
{
|
||||
enum e { value=to_string_detail::is_output_streamable_impl<T,CharT,Traits>::value };
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
40
include/boost/exception/detail/object_hex_dump.hpp
Normal file
40
include/boost/exception/detail/object_hex_dump.hpp
Normal file
@ -0,0 +1,40 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_6F463AC838DF11DDA3E6909F56D89593
|
||||
#define UUID_6F463AC838DF11DDA3E6909F56D89593
|
||||
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#include <iomanip>
|
||||
#include <ios>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class T>
|
||||
inline
|
||||
std::string
|
||||
object_hex_dump( T const & x, size_t max_size=16 )
|
||||
{
|
||||
std::ostringstream s;
|
||||
s << "type: " << type_name<T>() << ", size: " << sizeof(T) << ", dump: ";
|
||||
size_t n=sizeof(T)>max_size?max_size:sizeof(T);
|
||||
s.fill('0');
|
||||
s.width(2);
|
||||
unsigned char const * b=reinterpret_cast<unsigned char const *>(&x);
|
||||
s << std::setw(2) << std::hex << (unsigned int)*b;
|
||||
for( unsigned char const * e=b+n; ++b!=e; )
|
||||
s << " " << std::setw(2) << std::hex << (unsigned int)*b;
|
||||
return s.str();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
130
include/boost/exception/detail/type_info.hpp
Normal file
130
include/boost/exception/detail/type_info.hpp
Normal file
@ -0,0 +1,130 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_C3E1741C754311DDB2834CCA55D89593
|
||||
#define UUID_C3E1741C754311DDB2834CCA55D89593
|
||||
|
||||
#include <boost/detail/sp_typeinfo.hpp>
|
||||
#include <boost/current_function.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
template <class T>
|
||||
inline
|
||||
char const *
|
||||
tag_type_name()
|
||||
{
|
||||
#ifdef BOOST_NO_TYPEID
|
||||
return BOOST_CURRENT_FUNCTION;
|
||||
#else
|
||||
return typeid(T*).name();
|
||||
#endif
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
char const *
|
||||
type_name()
|
||||
{
|
||||
#ifdef BOOST_NO_TYPEID
|
||||
return BOOST_CURRENT_FUNCTION;
|
||||
#else
|
||||
return typeid(T).name();
|
||||
#endif
|
||||
}
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
#ifdef BOOST_NO_TYPEID
|
||||
struct
|
||||
type_info_
|
||||
{
|
||||
detail::sp_typeinfo type_;
|
||||
char const * name_;
|
||||
|
||||
explicit
|
||||
type_info_( detail::sp_typeinfo type, char const * name ):
|
||||
type_(type),
|
||||
name_(name)
|
||||
{
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator==( type_info_ const & a, type_info_ const & b )
|
||||
{
|
||||
return a.type_==b.type_;
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator<( type_info_ const & a, type_info_ const & b )
|
||||
{
|
||||
return a.type_<b.type_;
|
||||
}
|
||||
|
||||
char const *
|
||||
name() const
|
||||
{
|
||||
return name_;
|
||||
}
|
||||
};
|
||||
#else
|
||||
struct
|
||||
type_info_
|
||||
{
|
||||
detail::sp_typeinfo const * type_;
|
||||
|
||||
explicit
|
||||
type_info_( detail::sp_typeinfo const & type ):
|
||||
type_(&type)
|
||||
{
|
||||
}
|
||||
|
||||
type_info_( detail::sp_typeinfo const & type, char const * ):
|
||||
type_(&type)
|
||||
{
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator==( type_info_ const & a, type_info_ const & b )
|
||||
{
|
||||
return (*a.type_)==(*b.type_);
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator<( type_info_ const & a, type_info_ const & b )
|
||||
{
|
||||
return 0!=(a.type_->before(*b.type_));
|
||||
}
|
||||
|
||||
char const *
|
||||
name() const
|
||||
{
|
||||
return type_->name();
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
inline
|
||||
bool
|
||||
operator!=( type_info_ const & a, type_info_ const & b )
|
||||
{
|
||||
return !(a==b);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#define BOOST_EXCEPTION_STATIC_TYPEID(T) ::boost::exception_detail::type_info_(BOOST_SP_TYPEID(T),::boost::tag_type_name<T>())
|
||||
|
||||
#ifndef BOOST_NO_RTTI
|
||||
#define BOOST_EXCEPTION_DYNAMIC_TYPEID(x) ::boost::exception_detail::type_info_(typeid(x))
|
||||
#endif
|
||||
|
||||
#endif
|
152
include/boost/exception/diagnostic_information.hpp
Normal file
152
include/boost/exception/diagnostic_information.hpp
Normal file
@ -0,0 +1,152 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_0552D49838DD11DD90146B8956D89593
|
||||
#define UUID_0552D49838DD11DD90146B8956D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <exception>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class T>
|
||||
struct
|
||||
enable_boost_exception_overload
|
||||
{
|
||||
struct yes { char q[100]; };
|
||||
typedef char no;
|
||||
static yes check(exception const *);
|
||||
static no check(...);
|
||||
enum e { value=sizeof(check((T*)0))==sizeof(yes) };
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_std_exception_overload
|
||||
{
|
||||
struct yes { char q[100]; };
|
||||
typedef char no;
|
||||
static yes check(std::exception const *);
|
||||
static no check(...);
|
||||
enum e { value = !enable_boost_exception_overload<T>::value && sizeof(check((T*)0))==sizeof(yes) };
|
||||
};
|
||||
|
||||
#ifndef BOOST_NO_RTTI
|
||||
template <class T>
|
||||
inline
|
||||
std::string
|
||||
dynamic_exception_type( T const & x )
|
||||
{
|
||||
return std::string("Dynamic exception type: ") + BOOST_EXCEPTION_DYNAMIC_TYPEID(x).name();
|
||||
}
|
||||
#endif
|
||||
|
||||
inline
|
||||
char const *
|
||||
get_diagnostic_information( exception const & x )
|
||||
{
|
||||
if( error_info_container * c=x.data_.get() )
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
try
|
||||
{
|
||||
#endif
|
||||
return c->diagnostic_information();
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
return 0;
|
||||
}
|
||||
|
||||
inline
|
||||
std::string
|
||||
boost_diagnostic_information( exception const & x )
|
||||
{
|
||||
std::ostringstream tmp;
|
||||
if( char const * const * f=get_error_info<throw_file>(x) )
|
||||
{
|
||||
tmp << *f;
|
||||
if( int const * l=get_error_info<throw_line>(x) )
|
||||
tmp << '(' << *l << "): ";
|
||||
}
|
||||
tmp << "Throw in function ";
|
||||
if( char const * const * fn=get_error_info<throw_function>(x) )
|
||||
tmp << *fn;
|
||||
else
|
||||
tmp << "(unknown)";
|
||||
tmp << std::endl;
|
||||
#ifndef BOOST_NO_RTTI
|
||||
tmp << dynamic_exception_type(x) << std::endl;
|
||||
if( std::exception const * e=dynamic_cast<std::exception const *>(&x) )
|
||||
tmp << "std::exception::what: " << e->what() << std::endl;
|
||||
#endif
|
||||
if( char const * s=exception_detail::get_diagnostic_information(x) )
|
||||
if( *s )
|
||||
tmp << s;
|
||||
return tmp.str();
|
||||
}
|
||||
|
||||
inline
|
||||
std::string
|
||||
std_diagnostic_information( std::exception const & x )
|
||||
{
|
||||
std::ostringstream tmp;
|
||||
#ifndef BOOST_NO_RTTI
|
||||
if( exception const * e=dynamic_cast<exception const *>(&x) )
|
||||
return boost_diagnostic_information(*e);
|
||||
tmp << dynamic_exception_type(x) << std::endl;
|
||||
#endif
|
||||
tmp << "std::exception::what: " << x.what() << std::endl;
|
||||
return tmp.str();
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
typename enable_if<exception_detail::enable_boost_exception_overload<T>,std::string>::type
|
||||
diagnostic_information( T const & e )
|
||||
{
|
||||
return exception_detail::boost_diagnostic_information(e);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
typename enable_if<exception_detail::enable_std_exception_overload<T>,std::string>::type
|
||||
diagnostic_information( T const & e )
|
||||
{
|
||||
return exception_detail::std_diagnostic_information(e);
|
||||
}
|
||||
}
|
||||
|
||||
#ifndef BOOST_NO_EXCEPTIONS
|
||||
#include <boost/exception/current_exception_cast.hpp>
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
inline
|
||||
std::string
|
||||
current_exception_diagnostic_information()
|
||||
{
|
||||
if( boost::exception const * e=current_exception_cast<boost::exception const>() )
|
||||
return diagnostic_information(*e);
|
||||
else if( std::exception const * e=current_exception_cast<std::exception const>() )
|
||||
return diagnostic_information(*e);
|
||||
else
|
||||
return "No diagnostic information available.";
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
6
include/boost/exception/enable_current_exception.hpp
Normal file
6
include/boost/exception/enable_current_exception.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
6
include/boost/exception/enable_error_info.hpp
Normal file
6
include/boost/exception/enable_error_info.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
6
include/boost/exception/error_info.hpp
Normal file
6
include/boost/exception/error_info.hpp
Normal file
@ -0,0 +1,6 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
namespace boost { template <class Tag,class T> class error_info; }
|
396
include/boost/exception/exception.hpp
Normal file
396
include/boost/exception/exception.hpp
Normal file
@ -0,0 +1,396 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_274DA366004E11DCB1DDFE2E56D89593
|
||||
#define UUID_274DA366004E11DCB1DDFE2E56D89593
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class T>
|
||||
class
|
||||
refcount_ptr
|
||||
{
|
||||
public:
|
||||
|
||||
refcount_ptr():
|
||||
px_(0)
|
||||
{
|
||||
}
|
||||
|
||||
~refcount_ptr()
|
||||
{
|
||||
release();
|
||||
}
|
||||
|
||||
refcount_ptr( refcount_ptr const & x ):
|
||||
px_(x.px_)
|
||||
{
|
||||
add_ref();
|
||||
}
|
||||
|
||||
refcount_ptr &
|
||||
operator=( refcount_ptr const & x )
|
||||
{
|
||||
adopt(x.px_);
|
||||
return *this;
|
||||
}
|
||||
|
||||
void
|
||||
adopt( T * px )
|
||||
{
|
||||
release();
|
||||
px_=px;
|
||||
add_ref();
|
||||
}
|
||||
|
||||
T *
|
||||
get() const
|
||||
{
|
||||
return px_;
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
T * px_;
|
||||
|
||||
void
|
||||
add_ref()
|
||||
{
|
||||
if( px_ )
|
||||
px_->add_ref();
|
||||
}
|
||||
|
||||
void
|
||||
release()
|
||||
{
|
||||
if( px_ )
|
||||
px_->release();
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
template <class Tag,class T>
|
||||
class error_info;
|
||||
|
||||
typedef error_info<struct tag_throw_function,char const *> throw_function;
|
||||
typedef error_info<struct tag_throw_file,char const *> throw_file;
|
||||
typedef error_info<struct tag_throw_line,int> throw_line;
|
||||
|
||||
template <>
|
||||
class
|
||||
error_info<tag_throw_function,char const *>
|
||||
{
|
||||
public:
|
||||
typedef char const * value_type;
|
||||
value_type v_;
|
||||
explicit
|
||||
error_info( value_type v ):
|
||||
v_(v)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class
|
||||
error_info<tag_throw_file,char const *>
|
||||
{
|
||||
public:
|
||||
typedef char const * value_type;
|
||||
value_type v_;
|
||||
explicit
|
||||
error_info( value_type v ):
|
||||
v_(v)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
class
|
||||
error_info<tag_throw_line,int>
|
||||
{
|
||||
public:
|
||||
typedef int value_type;
|
||||
value_type v_;
|
||||
explicit
|
||||
error_info( value_type v ):
|
||||
v_(v)
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <class E,class Tag,class T>
|
||||
E const & operator<<( E const &, error_info<Tag,T> const & );
|
||||
|
||||
class exception;
|
||||
|
||||
template <class>
|
||||
class shared_ptr;
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
class error_info_base;
|
||||
struct type_info_;
|
||||
|
||||
struct
|
||||
error_info_container
|
||||
{
|
||||
virtual char const * diagnostic_information() const = 0;
|
||||
virtual shared_ptr<error_info_base const> get( type_info_ const & ) const = 0;
|
||||
virtual void set( shared_ptr<error_info_base const> const &, type_info_ const & ) = 0;
|
||||
virtual void add_ref() const = 0;
|
||||
virtual void release() const = 0;
|
||||
|
||||
protected:
|
||||
|
||||
virtual
|
||||
~error_info_container() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
template <class>
|
||||
struct get_info;
|
||||
|
||||
template <>
|
||||
struct get_info<throw_function>;
|
||||
|
||||
template <>
|
||||
struct get_info<throw_file>;
|
||||
|
||||
template <>
|
||||
struct get_info<throw_line>;
|
||||
|
||||
char const * get_diagnostic_information( exception const & );
|
||||
}
|
||||
|
||||
class
|
||||
exception
|
||||
{
|
||||
protected:
|
||||
|
||||
exception():
|
||||
throw_function_(0),
|
||||
throw_file_(0),
|
||||
throw_line_(-1)
|
||||
{
|
||||
}
|
||||
|
||||
#ifdef __HP_aCC
|
||||
//On HP aCC, this protected copy constructor prevents throwing boost::exception.
|
||||
//On all other platforms, the same effect is achieved by the pure virtual destructor.
|
||||
exception( exception const & x ) throw():
|
||||
data_(x.data_),
|
||||
throw_function_(x.throw_function_),
|
||||
throw_file_(x.throw_file_),
|
||||
throw_line_(x.throw_line_)
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
virtual ~exception() throw()
|
||||
#ifndef __HP_aCC
|
||||
= 0 //Workaround for HP aCC, =0 incorrectly leads to link errors.
|
||||
#endif
|
||||
;
|
||||
|
||||
private:
|
||||
|
||||
template <class E>
|
||||
friend
|
||||
E const &
|
||||
operator<<( E const & x, throw_function const & y )
|
||||
{
|
||||
x.throw_function_=y.v_;
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class E>
|
||||
friend
|
||||
E const &
|
||||
operator<<( E const & x, throw_file const & y )
|
||||
{
|
||||
x.throw_file_=y.v_;
|
||||
return x;
|
||||
}
|
||||
|
||||
template <class E>
|
||||
friend
|
||||
E const &
|
||||
operator<<( E const & x, throw_line const & y )
|
||||
{
|
||||
x.throw_line_=y.v_;
|
||||
return x;
|
||||
}
|
||||
|
||||
friend char const * exception_detail::get_diagnostic_information( exception const & );
|
||||
|
||||
template <class E,class Tag,class T>
|
||||
friend E const & operator<<( E const &, error_info<Tag,T> const & );
|
||||
|
||||
template <class>
|
||||
friend struct exception_detail::get_info;
|
||||
friend struct exception_detail::get_info<throw_function>;
|
||||
friend struct exception_detail::get_info<throw_file>;
|
||||
friend struct exception_detail::get_info<throw_line>;
|
||||
|
||||
mutable exception_detail::refcount_ptr<exception_detail::error_info_container> data_;
|
||||
mutable char const * throw_function_;
|
||||
mutable char const * throw_file_;
|
||||
mutable int throw_line_;
|
||||
};
|
||||
|
||||
inline
|
||||
exception::
|
||||
~exception() throw()
|
||||
{
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class T>
|
||||
struct
|
||||
error_info_injector:
|
||||
public T,
|
||||
public exception
|
||||
{
|
||||
explicit
|
||||
error_info_injector( T const & x ):
|
||||
T(x)
|
||||
{
|
||||
}
|
||||
|
||||
~error_info_injector() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
struct large_size { char c[256]; };
|
||||
large_size dispatch( exception * );
|
||||
|
||||
struct small_size { };
|
||||
small_size dispatch( void * );
|
||||
|
||||
template <class,int>
|
||||
struct enable_error_info_helper;
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_helper<T,sizeof(large_size)>
|
||||
{
|
||||
typedef T type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_helper<T,sizeof(small_size)>
|
||||
{
|
||||
typedef error_info_injector<T> type;
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
enable_error_info_return_type
|
||||
{
|
||||
typedef typename enable_error_info_helper<T,sizeof(dispatch((T*)0))>::type type;
|
||||
};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
typename
|
||||
exception_detail::enable_error_info_return_type<T>::type
|
||||
enable_error_info( T const & x )
|
||||
{
|
||||
typedef typename exception_detail::enable_error_info_return_type<T>::type rt;
|
||||
return rt(x);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
class
|
||||
clone_base
|
||||
{
|
||||
public:
|
||||
|
||||
virtual clone_base const * clone() const = 0;
|
||||
virtual void rethrow() const = 0;
|
||||
|
||||
virtual
|
||||
~clone_base() throw()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
inline
|
||||
void
|
||||
copy_boost_exception( exception * a, exception const * b )
|
||||
{
|
||||
*a = *b;
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
copy_boost_exception( void *, void const * )
|
||||
{
|
||||
}
|
||||
|
||||
template <class T>
|
||||
class
|
||||
clone_impl:
|
||||
public T,
|
||||
public clone_base
|
||||
{
|
||||
public:
|
||||
|
||||
explicit
|
||||
clone_impl( T const & x ):
|
||||
T(x)
|
||||
{
|
||||
copy_boost_exception(this,&x);
|
||||
}
|
||||
|
||||
~clone_impl() throw()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
clone_base const *
|
||||
clone() const
|
||||
{
|
||||
return new clone_impl(*this);
|
||||
}
|
||||
|
||||
void
|
||||
rethrow() const
|
||||
{
|
||||
throw*this;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
exception_detail::clone_impl<T>
|
||||
enable_current_exception( T const & x )
|
||||
{
|
||||
return exception_detail::clone_impl<T>(x);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
100
include/boost/exception/get_error_info.hpp
Normal file
100
include/boost/exception/get_error_info.hpp
Normal file
@ -0,0 +1,100 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_1A590226753311DD9E4CCF6156D89593
|
||||
#define UUID_1A590226753311DD9E4CCF6156D89593
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/detail/error_info_impl.hpp>
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class ErrorInfo>
|
||||
struct
|
||||
get_info
|
||||
{
|
||||
static
|
||||
typename ErrorInfo::value_type const *
|
||||
get( exception const & x )
|
||||
{
|
||||
if( exception_detail::error_info_container * c=x.data_.get() )
|
||||
if( shared_ptr<exception_detail::error_info_base const> eib = c->get(BOOST_EXCEPTION_STATIC_TYPEID(ErrorInfo)) )
|
||||
{
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_ASSERT( 0!=dynamic_cast<ErrorInfo const *>(eib.get()) );
|
||||
#endif
|
||||
ErrorInfo const * w = static_cast<ErrorInfo const *>(eib.get());
|
||||
return &w->value();
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct
|
||||
get_info<throw_function>
|
||||
{
|
||||
static
|
||||
char const * const *
|
||||
get( exception const & x )
|
||||
{
|
||||
return x.throw_function_ ? &x.throw_function_ : 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct
|
||||
get_info<throw_file>
|
||||
{
|
||||
static
|
||||
char const * const *
|
||||
get( exception const & x )
|
||||
{
|
||||
return x.throw_file_ ? &x.throw_file_ : 0;
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct
|
||||
get_info<throw_line>
|
||||
{
|
||||
static
|
||||
int const *
|
||||
get( exception const & x )
|
||||
{
|
||||
return x.throw_line_!=-1 ? &x.throw_line_ : 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
#ifdef BOOST_NO_RTTI
|
||||
template <class ErrorInfo>
|
||||
inline
|
||||
typename ErrorInfo::value_type const *
|
||||
get_error_info( boost::exception const & x )
|
||||
{
|
||||
return exception_detail::get_info<ErrorInfo>::get(x);
|
||||
}
|
||||
#else
|
||||
template <class ErrorInfo,class E>
|
||||
inline
|
||||
typename ErrorInfo::value_type const *
|
||||
get_error_info( E const & some_exception )
|
||||
{
|
||||
if( exception const * x = dynamic_cast<exception const *>(&some_exception) )
|
||||
return exception_detail::get_info<ErrorInfo>::get(*x);
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
155
include/boost/exception/info.hpp
Normal file
155
include/boost/exception/info.hpp
Normal file
@ -0,0 +1,155 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_8D22C4CA9CC811DCAA9133D256D89593
|
||||
#define UUID_8D22C4CA9CC811DCAA9133D256D89593
|
||||
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/to_string_stub.hpp>
|
||||
#include <boost/exception/detail/error_info_impl.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <map>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
typename enable_if<has_to_string<T>,std::string>::type
|
||||
to_string( error_info<Tag,T> const & x )
|
||||
{
|
||||
return to_string(x.value());
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
error_info<Tag,T>::
|
||||
error_info( value_type const & value ):
|
||||
value_(value)
|
||||
{
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
error_info<Tag,T>::
|
||||
~error_info() throw()
|
||||
{
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
char const *
|
||||
error_info<Tag,T>::
|
||||
tag_typeid_name() const
|
||||
{
|
||||
return tag_type_name<Tag>();
|
||||
}
|
||||
|
||||
template <class Tag,class T>
|
||||
inline
|
||||
std::string
|
||||
error_info<Tag,T>::
|
||||
value_as_string() const
|
||||
{
|
||||
return to_string_stub(*this);
|
||||
}
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
class
|
||||
error_info_container_impl:
|
||||
public error_info_container
|
||||
{
|
||||
public:
|
||||
|
||||
error_info_container_impl():
|
||||
count_(0)
|
||||
{
|
||||
}
|
||||
|
||||
~error_info_container_impl() throw()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
set( shared_ptr<error_info_base const> const & x, type_info_ const & typeid_ )
|
||||
{
|
||||
BOOST_ASSERT(x);
|
||||
info_[typeid_] = x;
|
||||
diagnostic_info_str_.clear();
|
||||
}
|
||||
|
||||
shared_ptr<error_info_base const>
|
||||
get( type_info_ const & ti ) const
|
||||
{
|
||||
error_info_map::const_iterator i=info_.find(ti);
|
||||
if( info_.end()!=i )
|
||||
{
|
||||
shared_ptr<error_info_base const> const & p = i->second;
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_ASSERT( BOOST_EXCEPTION_DYNAMIC_TYPEID(*p)==ti );
|
||||
#endif
|
||||
return p;
|
||||
}
|
||||
return shared_ptr<error_info_base const>();
|
||||
}
|
||||
|
||||
char const *
|
||||
diagnostic_information() const
|
||||
{
|
||||
if( diagnostic_info_str_.empty() )
|
||||
{
|
||||
std::ostringstream tmp;
|
||||
for( error_info_map::const_iterator i=info_.begin(),end=info_.end(); i!=end; ++i )
|
||||
{
|
||||
shared_ptr<error_info_base const> const & x = i->second;
|
||||
tmp << '[' << x->tag_typeid_name() << "] = " << x->value_as_string() << std::endl;
|
||||
}
|
||||
tmp.str().swap(diagnostic_info_str_);
|
||||
}
|
||||
return diagnostic_info_str_.c_str();
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
friend class boost::exception;
|
||||
|
||||
typedef std::map< type_info_, shared_ptr<error_info_base const> > error_info_map;
|
||||
error_info_map info_;
|
||||
mutable std::string diagnostic_info_str_;
|
||||
mutable int count_;
|
||||
|
||||
void
|
||||
add_ref() const
|
||||
{
|
||||
++count_;
|
||||
}
|
||||
|
||||
void
|
||||
release() const
|
||||
{
|
||||
if( !--count_ )
|
||||
delete this;
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
template <class E,class Tag,class T>
|
||||
inline
|
||||
E const &
|
||||
operator<<( E const & x, error_info<Tag,T> const & v )
|
||||
{
|
||||
typedef error_info<Tag,T> error_info_tag_t;
|
||||
shared_ptr<error_info_tag_t> p( new error_info_tag_t(v) );
|
||||
exception_detail::error_info_container * c;
|
||||
if( !(c=x.data_.get()) )
|
||||
x.data_.adopt(c=new exception_detail::error_info_container_impl);
|
||||
c->set(p,BOOST_EXCEPTION_STATIC_TYPEID(error_info_tag_t));
|
||||
return x;
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
67
include/boost/exception/info_tuple.hpp
Normal file
67
include/boost/exception/info_tuple.hpp
Normal file
@ -0,0 +1,67 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_63EE924290FB11DC87BB856555D89593
|
||||
#define UUID_63EE924290FB11DC87BB856555D89593
|
||||
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/tuple/tuple.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
template <
|
||||
class E,
|
||||
class Tag1,class T1,
|
||||
class Tag2,class T2 >
|
||||
inline
|
||||
E const &
|
||||
operator<<(
|
||||
E const & x,
|
||||
tuple<
|
||||
error_info<Tag1,T1>,
|
||||
error_info<Tag2,T2> > const & v )
|
||||
{
|
||||
return x << v.template get<0>() << v.template get<1>();
|
||||
}
|
||||
|
||||
template <
|
||||
class E,
|
||||
class Tag1,class T1,
|
||||
class Tag2,class T2,
|
||||
class Tag3,class T3 >
|
||||
inline
|
||||
E const &
|
||||
operator<<(
|
||||
E const & x,
|
||||
tuple<
|
||||
error_info<Tag1,T1>,
|
||||
error_info<Tag2,T2>,
|
||||
error_info<Tag3,T3> > const & v )
|
||||
{
|
||||
return x << v.template get<0>() << v.template get<1>() << v.template get<2>();
|
||||
}
|
||||
|
||||
template <
|
||||
class E,
|
||||
class Tag1,class T1,
|
||||
class Tag2,class T2,
|
||||
class Tag3,class T3,
|
||||
class Tag4,class T4 >
|
||||
inline
|
||||
E const &
|
||||
operator<<(
|
||||
E const & x,
|
||||
tuple<
|
||||
error_info<Tag1,T1>,
|
||||
error_info<Tag2,T2>,
|
||||
error_info<Tag3,T3>,
|
||||
error_info<Tag4,T4> > const & v )
|
||||
{
|
||||
return x << v.template get<0>() << v.template get<1>() << v.template get<2>() << v.template get<3>();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
74
include/boost/exception/to_string.hpp
Normal file
74
include/boost/exception/to_string.hpp
Normal file
@ -0,0 +1,74 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_7E48761AD92811DC9011477D56D89593
|
||||
#define UUID_7E48761AD92811DC9011477D56D89593
|
||||
|
||||
#include <boost/utility/enable_if.hpp>
|
||||
#include <boost/exception/detail/is_output_streamable.hpp>
|
||||
#include <sstream>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
to_string_detail
|
||||
{
|
||||
template <class T>
|
||||
typename disable_if<is_output_streamable<T>,char>::type to_string( T const & );
|
||||
|
||||
template <class,bool IsOutputStreamable>
|
||||
struct has_to_string_impl;
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
has_to_string_impl<T,true>
|
||||
{
|
||||
enum e { value=1 };
|
||||
};
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
has_to_string_impl<T,false>
|
||||
{
|
||||
static T const & f();
|
||||
enum e { value=1!=sizeof(to_string(f())) };
|
||||
};
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
typename enable_if<is_output_streamable<T>,std::string>::type
|
||||
to_string( T const & x )
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << x;
|
||||
return out.str();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
has_to_string
|
||||
{
|
||||
enum e { value=to_string_detail::has_to_string_impl<T,is_output_streamable<T>::value>::value };
|
||||
};
|
||||
|
||||
template <class T,class U>
|
||||
inline
|
||||
std::string
|
||||
to_string( std::pair<T,U> const & x )
|
||||
{
|
||||
return std::string("(") + to_string(x.first) + ',' + to_string(x.second) + ')';
|
||||
}
|
||||
|
||||
inline
|
||||
std::string
|
||||
to_string( std::exception const & x )
|
||||
{
|
||||
return x.what();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
100
include/boost/exception/to_string_stub.hpp
Normal file
100
include/boost/exception/to_string_stub.hpp
Normal file
@ -0,0 +1,100 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_E788439ED9F011DCB181F25B55D89593
|
||||
#define UUID_E788439ED9F011DCB181F25B55D89593
|
||||
|
||||
#include <boost/exception/to_string.hpp>
|
||||
#include <boost/exception/detail/object_hex_dump.hpp>
|
||||
#include <boost/assert.hpp>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <bool ToStringAvailable>
|
||||
struct
|
||||
to_string_dispatcher
|
||||
{
|
||||
template <class T,class Stub>
|
||||
static
|
||||
std::string
|
||||
convert( T const & x, Stub )
|
||||
{
|
||||
return to_string(x);
|
||||
}
|
||||
};
|
||||
|
||||
template <>
|
||||
struct
|
||||
to_string_dispatcher<false>
|
||||
{
|
||||
template <class T,class Stub>
|
||||
static
|
||||
std::string
|
||||
convert( T const & x, Stub s )
|
||||
{
|
||||
return s(x);
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static
|
||||
std::string
|
||||
convert( T const & x, std::string s )
|
||||
{
|
||||
return s;
|
||||
}
|
||||
|
||||
template <class T>
|
||||
static
|
||||
std::string
|
||||
convert( T const & x, char const * s )
|
||||
{
|
||||
BOOST_ASSERT(s!=0);
|
||||
return s;
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
to_string_dispatch
|
||||
{
|
||||
template <class T,class Stub>
|
||||
inline
|
||||
std::string
|
||||
dispatch( T const & x, Stub s )
|
||||
{
|
||||
return to_string_dispatcher<has_to_string<T>::value>::convert(x,s);
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
std::string
|
||||
string_stub_dump( T const & x )
|
||||
{
|
||||
return "[ " + exception_detail::object_hex_dump(x) + " ]";
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
std::string
|
||||
to_string_stub( T const & x )
|
||||
{
|
||||
return exception_detail::to_string_dispatch::dispatch(x,&exception_detail::string_stub_dump<T>);
|
||||
}
|
||||
|
||||
template <class T,class Stub>
|
||||
inline
|
||||
std::string
|
||||
to_string_stub( T const & x, Stub s )
|
||||
{
|
||||
return exception_detail::to_string_dispatch::dispatch(x,s);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
353
include/boost/exception_ptr.hpp
Normal file
353
include/boost/exception_ptr.hpp
Normal file
@ -0,0 +1,353 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#ifndef UUID_FA5836A2CADA11DC8CD47C8555D89593
|
||||
#define UUID_FA5836A2CADA11DC8CD47C8555D89593
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
#error This header requires exception handling to be enabled.
|
||||
#endif
|
||||
#include <boost/exception/exception.hpp>
|
||||
#include <boost/exception/detail/type_info.hpp>
|
||||
#include <boost/shared_ptr.hpp>
|
||||
#include <stdexcept>
|
||||
#include <new>
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
class exception_ptr;
|
||||
exception_ptr current_exception();
|
||||
void rethrow_exception( exception_ptr const & );
|
||||
|
||||
class
|
||||
exception_ptr
|
||||
{
|
||||
typedef bool exception_ptr::*unspecified_bool_type;
|
||||
friend exception_ptr current_exception();
|
||||
friend void rethrow_exception( exception_ptr const & );
|
||||
|
||||
shared_ptr<exception_detail::clone_base const> c_;
|
||||
bool bad_alloc_;
|
||||
|
||||
struct
|
||||
bad_alloc_tag
|
||||
{
|
||||
};
|
||||
|
||||
explicit
|
||||
exception_ptr( bad_alloc_tag ):
|
||||
bad_alloc_(true)
|
||||
{
|
||||
}
|
||||
|
||||
explicit
|
||||
exception_ptr( shared_ptr<exception_detail::clone_base const> const & c ):
|
||||
c_(c),
|
||||
bad_alloc_(false)
|
||||
{
|
||||
BOOST_ASSERT(c);
|
||||
}
|
||||
|
||||
public:
|
||||
|
||||
exception_ptr():
|
||||
bad_alloc_(false)
|
||||
{
|
||||
}
|
||||
|
||||
operator unspecified_bool_type() const
|
||||
{
|
||||
return (bad_alloc_ || c_) ? &exception_ptr::bad_alloc_ : 0;
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator==( exception_ptr const & a, exception_ptr const & b )
|
||||
{
|
||||
return a.c_==b.c_ && a.bad_alloc_==b.bad_alloc_;
|
||||
}
|
||||
|
||||
friend
|
||||
bool
|
||||
operator!=( exception_ptr const & a, exception_ptr const & b )
|
||||
{
|
||||
return !(a==b);
|
||||
}
|
||||
};
|
||||
|
||||
class
|
||||
unknown_exception:
|
||||
public exception,
|
||||
public std::exception,
|
||||
public exception_detail::clone_base
|
||||
{
|
||||
public:
|
||||
|
||||
unknown_exception()
|
||||
{
|
||||
}
|
||||
|
||||
explicit
|
||||
unknown_exception( boost::exception const & e ):
|
||||
boost::exception(e)
|
||||
{
|
||||
}
|
||||
|
||||
~unknown_exception() throw()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
exception_detail::clone_base const *
|
||||
clone() const
|
||||
{
|
||||
return new unknown_exception(*this);
|
||||
}
|
||||
|
||||
void
|
||||
rethrow() const
|
||||
{
|
||||
throw*this;
|
||||
}
|
||||
};
|
||||
|
||||
namespace
|
||||
exception_detail
|
||||
{
|
||||
template <class T>
|
||||
class
|
||||
current_exception_std_exception_wrapper:
|
||||
public T,
|
||||
public boost::exception,
|
||||
public clone_base
|
||||
{
|
||||
public:
|
||||
|
||||
explicit
|
||||
current_exception_std_exception_wrapper( T const & e1 ):
|
||||
T(e1)
|
||||
{
|
||||
}
|
||||
|
||||
current_exception_std_exception_wrapper( T const & e1, boost::exception const & e2 ):
|
||||
T(e1),
|
||||
boost::exception(e2)
|
||||
{
|
||||
}
|
||||
|
||||
~current_exception_std_exception_wrapper() throw()
|
||||
{
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
clone_base const *
|
||||
clone() const
|
||||
{
|
||||
return new current_exception_std_exception_wrapper(*this);
|
||||
}
|
||||
|
||||
void
|
||||
rethrow() const
|
||||
{
|
||||
throw *this;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef BOOST_NO_RTTI
|
||||
template <class T>
|
||||
exception const *
|
||||
get_boost_exception( T const * )
|
||||
{
|
||||
try
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(
|
||||
exception & x )
|
||||
{
|
||||
return &x;
|
||||
}
|
||||
catch(...)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
template <class T>
|
||||
exception const *
|
||||
get_boost_exception( T const * x )
|
||||
{
|
||||
return dynamic_cast<exception const *>(x);
|
||||
}
|
||||
#endif
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
shared_ptr<clone_base const>
|
||||
current_exception_std_exception( T const & e1 )
|
||||
{
|
||||
if( boost::exception const * e2 = get_boost_exception(&e1) )
|
||||
return shared_ptr<clone_base const>(new current_exception_std_exception_wrapper<T>(e1,*e2));
|
||||
else
|
||||
return shared_ptr<clone_base const>(new current_exception_std_exception_wrapper<T>(e1));
|
||||
}
|
||||
|
||||
inline
|
||||
shared_ptr<clone_base const>
|
||||
current_exception_unknown_exception()
|
||||
{
|
||||
return shared_ptr<clone_base const>(new unknown_exception());
|
||||
}
|
||||
|
||||
inline
|
||||
shared_ptr<clone_base const>
|
||||
current_exception_unknown_boost_exception( boost::exception const & e )
|
||||
{
|
||||
return shared_ptr<clone_base const>(new unknown_exception(e));
|
||||
}
|
||||
|
||||
inline
|
||||
shared_ptr<clone_base const>
|
||||
current_exception_unknown_std_exception( std::exception const & e )
|
||||
{
|
||||
if( boost::exception const * be = get_boost_exception(&e) )
|
||||
return current_exception_unknown_boost_exception(*be);
|
||||
else
|
||||
return current_exception_unknown_exception();
|
||||
}
|
||||
|
||||
inline
|
||||
shared_ptr<clone_base const>
|
||||
current_exception_impl()
|
||||
{
|
||||
try
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(
|
||||
exception_detail::clone_base & e )
|
||||
{
|
||||
return shared_ptr<exception_detail::clone_base const>(e.clone());
|
||||
}
|
||||
catch(
|
||||
std::invalid_argument & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
catch(
|
||||
std::out_of_range & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
catch(
|
||||
std::logic_error & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
catch(
|
||||
std::bad_alloc & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
catch(
|
||||
std::bad_cast & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
catch(
|
||||
std::bad_typeid & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
#endif
|
||||
catch(
|
||||
std::bad_exception & e )
|
||||
{
|
||||
return exception_detail::current_exception_std_exception(e);
|
||||
}
|
||||
catch(
|
||||
std::exception & e )
|
||||
{
|
||||
return exception_detail::current_exception_unknown_std_exception(e);
|
||||
}
|
||||
catch(
|
||||
boost::exception & e )
|
||||
{
|
||||
return exception_detail::current_exception_unknown_boost_exception(e);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
return exception_detail::current_exception_unknown_exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
exception_ptr
|
||||
current_exception()
|
||||
{
|
||||
try
|
||||
{
|
||||
return exception_ptr(exception_detail::current_exception_impl());
|
||||
}
|
||||
catch(
|
||||
std::bad_alloc & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
try
|
||||
{
|
||||
return exception_ptr(exception_detail::current_exception_std_exception(std::bad_exception()));
|
||||
}
|
||||
catch(
|
||||
std::bad_alloc & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_ASSERT(0);
|
||||
}
|
||||
}
|
||||
return exception_ptr(exception_ptr::bad_alloc_tag());
|
||||
}
|
||||
|
||||
template <class T>
|
||||
inline
|
||||
exception_ptr
|
||||
copy_exception( T const & e )
|
||||
{
|
||||
try
|
||||
{
|
||||
throw enable_current_exception(e);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
return current_exception();
|
||||
}
|
||||
}
|
||||
|
||||
inline
|
||||
void
|
||||
rethrow_exception( exception_ptr const & p )
|
||||
{
|
||||
BOOST_ASSERT(p);
|
||||
if( p.bad_alloc_ )
|
||||
throw enable_current_exception(std::bad_alloc());
|
||||
else
|
||||
p.c_->rethrow();
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@ -11,19 +11,36 @@
|
||||
// boost/throw_exception.hpp
|
||||
//
|
||||
// Copyright (c) 2002 Peter Dimov and Multi Media Ltd.
|
||||
// Copyright (c) 2008-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
//
|
||||
// Permission to copy, use, modify, sell and distribute this software
|
||||
// is granted provided this copyright notice appears in all copies.
|
||||
// This software is provided "as is" without express or implied
|
||||
// warranty, and with no claim as to its suitability for any purpose.
|
||||
// Distributed under the Boost Software License, Version 1.0. (See
|
||||
// accompanying file LICENSE_1_0.txt or copy at
|
||||
// http://www.boost.org/LICENSE_1_0.txt)
|
||||
//
|
||||
// http://www.boost.org/libs/utility/throw_exception.html
|
||||
//
|
||||
|
||||
#include <boost/config.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <exception>
|
||||
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
# include <exception>
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( __BORLANDC__ ) && BOOST_WORKAROUND( __BORLANDC__, BOOST_TESTED_AT(0x593) )
|
||||
# define BOOST_EXCEPTION_DISABLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE ) && defined( BOOST_MSVC ) && BOOST_WORKAROUND( BOOST_MSVC, < 1310 )
|
||||
# define BOOST_EXCEPTION_DISABLE
|
||||
#endif
|
||||
|
||||
#if !defined( BOOST_EXCEPTION_DISABLE )
|
||||
# include <boost/exception/exception.hpp>
|
||||
# include <boost/current_function.hpp>
|
||||
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(::boost::enable_error_info(x) <<\
|
||||
::boost::throw_function(BOOST_CURRENT_FUNCTION) <<\
|
||||
::boost::throw_file(__FILE__) <<\
|
||||
::boost::throw_line((int)__LINE__))
|
||||
#else
|
||||
# define BOOST_THROW_EXCEPTION(x) ::boost::throw_exception(x)
|
||||
#endif
|
||||
|
||||
namespace boost
|
||||
@ -31,13 +48,23 @@ namespace boost
|
||||
|
||||
#ifdef BOOST_NO_EXCEPTIONS
|
||||
|
||||
void throw_exception(std::exception const & e); // user defined
|
||||
void throw_exception( std::exception const & e ); // user defined
|
||||
|
||||
#else
|
||||
|
||||
template<class E> void throw_exception(E const & e)
|
||||
inline void throw_exception_assert_compatibility( std::exception const & ) { }
|
||||
|
||||
template<class E> inline void throw_exception( E const & e )
|
||||
{
|
||||
//All boost exceptions are required to derive std::exception,
|
||||
//to ensure compatibility with BOOST_NO_EXCEPTIONS.
|
||||
throw_exception_assert_compatibility(e);
|
||||
|
||||
#ifndef BOOST_EXCEPTION_DISABLE
|
||||
throw enable_current_exception(enable_error_info(e));
|
||||
#else
|
||||
throw e;
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif
|
||||
|
15
index.html
Normal file
15
index.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv=refresh content="0; URL=doc/boost-exception.html">
|
||||
<title>Automatic redirection</title>
|
||||
</head>
|
||||
<body>
|
||||
Automatic redirection failed, please go to
|
||||
<a href="doc/boost-exception.html">boost-exception.html</a>. <hr>
|
||||
<p>© Copyright Beman Dawes, 2001</p>
|
||||
<p>Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
file <a href="../../LICENSE_1_0.txt">LICENSE_1_0.txt</a> or copy
|
||||
at <a href="http://www.boost.org/LICENSE_1_0.txt">www.boost.org/LICENSE_1_0.txt</a>)</p>
|
||||
</body>
|
||||
</html>
|
1
module.cmake
Normal file
1
module.cmake
Normal file
@ -0,0 +1 @@
|
||||
boost_module(exception DEPENDS smart_ptr detail utility tuple)
|
29
test/1-throw_exception_test.cpp
Normal file
29
test/1-throw_exception_test.cpp
Normal file
@ -0,0 +1,29 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
class my_exception: public std::exception { };
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::throw_exception(my_exception());
|
||||
BOOST_ERROR("boost::throw_exception failed to throw.");
|
||||
}
|
||||
catch(
|
||||
my_exception & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_ERROR("boost::throw_exception malfunction.");
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
30
test/2-throw_exception_no_exceptions_test.cpp
Normal file
30
test/2-throw_exception_no_exceptions_test.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
class my_exception: public std::exception { };
|
||||
|
||||
bool called=false;
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
void
|
||||
throw_exception( std::exception const & )
|
||||
{
|
||||
called=true;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
boost::throw_exception(my_exception());
|
||||
BOOST_TEST(called);
|
||||
return boost::report_errors();
|
||||
}
|
30
test/3-throw_exception_no_integration_test.cpp
Normal file
30
test/3-throw_exception_no_integration_test.cpp
Normal file
@ -0,0 +1,30 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#define BOOST_EXCEPTION_DISABLE
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
class my_exception: public std::exception { };
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::throw_exception(my_exception());
|
||||
BOOST_ERROR("boost::throw_exception failed to throw.");
|
||||
}
|
||||
catch(
|
||||
my_exception & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_ERROR("boost::throw_exception malfunction.");
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
31
test/4-throw_exception_no_both_test.cpp
Normal file
31
test/4-throw_exception_no_both_test.cpp
Normal file
@ -0,0 +1,31 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#define BOOST_NO_EXCEPTIONS
|
||||
#define BOOST_EXCEPTION_DISABLE
|
||||
#include <boost/throw_exception.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
class my_exception: public std::exception { };
|
||||
|
||||
bool called=false;
|
||||
|
||||
namespace
|
||||
boost
|
||||
{
|
||||
void
|
||||
throw_exception( std::exception const & )
|
||||
{
|
||||
called=true;
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
boost::throw_exception(my_exception());
|
||||
BOOST_TEST(called);
|
||||
return boost::report_errors();
|
||||
}
|
41
test/CMakeLists.txt
Normal file
41
test/CMakeLists.txt
Normal file
@ -0,0 +1,41 @@
|
||||
boost_additional_test_dependencies(exception BOOST_DEPENDS test)
|
||||
|
||||
boost_test_run(is_output_streamable_test)
|
||||
boost_test_run(has_to_string_test)
|
||||
boost_test_run(to_string_test)
|
||||
boost_test_run(to_string_stub_test)
|
||||
boost_test_compile_fail(to_string_fail)
|
||||
|
||||
#exception
|
||||
|
||||
boost_test_run(cloning_test)
|
||||
boost_test_run(copy_exception_test)
|
||||
boost_test_run(unknown_exception_test)
|
||||
boost_test_run(exception_test)
|
||||
#boost_test_run(boost_error_info_test)
|
||||
boost_test_run(enable_error_info_test enable_error_info_test.cpp helper1.cpp)
|
||||
boost_test_run(throw_exception_test throw_exception_test.cpp helper2.cpp)
|
||||
boost_test_run(errno_test)
|
||||
boost_test_run(error_info_test)
|
||||
boost_test_run(diagnostic_information_test)
|
||||
boost_test_compile_fail(exception_fail)
|
||||
boost_test_compile_fail(throw_exception_fail)
|
||||
|
||||
# Compile headers tests
|
||||
set (compile_tests
|
||||
diagnostic_information_hpp_test
|
||||
error_info_hpp_test
|
||||
exception_ptr_hpp_test
|
||||
exception_hpp_test
|
||||
get_error_info_hpp_test
|
||||
info_hpp_test
|
||||
info_tuple_hpp_test
|
||||
to_string_hpp_test
|
||||
to_string_stub_hpp_test
|
||||
)
|
||||
|
||||
#-- Create a Compile test for each source
|
||||
foreach(test ${compile_tests})
|
||||
boost_test_compile(${test} "${test}.cpp")
|
||||
endforeach(test ${compile_tests})
|
||||
|
52
test/Jamfile.v2
Normal file
52
test/Jamfile.v2
Normal file
@ -0,0 +1,52 @@
|
||||
# Boost Exception Library test Jamfile
|
||||
#
|
||||
# Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
#
|
||||
# Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
import testing ;
|
||||
|
||||
project : requirements <exception-handling>on ;
|
||||
|
||||
#to_string
|
||||
|
||||
run is_output_streamable_test.cpp ;
|
||||
run has_to_string_test.cpp ;
|
||||
run to_string_test.cpp ;
|
||||
run to_string_stub_test.cpp ;
|
||||
compile-fail to_string_fail.cpp ;
|
||||
|
||||
#exception
|
||||
|
||||
run 1-throw_exception_test.cpp ;
|
||||
run 2-throw_exception_no_exceptions_test.cpp ;
|
||||
run 3-throw_exception_no_integration_test.cpp ;
|
||||
run 4-throw_exception_no_both_test.cpp ;
|
||||
run cloning_test.cpp ;
|
||||
run copy_exception_test.cpp ;
|
||||
run unknown_exception_test.cpp ;
|
||||
run exception_test.cpp ;
|
||||
run enable_error_info_test.cpp helper1.cpp ;
|
||||
run throw_exception_test.cpp helper2.cpp ;
|
||||
run errno_test.cpp ;
|
||||
run error_info_test.cpp ;
|
||||
run diagnostic_information_test.cpp ;
|
||||
run refcount_ptr_test.cpp ;
|
||||
run current_exception_cast_test.cpp ;
|
||||
run no_exceptions_test.cpp : : : <exception-handling>off ;
|
||||
compile-fail exception_fail.cpp ;
|
||||
compile-fail throw_exception_fail.cpp ;
|
||||
|
||||
#headers
|
||||
|
||||
compile exception_ptr_hpp_test.cpp ;
|
||||
compile diagnostic_information_hpp_test.cpp ;
|
||||
compile error_info_hpp_test.cpp ;
|
||||
compile exception_hpp_test.cpp ;
|
||||
compile get_error_info_hpp_test.cpp ;
|
||||
compile info_hpp_test.cpp ;
|
||||
compile info_tuple_hpp_test.cpp ;
|
||||
compile to_string_hpp_test.cpp ;
|
||||
compile to_string_stub_hpp_test.cpp ;
|
||||
compile current_exception_cast_hpp_test.cpp ;
|
471
test/cloning_test.cpp
Normal file
471
test/cloning_test.cpp
Normal file
@ -0,0 +1,471 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
#include <string>
|
||||
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
|
||||
struct my_tag {};
|
||||
#endif
|
||||
|
||||
typedef boost::error_info<struct my_tag,int> my_info;
|
||||
|
||||
template <class T>
|
||||
struct
|
||||
may_throw_on_copy
|
||||
{
|
||||
may_throw_on_copy():
|
||||
throw_(false)
|
||||
{
|
||||
}
|
||||
|
||||
may_throw_on_copy( may_throw_on_copy const & x ):
|
||||
throw_(x.throw_)
|
||||
{
|
||||
if( throw_ )
|
||||
throw T();
|
||||
}
|
||||
|
||||
bool throw_;
|
||||
};
|
||||
|
||||
struct
|
||||
derives_nothing
|
||||
{
|
||||
int & count;
|
||||
|
||||
explicit
|
||||
derives_nothing( int & c ):
|
||||
count(c)
|
||||
{
|
||||
++count;
|
||||
}
|
||||
|
||||
derives_nothing( derives_nothing const & x ):
|
||||
count(x.count)
|
||||
{
|
||||
++count;
|
||||
}
|
||||
|
||||
~derives_nothing()
|
||||
{
|
||||
--count;
|
||||
}
|
||||
};
|
||||
|
||||
struct
|
||||
derives_std_exception:
|
||||
std::exception
|
||||
{
|
||||
};
|
||||
|
||||
struct
|
||||
derives_std_boost_exception:
|
||||
std::exception,
|
||||
boost::exception
|
||||
{
|
||||
};
|
||||
|
||||
struct
|
||||
derives_boost_exception:
|
||||
boost::exception
|
||||
{
|
||||
};
|
||||
|
||||
template <class T>
|
||||
void
|
||||
test_std_exception()
|
||||
{
|
||||
try
|
||||
{
|
||||
throw T();
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
T & )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
T & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class T>
|
||||
void
|
||||
test_std_exception_what()
|
||||
{
|
||||
try
|
||||
{
|
||||
throw T("what");
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
T & x )
|
||||
{
|
||||
BOOST_TEST(std::string("what")==x.what());
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
T & x )
|
||||
{
|
||||
BOOST_TEST(std::string("what")==x.what());
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class Throw,class Catch>
|
||||
void
|
||||
test_throw_on_copy()
|
||||
{
|
||||
try
|
||||
{
|
||||
try
|
||||
{
|
||||
throw boost::enable_current_exception(may_throw_on_copy<Throw>());
|
||||
}
|
||||
catch(
|
||||
may_throw_on_copy<Throw> & x )
|
||||
{
|
||||
x.throw_=true;
|
||||
throw;
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
Catch & )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
boost::rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
Catch & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
BOOST_TEST( boost::exception_ptr()==boost::exception_ptr() );
|
||||
BOOST_TEST( !(boost::exception_ptr()!=boost::exception_ptr()) );
|
||||
BOOST_TEST( !boost::exception_ptr() );
|
||||
|
||||
int count=0;
|
||||
try
|
||||
{
|
||||
throw boost::enable_current_exception(derives_nothing(count));
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
derives_nothing & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
BOOST_TEST(count==0);
|
||||
|
||||
try
|
||||
{
|
||||
throw boost::enable_current_exception(derives_std_exception());
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
derives_std_exception & )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
derives_std_exception & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
throw derives_std_exception();
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
boost::unknown_exception & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
|
||||
test_std_exception_what<std::invalid_argument>();
|
||||
test_std_exception_what<std::out_of_range>();
|
||||
test_std_exception_what<std::logic_error>();
|
||||
test_std_exception<std::bad_alloc>();
|
||||
#ifndef BOOST_NO_TYPEID
|
||||
test_std_exception<std::bad_cast>();
|
||||
test_std_exception<std::bad_typeid>();
|
||||
#endif
|
||||
test_std_exception<std::bad_exception>();
|
||||
|
||||
try
|
||||
{
|
||||
throw derives_std_boost_exception() << my_info(42);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
boost::unknown_exception & x )
|
||||
{
|
||||
BOOST_TEST(boost::get_error_info<my_info>(x));
|
||||
if( int const * p=boost::get_error_info<my_info>(x) )
|
||||
BOOST_TEST(*p==42);
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
boost::unknown_exception & x )
|
||||
{
|
||||
BOOST_TEST(boost::get_error_info<my_info>(x));
|
||||
if( int const * p=boost::get_error_info<my_info>(x) )
|
||||
BOOST_TEST(*p==42);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
throw derives_boost_exception() << my_info(42);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
boost::unknown_exception & x )
|
||||
{
|
||||
BOOST_TEST(boost::get_error_info<my_info>(x));
|
||||
if( int const * p=boost::get_error_info<my_info>(x) )
|
||||
BOOST_TEST(*p==42);
|
||||
boost::exception_ptr p = boost::current_exception();
|
||||
BOOST_TEST(!(p==boost::exception_ptr()));
|
||||
BOOST_TEST(p!=boost::exception_ptr());
|
||||
BOOST_TEST(p);
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
boost::unknown_exception & x )
|
||||
{
|
||||
BOOST_TEST(boost::get_error_info<my_info>(x));
|
||||
if( int const * p=boost::get_error_info<my_info>(x) )
|
||||
BOOST_TEST(*p==42);
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
|
||||
test_throw_on_copy<std::bad_alloc,std::bad_alloc>();
|
||||
test_throw_on_copy<int,std::bad_exception>();
|
||||
|
||||
return boost::report_errors();
|
||||
}
|
34
test/copy_exception_test.cpp
Normal file
34
test/copy_exception_test.cpp
Normal file
@ -0,0 +1,34 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception_ptr.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
struct
|
||||
test_exception:
|
||||
std::exception
|
||||
{
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
boost::exception_ptr p = boost::copy_exception(test_exception());
|
||||
try
|
||||
{
|
||||
rethrow_exception(p);
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
test_exception & )
|
||||
{
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
7
test/current_exception_cast_hpp_test.cpp
Normal file
7
test/current_exception_cast_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/current_exception_cast.hpp>
|
||||
#include <boost/exception/current_exception_cast.hpp>
|
47
test/current_exception_cast_test.cpp
Normal file
47
test/current_exception_cast_test.cpp
Normal file
@ -0,0 +1,47 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/current_exception_cast.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <exception>
|
||||
|
||||
class
|
||||
my_exception:
|
||||
public std::exception
|
||||
{
|
||||
};
|
||||
|
||||
class
|
||||
polymorphic
|
||||
{
|
||||
virtual
|
||||
~polymorphic()
|
||||
{
|
||||
}
|
||||
};
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
throw my_exception();
|
||||
}
|
||||
catch(
|
||||
std::exception & e )
|
||||
{
|
||||
try
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(
|
||||
...)
|
||||
{
|
||||
BOOST_TEST(boost::current_exception_cast<std::exception>()==&e);
|
||||
BOOST_TEST(!boost::current_exception_cast<polymorphic>());
|
||||
}
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
7
test/diagnostic_information_hpp_test.cpp
Normal file
7
test/diagnostic_information_hpp_test.cpp
Normal file
@ -0,0 +1,7 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
139
test/diagnostic_information_test.cpp
Normal file
139
test/diagnostic_information_test.cpp
Normal file
@ -0,0 +1,139 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
#include <boost/detail/workaround.hpp>
|
||||
|
||||
#if BOOST_WORKAROUND(__CODEGEARC__, BOOST_TESTED_AT(0x610))
|
||||
struct test_tag1 {};
|
||||
struct test_tag2 {};
|
||||
#endif
|
||||
|
||||
typedef boost::error_info<struct test_tag1,int> tagged_int1;
|
||||
typedef boost::error_info<struct test_tag2,int> tagged_int2;
|
||||
|
||||
std::string
|
||||
to_string( tagged_int2 const & x )
|
||||
{
|
||||
if( x.value()==42 )
|
||||
return "fourty-two";
|
||||
else
|
||||
return "bad value";
|
||||
}
|
||||
|
||||
struct
|
||||
error1:
|
||||
std::exception,
|
||||
boost::exception
|
||||
{
|
||||
char const *
|
||||
what() const throw()
|
||||
{
|
||||
return "error1";
|
||||
}
|
||||
};
|
||||
|
||||
struct
|
||||
error2:
|
||||
boost::exception
|
||||
{
|
||||
};
|
||||
|
||||
void
|
||||
test1( std::string const & di1, std::string const & di2 )
|
||||
{
|
||||
BOOST_TEST( di1!=di2 );
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_TEST(di1.find("type:")!=std::string::npos);
|
||||
BOOST_TEST(di1.find("error1")!=std::string::npos);
|
||||
#endif
|
||||
BOOST_TEST(di1.find("test_tag1")!=std::string::npos);
|
||||
BOOST_TEST(di1.find("test_tag2")!=std::string::npos);
|
||||
BOOST_TEST(di1.find("fourty-two")!=std::string::npos);
|
||||
#ifndef BOOST_NO_RTTI
|
||||
BOOST_TEST(di2.find("type:")!=std::string::npos);
|
||||
BOOST_TEST(di2.find("error1")!=std::string::npos);
|
||||
#endif
|
||||
BOOST_TEST(di2.find("test_tag1")!=std::string::npos);
|
||||
BOOST_TEST(di2.find("test_tag2")!=std::string::npos);
|
||||
BOOST_TEST(di2.find("bad value")!=std::string::npos);
|
||||
}
|
||||
|
||||
void
|
||||
test2( std::string const & di1, std::string const & di2 )
|
||||
{
|
||||
BOOST_TEST( di1!=di2 );
|
||||
BOOST_TEST(di1.find("test_tag1")!=std::string::npos);
|
||||
BOOST_TEST(di1.find("test_tag2")!=std::string::npos);
|
||||
BOOST_TEST(di1.find("fourty-two")!=std::string::npos);
|
||||
BOOST_TEST(di2.find("test_tag1")!=std::string::npos);
|
||||
BOOST_TEST(di2.find("test_tag2")!=std::string::npos);
|
||||
BOOST_TEST(di2.find("bad value")!=std::string::npos);
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
using namespace boost;
|
||||
try
|
||||
{
|
||||
error1 x; x << tagged_int1(42) << tagged_int2(42);
|
||||
BOOST_TEST(x.what()==std::string("error1"));
|
||||
throw x;
|
||||
}
|
||||
catch(
|
||||
error1 & x )
|
||||
{
|
||||
std::string di1=boost::diagnostic_information(x);
|
||||
x << tagged_int1(2) << tagged_int2(2);
|
||||
std::string di2 = diagnostic_information(x);
|
||||
test1(di1,di2);
|
||||
}
|
||||
try
|
||||
{
|
||||
error1 x; x << tagged_int1(42) << tagged_int2(42);
|
||||
BOOST_TEST(x.what()==std::string("error1"));
|
||||
throw x;
|
||||
}
|
||||
catch(
|
||||
error1 & x )
|
||||
{
|
||||
std::string di1=boost::current_exception_diagnostic_information();
|
||||
x << tagged_int1(2) << tagged_int2(2);
|
||||
std::string di2 = current_exception_diagnostic_information();
|
||||
test1(di1,di2);
|
||||
}
|
||||
try
|
||||
{
|
||||
error2 x;
|
||||
x << tagged_int1(42) << tagged_int2(42);
|
||||
throw x;
|
||||
}
|
||||
catch(
|
||||
error2 & x )
|
||||
{
|
||||
std::string di1 = diagnostic_information(x);
|
||||
x << tagged_int1(2) << tagged_int2(2);
|
||||
std::string di2 = diagnostic_information(x);
|
||||
test2(di1,di2);
|
||||
}
|
||||
try
|
||||
{
|
||||
error2 x;
|
||||
x << tagged_int1(42) << tagged_int2(42);
|
||||
throw x;
|
||||
}
|
||||
catch(
|
||||
error2 & x )
|
||||
{
|
||||
std::string di1 = current_exception_diagnostic_information();
|
||||
x << tagged_int1(2) << tagged_int2(2);
|
||||
std::string di2 = current_exception_diagnostic_information();
|
||||
test2(di1,di2);
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
76
test/enable_error_info_test.cpp
Normal file
76
test/enable_error_info_test.cpp
Normal file
@ -0,0 +1,76 @@
|
||||
//Copyright (c) 2006-2009 Emil Dotchevski and Reverge Studios, Inc.
|
||||
|
||||
//Distributed under the Boost Software License, Version 1.0. (See accompanying
|
||||
//file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
#include "helper1.hpp"
|
||||
#include <boost/exception/get_error_info.hpp>
|
||||
#include <boost/exception/info.hpp>
|
||||
#include <boost/exception/diagnostic_information.hpp>
|
||||
#include <boost/detail/lightweight_test.hpp>
|
||||
|
||||
namespace
|
||||
{
|
||||
typedef boost::error_info<struct tag_test_int,int> test_int;
|
||||
|
||||
void
|
||||
throw_wrapper()
|
||||
{
|
||||
try
|
||||
{
|
||||
boost::exception_test::throw_length_error();
|
||||
}
|
||||
catch(
|
||||
boost::exception & x )
|
||||
{
|
||||
x << test_int(42);
|
||||
throw;
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
try
|
||||
{
|
||||
throw_wrapper();
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
catch(
|
||||
std::exception & x )
|
||||
{
|
||||
#ifdef BOOST_NO_RTTI
|
||||
try
|
||||
{
|
||||
throw;
|
||||
}
|
||||
catch(
|
||||
boost::exception & x )
|
||||
{
|
||||
#endif
|
||||
BOOST_TEST( boost::get_error_info<test_int>(x) );
|
||||
if( int const * p=boost::get_error_info<test_int>(x) )
|
||||
BOOST_TEST( 42==*p );
|
||||
#ifdef BOOST_NO_RTTI
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
#endif
|
||||
BOOST_TEST( std::string(x.what())==std::string("exception test length error") );
|
||||
}
|
||||
catch(
|
||||
... )
|
||||
{
|
||||
BOOST_TEST(false);
|
||||
}
|
||||
return boost::report_errors();
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user