minor documentation fixes.

[SVN r44476]
This commit is contained in:
Emil Dotchevski
2008-04-16 22:55:19 +00:00
parent a61063b8f5
commit ce9a26634c
41 changed files with 851 additions and 1150 deletions

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>BOOST_ERROR_INFO</h3> <div class="RenoIncludeDIV"><h3>BOOST_ERROR_INFO</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -34,6 +37,9 @@ boost
</div><h3>See also:</h3> </div><h3>See also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -1,73 +0,0 @@
<!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>Tutorial: Adding of Arbitrary Data at the Point of the Throw</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>
<div class="RenoIncludeDIV"><h3>Adding of Arbitrary Data at the Point of the Throw</h3>
<p>The following example demonstrates how <tt>errno</tt> can be stored in exception objects using Boost Exception:</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt;
#include &lt;errno.h&gt;
#include &lt;iostream&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_errno,int&gt; 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() &lt;&lt; errno_info(errno); //(3)
}
</pre>
<p>First, we instantiate the <tt><span class="RenoLink"><a href="error_info.html">error_info</a></span></tt> template using a unique identifier -- <tt>tag_errno</tt>, and the type of the info it identifies -- <tt>int</tt>. This provides compile-time type safety for the various values stored in exception objects.</p>
<p>Second, we define class <tt>my_error</tt>, which derives from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt>.</p>
<p>Finally, (3) illustrates how the <tt>typedef</tt> from (1) can be used with <tt><span class="RenoLink"><a href="operator_shl_exception.html">operator&lt;&lt;</a></span>()</tt> to store values in exception objects at the point of the throw.</p>
<p>The stored <tt>errno</tt> value can be recovered at a later time like this:</p>
<pre>// ...continued
void
g()
{
try
{
f();
}
catch(
my_error &amp; x )
{
if( boost::shared_ptr&lt;int const&gt; err=boost::<span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>&lt;errno_info&gt;(x) )
std::cerr &lt;&lt; "Error code: " &lt;&lt; *err;
}
}</pre>
<p>The <tt><span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>()</tt> function template is instantiated with the <tt>typedef</tt> from (1), and is passed an exception object of any type that derives publicly from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt>. If the exception object contains the requested value, the returned <tt><span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span></tt> will point to it; otherwise an empty <tt><span class="RenoLink"><a href="http://www.boost.org/libs/smart_ptr/shared_ptr.htm">shared_ptr</a></span></tt> is returned.</p>
</div><h3>See also:</h3>
<div class="RenoPageList"><a href="transporting_data.html">Tutorial: Transporting of Arbitrary Data to the Catch Site<br/>
</a></div>
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/validator?uri=http://revergestudios.com/boost-exception/reno.css"><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-2008 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>

View File

@ -1,116 +0,0 @@
<!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>Tutorial: Adding of Arbitrary Data to Active Exception Objects</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>
<div class="RenoIncludeDIV"><h3>Adding of Arbitrary Data to Active Exception Objects</h3>
<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. Here is an example:</p>
<pre>#include &lt;stdio.h&gt;
#include &lt;string&gt;
class
file_read_error
{
public:
explicit
file_read_error( std::string const &amp; fn ):
fn_(fn)
{
};
std::string const &amp;
file_name() const
{
return fn_;
}
private:
std::string fn_;
};
void
file_read( FILE * f, void * buffer, size_t size )
{
if( size!=fread(buffer,1,size,f) )
throw file_read_error("????");
}</pre>
<p>We have defined an exception class <tt>file_read_error</tt> which can store a file name, so that when we catch a <tt>file_read_error</tt> object, we know which file the failure is related to. However, the <tt>file_read</tt> function does not have the file name at the time of the throw; all it has is a <tt>FILE</tt> handle.</p>
<p>One possible solution is to not use <tt>FILE</tt> handles directly. We could have our own <tt>class file</tt> which stores both a <tt>FILE</tt> handle and a file name, and pass that to <tt>file_read()</tt>. However, this could be problematic if we communicate with 3rd party code that does not use our <tt>class file</tt> (probably because they have their own similar class.)</p>
<p>A better solution is to make class <tt>file_read_error</tt> derive (possibly indirectly) from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt>, and free the <tt>file_read()</tt> function from the burden of storing the file name in exceptions it throws:</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_errno,int&gt; 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() &lt;&lt; errno_info(errno);
}</pre>
<p>If <tt>file_read()</tt> detects a failure, it throws an exception which contains the information that is available at the time, namely the <tt>errno</tt>. 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 &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;string&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_file_name,std::string&gt; file_name_info;
boost::shared_ptr&lt;FILE&gt; 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&lt;FILE&gt; 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> &amp; e )
{
e &lt;&lt; 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 <tt>try</tt> block, <tt>parse_file()</tt> does not need to do any real work, but it intercepts any <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> object, stores the file name, and re-throws using a throw-expression with no operand (15.1.6). The rationale for catching any <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> object is that the file name is relevant to any failure that occurs in <tt>parse_file()</tt>, <i>even if the failure is unrelated to file I/O</i>.</p>
<p>As usual, the stored data can be retrieved using <tt><span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>()</tt>.</p>
</div><h3>See also:</h3>
<div class="RenoPageList"><a href="transporting_data.html">Tutorial: Transporting of Arbitrary Data to the Catch Site<br/>
</a></div>
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/validator?uri=http://revergestudios.com/boost-exception/reno.css"><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-2008 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>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h2>Abstract</h2> <h2>Abstract</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>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 classes. 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>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 classes. 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>
@ -333,7 +336,7 @@ my_exception:
.... ....
throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(my_exception());</pre> throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(my_exception());</pre>
<p>Unless <tt><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>()</tt> is called at the time an exception object is used in a throw-expression, any attempt to copy it using <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> returns an <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> which refers to an instance of <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt>.</p> <p>Unless <tt><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>()</tt> is called at the time an exception object is used in a throw-expression, an attempt to copy it using <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> may return an <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> which refers to an instance of <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt>. See <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> for details.</p>
<h4>Note:</h4> <h4>Note:</h4>
<p>Instead of using the <tt>throw</tt> keyword directly, it is preferable to call <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>()</tt>. This is guaranteed to throw an exception that derives from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> and supports cloning.</p> <p>Instead of using the <tt>throw</tt> keyword directly, it is preferable to call <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>()</tt>. This is guaranteed to throw an exception that derives from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> and supports cloning.</p>
</div><div class="RenoIncludeDIV"><h3>current_exception()</h3> </div><div class="RenoIncludeDIV"><h3>current_exception()</h3>
@ -405,7 +408,10 @@ boost
<div><ul><li> If <tt>BOOST_NO_EXCEPTIONS</tt> is not defined, <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e)</tt> is equivalent to <tt>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))</tt>, unless <tt>BOOST_EXCEPTION_DISABLE</tt> is defined, in which case <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e)</tt> is equivalent to <tt>throw e;</tt></li> <div><ul><li> If <tt>BOOST_NO_EXCEPTIONS</tt> is not defined, <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e)</tt> is equivalent to <tt>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))</tt>, unless <tt>BOOST_EXCEPTION_DISABLE</tt> is defined, in which case <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>(e)</tt> is equivalent to <tt>throw e;</tt></li>
<li> If <tt>BOOST_NO_EXCEPTIONS</tt> is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <tt>throw_exception</tt> are allowed to assume that the function never returns; therefore, if the user-defined <tt>throw_exception</tt> returns, the behavior is undefined.</li> <li> If <tt>BOOST_NO_EXCEPTIONS</tt> is defined, the function is left undefined, and the user is expected to supply an appropriate definition. Callers of <tt>throw_exception</tt> are allowed to assume that the function never returns; therefore, if the user-defined <tt>throw_exception</tt> returns, the behavior is undefined.</li>
</ul></div> </ul></div>
</div><div id="footer"> </div><!-- 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) -->
<div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>
<p> <p>

View File

@ -1,55 +0,0 @@
<!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>clone_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>
<div class="RenoIncludeDIV"><h3>clone_exception()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception/cloning.hpp</a></span>&gt;</tt></p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class T&gt;
<span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span> <span class="RenoLink"><a href="clone_exception.html">clone_exception</a></span>( T const &amp; e );</span>
}</pre>
</div><h4>Requirements:</h4>
<p><tt>T</tt> must be polymorphic.</p>
<h4>Returns:</h4>
<div><ul><li> If <tt><span class="RenoLink"><a href="enable_exception_cloning.html">enable_exception_cloning</a></span>()</tt> was not used at the time the exception object was passed to <tt>throw</tt>, the returned <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> refers to an instance of <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt>. In this case, if the original exception object derives from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt>, then the <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> sub-object of the <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt> object is initialized by the <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> copy constructor;</li>
<li> Otherwise, if the attempt to clone the exception results in a <tt>std::bad_alloc</tt> exception, the returned <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> refers to an instance of <tt>std::bad_alloc</tt>;</li>
<li> Otherwise, the returned <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> refers to a copy of <tt>e</tt>.</li>
</ul></div>
<h4>Note:</h4>
<p>It is unspecified whether the return values of two successive calls to <tt><span class="RenoLink"><a href="clone_exception.html">clone_exception</a></span>()</tt> refer to the same exception object.</p>
</div><h3>See also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="enable_exception_cloning.html">enable_exception_cloning<br/>
</a><a href="unknown_exception.html">unknown_exception<br/>
</a></div>
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/validator?uri=http://revergestudios.com/boost-exception/reno.css"><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-2008 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>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h2>Transporting of Exceptions between Threads</h2> <div class="RenoIncludeDIV"><h2>Transporting of Exceptions between Threads</h2>
<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 <tt><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>()</tt> at the time of the throw is required in order to use cloning.</p> <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 <tt><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>()</tt> at the time of the throw is required in order to use cloning.</p>
<h4>Note:</h4> <h4>Note:</h4>
@ -81,6 +84,9 @@ work()
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="unknown_exception.html">unknown_exception<br/> </a><a href="unknown_exception.html">unknown_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -1,75 +0,0 @@
<!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>Tutorial: Cloning and Re-throwing an 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>
<div class="RenoIncludeDIV"><h3>Cloning and Re-throwing an Exception</h3>
<p>When you catch a <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt>, you can call <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> to get an <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> object:</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;
#include &lt;boost/thread.hpp&gt;
#include &lt;boost/bind.hpp&gt;
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> &amp; 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 <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> captures the original type of the exception object. The exception can be thrown again using the <tt><span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>()</tt> 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><tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> 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 <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> points to an instance of <tt>std::bad_alloc</tt>, or</li>
<li> if <tt><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>()</tt> was not used in the throw-expression passed to the original <tt>throw</tt> statement and the current implementation does not have the necessary compiler-specific support to copy the exception automatically, in which case the returned <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> points to an instance of <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt>.</li>
</ul></div>
<p>Regardless, the use of <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> and <tt><span class="RenoLink"><a href="rethrow_exception.html">rethrow_exception</a></span>()</tt> in the above examples is well-formed.</p>
</div><h3>See also:</h3>
<div class="RenoPageList"><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/>
</a></div>
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/validator?uri=http://revergestudios.com/boost-exception/reno.css"><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-2008 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>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>copy_exception()</h3> <div class="RenoIncludeDIV"><h3>copy_exception()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -30,6 +33,9 @@ boost
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="exception_ptr.html">exception_ptr<br/> </a><a href="exception_ptr.html">exception_ptr<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>current_exception()</h3> <div class="RenoIncludeDIV"><h3>current_exception()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -40,6 +43,9 @@ boost
</a><a href="exception_ptr.html">exception_ptr<br/> </a><a href="exception_ptr.html">exception_ptr<br/>
</a><a href="unknown_exception.html">unknown_exception<br/> </a><a href="unknown_exception.html">unknown_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>enable_current_exception()</h3> <div class="RenoIncludeDIV"><h3>enable_current_exception()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_enable_exception_cloning_hpp.html">boost/exception/enable_current_exception.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_enable_exception_cloning_hpp.html">boost/exception/enable_current_exception.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -38,7 +41,7 @@ my_exception:
.... ....
throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(my_exception());</pre> throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>(my_exception());</pre>
<p>Unless <tt><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>()</tt> is called at the time an exception object is used in a throw-expression, any attempt to copy it using <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> returns an <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> which refers to an instance of <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt>.</p> <p>Unless <tt><span class="RenoLink"><a href="enable_current_exception.html">enable_current_exception</a></span>()</tt> is called at the time an exception object is used in a throw-expression, an attempt to copy it using <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> may return an <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> which refers to an instance of <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt>. See <tt><span class="RenoLink"><a href="current_exception.html">current_exception</a></span>()</tt> for details.</p>
<h4>Note:</h4> <h4>Note:</h4>
<p>Instead of using the <tt>throw</tt> keyword directly, it is preferable to call <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>()</tt>. This is guaranteed to throw an exception that derives from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> and supports cloning.</p> <p>Instead of using the <tt>throw</tt> keyword directly, it is preferable to call <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>()</tt>. This is guaranteed to throw an exception that derives from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> and supports cloning.</p>
</div><h3>See also:</h3> </div><h3>See also:</h3>
@ -47,6 +50,9 @@ throw boost::<span class="RenoLink"><a href="enable_current_exception.html">enab
</a><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/> </a><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/>
</a><a href="throw_exception.html">throw_exception<br/> </a><a href="throw_exception.html">throw_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>enable_error_info()</h3> <div class="RenoIncludeDIV"><h3>enable_error_info()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_enable_error_info_hpp.html">boost/exception/enable_error_info.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -35,6 +38,9 @@ boost
</a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/> </a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
</a><a href="throw_exception.html">throw_exception<br/> </a><a href="throw_exception.html">throw_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -1,65 +0,0 @@
<!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_exception_cloning</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>
<div class="RenoIncludeDIV"><h3>enable_exception_cloning()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_enable_exception_cloning_hpp.html">boost/exception/enable_exception_cloning.hpp</a></span>&gt;</tt></p>
<pre>namespace
boost
{
<span class="RenoIncludeSPAN"> template &lt;class T&gt;
---unspecified--- <span class="RenoLink"><a href="enable_exception_cloning.html">enable_exception_cloning</a></span>( T const &amp; e );</span>
}</pre>
</div><h4>Requirements:</h4>
<p><tt>T</tt> must have an accessible no-throw copy constructor</p>
<h4>Returns:</h4>
<p>An object of <i>unspecified</i> type which derives publicly from <tt>T</tt>. That is, the returned object can be intercepted by a <tt>catch(T &amp;)</tt>.</p>
<h4>Description:</h4>
<p>This function is designed to be used directly in a throw-expression to enable the cloning support in Boost Exception. For example:</p>
<pre>class
my_exception:
public std::exception
{
};
....
throw boost::<span class="RenoLink"><a href="enable_exception_cloning.html">enable_exception_cloning</a></span>(my_exception());</pre>
<p>Unless <tt><span class="RenoLink"><a href="enable_exception_cloning.html">enable_exception_cloning</a></span>()</tt> is called at the time an exception object is used in a throw-expression, any attempt to copy it using <tt><span class="RenoLink"><a href="clone_exception.html">clone_exception</a></span>()</tt> returns an <tt><span class="RenoLink"><a href="exception_ptr.html">exception_ptr</a></span></tt> which refers to an instance of <tt><span class="RenoLink"><a href="unknown_exception.html">unknown_exception</a></span></tt>.</p>
<h4>Note:</h4>
<p>Instead of using the <tt>throw</tt> keyword directly, it is preferable to call <tt>boost::<span class="RenoLink"><a href="throw_exception.html">throw_exception</a></span>()</tt>. This is guaranteed to throw an exception that derives from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> and supports cloning.</p>
</div><h3>See also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="clone_exception.html">clone_exception<br/>
</a><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/>
</a><a href="throw_exception.html">throw_exception<br/>
</a><a href="unknown_exception.html">unknown_exception<br/>
</a></div>
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/validator?uri=http://revergestudios.com/boost-exception/reno.css"><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-2008 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>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>error_info</h3> <div class="RenoIncludeDIV"><h3>error_info</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -56,6 +59,9 @@ typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></
</a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/> </a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
</a><a href="logging.html">Tutorial: Logging of boost::exception Objects<br/> </a><a href="logging.html">Tutorial: Logging of boost::exception Objects<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h2>exception</h2> <div class="RenoIncludeDIV"><h2>exception</h2>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_exception_hpp.html">boost/exception/exception.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -79,6 +82,9 @@ boost
</a><a href="transporting_data.html">Tutorial: Transporting of Arbitrary Data to the Catch Site<br/> </a><a href="transporting_data.html">Tutorial: Transporting of Arbitrary Data to the Catch Site<br/>
</a><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/> </a><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception_ptr.hpp</h3> <h3>boost/exception_ptr.hpp</h3>
<p>This header file contains the following definitions/declarations:</p> <p>This header file contains the following definitions/declarations:</p>
<div class="RenoPageList"><a href="copy_exception.html">copy_exception<br/> <div class="RenoPageList"><a href="copy_exception.html">copy_exception<br/>
@ -24,6 +27,9 @@
</a><a href="rethrow_exception.html">rethrow_exception<br/> </a><a href="rethrow_exception.html">rethrow_exception<br/>
</a><a href="unknown_exception.html">unknown_exception<br/> </a><a href="unknown_exception.html">unknown_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>exception constructors</h3> <div class="RenoIncludeDIV"><h3>exception constructors</h3>
<div class="RenoIncludeDIV"><pre> <span class="RenoLink"><a href="exception_constructors.html">exception</a></span>(); <div class="RenoIncludeDIV"><pre> <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 &amp; x );</pre> <span class="RenoLink"><a href="exception_constructors.html">exception</a></span>( <span class="RenoLink"><a href="exception.html">exception</a></span> const &amp; x );</pre>
@ -28,6 +31,9 @@
</div><h3>See also:</h3> </div><h3>See also:</h3>
<div class="RenoPageList"><a href="exception.html">exception<br/> <div class="RenoPageList"><a href="exception.html">exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>exception destructor</h3> <div class="RenoIncludeDIV"><h3>exception destructor</h3>
<div class="RenoIncludeDIV"><pre> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</pre> <div class="RenoIncludeDIV"><pre> <span class="RenoLink"><a href="exception_destructor.html">~exception</a></span>();</pre>
</div><h4>Effects:</h4> </div><h4>Effects:</h4>
@ -25,6 +28,9 @@
</div><h3>See also:</h3> </div><h3>See also:</h3>
<div class="RenoPageList"><a href="exception.html">exception<br/> <div class="RenoPageList"><a href="exception.html">exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,10 +16,16 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception/enable_error_info.hpp</h3> <h3>boost/exception/enable_error_info.hpp</h3>
<p>This header file contains the following definitions/declarations:</p> <p>This header file contains the following definitions/declarations:</p>
<div class="RenoPageList"><a href="enable_error_info.html">enable_error_info<br/> <div class="RenoPageList"><a href="enable_error_info.html">enable_error_info<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,10 +16,16 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception/enable_current_exception.hpp</h3> <h3>boost/exception/enable_current_exception.hpp</h3>
<p>This header file contains the following definitions/declarations:</p> <p>This header file contains the following definitions/declarations:</p>
<div class="RenoPageList"><a href="enable_current_exception.html">enable_current_exception<br/> <div class="RenoPageList"><a href="enable_current_exception.html">enable_current_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,10 +16,16 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception/info_tuple.hpp</h3> <h3>boost/exception/info_tuple.hpp</h3>
<p>This header file contains the following definitions/declarations:</p> <p>This header file contains the following definitions/declarations:</p>
<div class="RenoPageList"><a href="operator_shl_exception.html">operator&lt;&lt;/exception<br/> <div class="RenoPageList"><a href="operator_shl_exception.html">operator&lt;&lt;/exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception/info.hpp</h3> <h3>boost/exception/info.hpp</h3>
<p>This header file contains the following definitions/declarations:</p> <p>This header file contains the following definitions/declarations:</p>
<div class="RenoPageList"><a href="BOOST_ERROR_INFO.html">BOOST_ERROR_INFO<br/> <div class="RenoPageList"><a href="BOOST_ERROR_INFO.html">BOOST_ERROR_INFO<br/>
@ -23,6 +26,9 @@
</a><a href="get_error_info.html">get_error_info<br/> </a><a href="get_error_info.html">get_error_info<br/>
</a><a href="operator_shl_exception.html">operator&lt;&lt;/exception<br/> </a><a href="operator_shl_exception.html">operator&lt;&lt;/exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception/error_info.hpp</h3> <h3>boost/exception/error_info.hpp</h3>
<p>This header file contains the following declaration:</p> <p>This header file contains the following declaration:</p>
<pre>namespace <pre>namespace
@ -24,6 +27,9 @@ boost
template &lt;class Tag, class T&gt; template &lt;class Tag, class T&gt;
class <span class="RenoLink"><a href="error_info.html">error_info</a></span>; class <span class="RenoLink"><a href="error_info.html">error_info</a></span>;
}</pre> }</pre>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,10 +16,16 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception/exception.hpp</h3> <h3>boost/exception/exception.hpp</h3>
<p>This header file contains the following definitions/declarations:</p> <p>This header file contains the following definitions/declarations:</p>
<div class="RenoPageList"><a href="exception.html">exception<br/> <div class="RenoPageList"><a href="exception.html">exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception.hpp</h3> <h3>boost/exception.hpp</h3>
<p>This header file includes all other header files of Boost Exception:</p> <p>This header file includes all other header files of Boost Exception:</p>
<div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/> <div class="RenoPageList"><a href="exception_hpp.html">boost/exception.hpp<br/>
@ -28,6 +31,9 @@
</a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/> </a><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp<br/>
</a><a href="throw_exception_hpp.html">boost/throw_exception.hpp<br/> </a><a href="throw_exception_hpp.html">boost/throw_exception.hpp<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>exception_ptr</h3> <div class="RenoIncludeDIV"><h3>exception_ptr</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -35,6 +38,9 @@ boost
</a><a href="enable_current_exception.html">enable_current_exception<br/> </a><a href="enable_current_exception.html">enable_current_exception<br/>
</a><a href="rethrow_exception.html">rethrow_exception<br/> </a><a href="rethrow_exception.html">rethrow_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>exception::what()</h3> <div class="RenoIncludeDIV"><h3>exception::what()</h3>
<div class="RenoIncludeDIV"><pre> virtual char const * <span class="RenoLink"><a href="exception_what.html">what</a></span>() const throw();</pre> <div class="RenoIncludeDIV"><pre> virtual char const * <span class="RenoLink"><a href="exception_what.html">what</a></span>() const throw();</pre>
</div><h4>Returns:</h4> </div><h4>Returns:</h4>
@ -28,6 +31,9 @@
<div class="RenoPageList"><a href="exception.html">exception<br/> <div class="RenoPageList"><a href="exception.html">exception<br/>
</a><a href="logging.html">Tutorial: Logging of boost::exception Objects<br/> </a><a href="logging.html">Tutorial: Logging of boost::exception Objects<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>get_error_info()</h3> <div class="RenoIncludeDIV"><h3>get_error_info()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -35,6 +38,9 @@ boost
</a><a href="error_info.html">error_info<br/> </a><a href="error_info.html">error_info<br/>
</a><a href="exception.html">exception<br/> </a><a href="exception.html">exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -1,62 +0,0 @@
<!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>Tutorial: Adding Grouped Data to Exceptions</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>
<div class="RenoIncludeDIV"><h3>Adding Grouped Data to Exceptions</h3>
<p>The code snippet below demonstrates how <tt>boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span></tt> can be used to bundle the name of the function that failed, together with the reported <tt>errno</tt> so that they can be added to exception objects more conveniently together:</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;
#include &lt;boost/shared_ptr.hpp&gt;
#include &lt;stdio.h&gt;
#include &lt;string&gt;
#include &lt;errno.h&gt;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_file_name,std::string&gt; file_name_info;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_function,char const *&gt; function_info;
typedef boost::<span class="RenoLink"><a href="error_info.html">error_info</a></span>&lt;struct tag_errno,int&gt; errno_info;
typedef boost::tuple&lt;function_info,errno_info&gt; clib_failure;
class file_open_error: public boost::<span class="RenoLink"><a href="exception.html">exception</a></span> { };
boost::shared_ptr&lt;FILE&gt;
file_open( char const * name, char const * mode )
{
if( FILE * f=fopen(name,mode) )
return boost::shared_ptr&lt;FILE&gt;(f,fclose);
else
throw file_open_error() &lt;&lt;
file_name_info(name) &lt;&lt;
clib_failure("fopen",errno);
}</pre>
<p>Note that the members of a <tt>boost::<span class="RenoLink"><a href="http://www.boost.org/libs/tuple/doc/tuple_users_guide.html">tuple</a></span></tt> are stored separately in exception objects; they can only be retrieved individually, using <tt><span class="RenoLink"><a href="get_error_info.html">get_error_info</a></span>()</tt>.</p>
</div><h3>See also:</h3>
<div class="RenoPageList"><a href="transporting_data.html">Tutorial: Transporting of Arbitrary Data to the Catch Site<br/>
</a></div>
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/validator?uri=http://revergestudios.com/boost-exception/reno.css"><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-2008 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>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h2>Logging of boost::exception Objects</h2> <div class="RenoIncludeDIV"><h2>Logging of boost::exception Objects</h2>
<p>Class <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> provides a virtual member function <tt><span class="RenoLink"><a href="exception_what.html">what</a></span>()</tt>, with a signature identical to the familiar <tt>std::exception::what()</tt> function. The default implementation returns a string value that 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> <p>Class <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> provides a virtual member function <tt><span class="RenoLink"><a href="exception_what.html">what</a></span>()</tt>, with a signature identical to the familiar <tt>std::exception::what()</tt> function. The default implementation returns a string value that 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 &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt;
@ -43,6 +46,9 @@ g()
</div><h3>See also:</h3> </div><h3>See also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h1>Index</h1> <h1>Index</h1>
<div class="RenoIndex"><h3>B</h3> <div class="RenoIndex"><h3>B</h3>
<p><a href="BOOST_ERROR_INFO.html">BOOST_ERROR_INFO</a></p> <p><a href="BOOST_ERROR_INFO.html">BOOST_ERROR_INFO</a></p>
@ -52,6 +55,9 @@
<h3>u</h3> <h3>u</h3>
<p><a href="unknown_exception.html">unknown_exception</a></p> <p><a href="unknown_exception.html">unknown_exception</a></p>
</div> </div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>operator&lt;&lt;()</h3> <div class="RenoIncludeDIV"><h3>operator&lt;&lt;()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt><span class="RenoBR">&nbsp;</span><br/><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;</tt><span class="RenoBR">&nbsp;</span><br/><tt>#include &lt;<span class="RenoLink"><a href="exception_error_info_group_hpp.html">boost/exception/info_tuple.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -50,6 +53,9 @@ boost
</a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/> </a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
</a><a href="logging.html">Tutorial: Logging of boost::exception Objects<br/> </a><a href="logging.html">Tutorial: Logging of boost::exception Objects<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>rethrow_exception()</h3> <div class="RenoIncludeDIV"><h3>rethrow_exception()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -30,6 +33,9 @@ boost
</div><h3>See also:</h3> </div><h3>See also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

File diff suppressed because it is too large Load Diff

View File

@ -16,3 +16,6 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->

View File

@ -1,3 +1,6 @@
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>throw_exception()</h3> <div class="RenoIncludeDIV"><h3>throw_exception()</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="throw_exception_hpp.html">boost/throw_exception.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -37,6 +40,9 @@ boost
</a><a href="enable_current_exception.html">enable_current_exception<br/> </a><a href="enable_current_exception.html">enable_current_exception<br/>
</a><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/> </a><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,10 +16,16 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<h3>boost/exception/throw_exception.hpp</h3> <h3>boost/exception/throw_exception.hpp</h3>
<p>This header file contains the following definitions/declarations:</p> <p>This header file contains the following definitions/declarations:</p>
<div class="RenoPageList"><a href="throw_exception.html">throw_exception<br/> <div class="RenoPageList"><a href="throw_exception.html">throw_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h2>Transporting of Arbitrary Data to the Catch Site</h2> <div class="RenoIncludeDIV"><h2>Transporting of Arbitrary Data to the Catch Site</h2>
<p>All exception types that derive from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> 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 classes. Data can be added to a <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> at the time of the throw, or at a later time.</p> <p>All exception types that derive from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> 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 classes. Data can be added to a <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> at the time of the throw, or at a later time.</p>
<div class="RenoIncludeDIV"><h3>Adding of Arbitrary Data at the Point of the Throw</h3> <div class="RenoIncludeDIV"><h3>Adding of Arbitrary Data at the Point of the Throw</h3>
@ -165,6 +168,9 @@ file_open( char const * name, char const * mode )
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/> </a><a href="using_enable_error_info.html">Tutorial: Integrating Boost Exception in Existing Exception Class Hierarchies<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h3>unknown_exception</h3> <div class="RenoIncludeDIV"><h3>unknown_exception</h3>
<div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p> <div class="RenoIncludeDIV"><p><tt>#include &lt;<span class="RenoLink"><a href="exception_cloning_hpp.html">boost/exception_ptr.hpp</a></span>&gt;</tt></p>
<pre>namespace <pre>namespace
@ -35,6 +38,9 @@ boost
</a><a href="current_exception.html">current_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="enable_current_exception.html">enable_current_exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>

View File

@ -1,54 +0,0 @@
<!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>Tutorial: Using enable_current_exception() at the Time of the Throw</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>
<div class="RenoIncludeDIV"><h3>Using enable_current_exception() at the Time of the Throw</h3>
<p>Here is how cloning can be enabled in a throw-expression (15.1):</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_enable_exception_cloning_hpp.html">boost/exception/enable_current_exception.hpp</a></span>&gt;
#include &lt;<span class="RenoLink"><a href="exception_error_info_hpp.html">boost/exception/info.hpp</a></span>&gt;
#include &lt;stdio.h&gt;
#include &lt;errno.h&gt;
typedef boost::error_info&lt;struct tag_errno,int&gt; 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()) &lt;&lt;
errno_info(errno);
}</pre>
</div><h3>See also:</h3>
<div class="RenoPageList"><a href="cloning.html">Tutorial: Transporting of Exceptions between Threads<br/>
</a></div>
<div id="footer">
<p>&nbsp;</p>
<hr/>
<p>
<a class="logo" href="http://jigsaw.w3.org/css-validator/validator?uri=http://revergestudios.com/boost-exception/reno.css"><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-2008 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>

View File

@ -16,6 +16,9 @@
</div> </div>
<h1>Boost Exception</h1> <h1>Boost Exception</h1>
</div> </div>
<!-- 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) -->
<div class="RenoIncludeDIV"><h2>Integrating Boost Exception in Existing Exception Class Hierarchies</h2> <div class="RenoIncludeDIV"><h2>Integrating Boost Exception in Existing Exception Class Hierarchies</h2>
<p>Some exception hierarchies can not be modified to make <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> a base type. For this case, the <tt><span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>()</tt> function template can be used to make exception objects derive from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> anyway. Here is an example:</p> <p>Some exception hierarchies can not be modified to make <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> a base type. For this case, the <tt><span class="RenoLink"><a href="enable_error_info.html">enable_error_info</a></span>()</tt> function template can be used to make exception objects derive from <tt>boost::<span class="RenoLink"><a href="exception.html">exception</a></span></tt> anyway. Here is an example:</p>
<pre>#include &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt; <pre>#include &lt;<span class="RenoLink"><a href="exception_hpp.html">boost/exception.hpp</a></span>&gt;
@ -49,6 +52,9 @@ my_container
</div><h3>See also:</h3> </div><h3>See also:</h3>
<div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/> <div class="RenoPageList"><a href="boost-exception.html">Boost Exception<br/>
</a></div> </a></div>
<!-- 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) -->
<div id="footer"> <div id="footer">
<p>&nbsp;</p> <p>&nbsp;</p>
<hr/> <hr/>