blob: 7eead7638933a8f338010f863bd24b23b0581a86 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>tbb::tbb_exception Class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.4.7 -->
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li id="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
</ul></div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
<li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
</ul></div>
<div class="nav">
<a class="el" href="a00267.html">tbb</a>::<a class="el" href="a00206.html">tbb_exception</a></div>
<h1>tbb::tbb_exception Class Reference</h1><!-- doxytag: class="tbb::tbb_exception" -->Interface to be implemented by all exceptions TBB recognizes and propagates across the threads.
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="a00453.html">tbb_exception.h</a>&gt;</code>
<p>
<p>Inheritance diagram for tbb::tbb_exception:
<p><center><img src="a00206.png" usemap="#tbb::tbb_exception_map" border="0" alt=""></center>
<map name="tbb::tbb_exception_map">
<area href="a00153.html" alt="tbb::captured_exception" shape="rect" coords="0,56,248,80">
<area href="a00171.html" alt="tbb::movable_exception< ExceptionData >" shape="rect" coords="258,56,506,80">
</map>
<a href="a00098.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual <a class="el" href="a00206.html">tbb_exception</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00206.html#3e3482bf264d4ca4dde046cd9c02c766">move</a> ()=0 throw ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Creates and returns pointer to the deep copy of this exception object. <a href="#3e3482bf264d4ca4dde046cd9c02c766"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00206.html#66c94938eca8bf88b76f3eccaaf215d8">destroy</a> ()=0 throw ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Destroys objects created by the <a class="el" href="a00206.html#3e3482bf264d4ca4dde046cd9c02c766">move()</a> method. <a href="#66c94938eca8bf88b76f3eccaaf215d8"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">virtual void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00206.html#8588e07fa49692f4d734e4f2e4f048f4">throw_self</a> ()=0</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Throws this exception object. <a href="#8588e07fa49692f4d734e4f2e4f048f4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="d00f6497e552fee978a02bfcbebf46e2"></a><!-- doxytag: member="tbb::tbb_exception::name" ref="d00f6497e552fee978a02bfcbebf46e2" args="() const =0" -->
virtual const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00206.html#d00f6497e552fee978a02bfcbebf46e2">name</a> () const =0 throw ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns RTTI name of the originally intercepted exception. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="anchor" name="e8157689ecb66bc6c72d3618bf3cc371"></a><!-- doxytag: member="tbb::tbb_exception::what" ref="e8157689ecb66bc6c72d3618bf3cc371" args="() const =0" -->
virtual const char *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00206.html#e8157689ecb66bc6c72d3618bf3cc371">what</a> () const =0 throw ()</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Returns the result of originally intercepted exception's <a class="el" href="a00206.html#e8157689ecb66bc6c72d3618bf3cc371">what()</a> method. <br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="a00206.html#3f2da7f3d8a6e4c1df522af1213afb5a">operator delete</a> (void *p)</td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
Interface to be implemented by all exceptions TBB recognizes and propagates across the threads.
<p>
If an unhandled exception of the type derived from <a class="el" href="a00206.html">tbb::tbb_exception</a> is intercepted by the TBB scheduler in one of the worker threads, it is delivered to and re-thrown in the root thread. The root thread is the thread that has started the outermost algorithm or root task sharing the same <a class="el" href="a00201.html">task_group_context</a> with the guilty algorithm/task (the one that threw the exception first).<p>
Note: when documentation mentions workers with respect to exception handling, masters are implied as well, because they are completely equivalent in this context. Consequently a root thread can be master or worker thread.<p>
NOTE: In case of nested algorithms or complex task hierarchies when the nested levels share (explicitly or by means of implicit inheritance) the task group context of the outermost level, the exception may be (re-)thrown multiple times (ultimately - in each worker on each nesting level) before reaching the root thread at the outermost level. IMPORTANT: if you intercept an exception derived from this class on a nested level, you must re-throw it in the catch block by means of the "throw;" operator.<p>
TBB provides two implementations of this interface: <a class="el" href="a00153.html">tbb::captured_exception</a> and template class <a class="el" href="a00171.html">tbb::movable_exception</a>. See their declarations for more info.
<p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="66c94938eca8bf88b76f3eccaaf215d8"></a><!-- doxytag: member="tbb::tbb_exception::destroy" ref="66c94938eca8bf88b76f3eccaaf215d8" args="()=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void tbb::tbb_exception::destroy </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"> throw ()<code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Destroys objects created by the <a class="el" href="a00206.html#3e3482bf264d4ca4dde046cd9c02c766">move()</a> method.
<p>
Frees memory and calls destructor for this exception object. Can and must be used only on objects created by the move method.
<p>
Implemented in <a class="el" href="a00153.html#93d875d3555502ff6f18513525de204c">tbb::captured_exception</a>, and <a class="el" href="a00171.html#7a46873119d9f85a7b0009c13e41a258">tbb::movable_exception&lt; ExceptionData &gt;</a>.
</div>
</div><p>
<a class="anchor" name="3e3482bf264d4ca4dde046cd9c02c766"></a><!-- doxytag: member="tbb::tbb_exception::move" ref="3e3482bf264d4ca4dde046cd9c02c766" args="()=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual <a class="el" href="a00206.html">tbb_exception</a>* tbb::tbb_exception::move </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"> throw ()<code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Creates and returns pointer to the deep copy of this exception object.
<p>
Move semantics is allowed.
<p>
Implemented in <a class="el" href="a00153.html#837a50b8f6a800bda225c39d1699643f">tbb::captured_exception</a>, and <a class="el" href="a00171.html#1aea0ad179d6f0481fe7f3495f66adf9">tbb::movable_exception&lt; ExceptionData &gt;</a>.
</div>
</div><p>
<a class="anchor" name="3f2da7f3d8a6e4c1df522af1213afb5a"></a><!-- doxytag: member="tbb::tbb_exception::operator delete" ref="3f2da7f3d8a6e4c1df522af1213afb5a" args="(void *p)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void tbb::tbb_exception::operator delete </td>
<td>(</td>
<td class="paramtype">void *&nbsp;</td>
<td class="paramname"> <em>p</em> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"><code> [inline]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Operator delete is provided only to allow using existing smart pointers with TBB exception objects obtained as the result of applying <a class="el" href="a00206.html#3e3482bf264d4ca4dde046cd9c02c766">move()</a> operation on an exception thrown out of TBB scheduler.<p>
When overriding method <a class="el" href="a00206.html#3e3482bf264d4ca4dde046cd9c02c766">move()</a> make sure to override operator delete as well if memory is allocated not by TBB's scalable allocator.
</div>
</div><p>
<a class="anchor" name="8588e07fa49692f4d734e4f2e4f048f4"></a><!-- doxytag: member="tbb::tbb_exception::throw_self" ref="8588e07fa49692f4d734e4f2e4f048f4" args="()=0" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">virtual void tbb::tbb_exception::throw_self </td>
<td>(</td>
<td class="paramname"> </td>
<td>&nbsp;)&nbsp;</td>
<td width="100%"><code> [pure virtual]</code></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Throws this exception object.
<p>
Make sure that if you have several levels of derivation from this interface you implement or override this method on the most derived level. The implementation is as simple as "throw *this;". Failure to do this will result in exception of a base class type being thrown.
<p>
Implemented in <a class="el" href="a00153.html#2dd1be66ab32fa27e0ddef5707fa67ef">tbb::captured_exception</a>, and <a class="el" href="a00171.html#17cffba35811c92b7e65d63506b69602">tbb::movable_exception&lt; ExceptionData &gt;</a>.
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a00453.html">tbb_exception.h</a></ul>
<hr>
<p></p>
Copyright &copy; 2005-2010 Intel Corporation. All Rights Reserved.
<p></p>
Intel, Pentium, Intel Xeon, Itanium, Intel XScale and VTune are
registered trademarks or trademarks of Intel Corporation or its
subsidiaries in the United States and other countries.
<p></p>
* Other names and brands may be claimed as the property of others.