added warning to torrent_handle

This commit is contained in:
Arvid Norberg 2006-10-14 17:18:41 +00:00
parent 892268aef4
commit 6727dfaed7
2 changed files with 14 additions and 0 deletions

View File

@ -1222,6 +1222,14 @@ struct torrent_handle
<p>The default constructor will initialize the handle to an invalid state. Which means you cannot
perform any operation on it, unless you first assign it a valid handle. If you try to perform
any operation on an uninitialized handle, it will throw <tt class="docutils literal"><span class="pre">invalid_handle</span></tt>.</p>
<div class="warning">
<p class="first admonition-title">Warning</p>
<p class="last">All operations on a <tt class="docutils literal"><span class="pre">torrent_handle</span></tt> may throw <a class="reference" href="#invalid-handle">invalid_handle</a>
exception, in case the handle is no longer refering to a torrent. There are
two exceptions, <tt class="docutils literal"><span class="pre">info_hash()</span></tt> and <tt class="docutils literal"><span class="pre">is_valid()</span></tt> will never throw.
Since the torrents are processed by a background thread, there is no
guarantee that a handle will remain valid between two calls.</p>
</div>
<p><em>TODO: document filter_piece(), filter_pieces(), is_piece_filtered(), filtered_pieces() and filter_files()</em></p>
<div class="section" id="file-progress">
<h2><a name="file-progress">file_progress()</a></h2>

View File

@ -1160,6 +1160,12 @@ The default constructor will initialize the handle to an invalid state. Which me
perform any operation on it, unless you first assign it a valid handle. If you try to perform
any operation on an uninitialized handle, it will throw ``invalid_handle``.
.. warning:: All operations on a ``torrent_handle`` may throw invalid_handle_
exception, in case the handle is no longer refering to a torrent. There are
two exceptions, ``info_hash()`` and ``is_valid()`` will never throw.
Since the torrents are processed by a background thread, there is no
guarantee that a handle will remain valid between two calls.
*TODO: document filter_piece(), filter_pieces(), is_piece_filtered(), filtered_pieces() and filter_files()*
file_progress()