haiku-website/static/legacy-docs/bebook/BVolumeRoster.html

71 lines
14 KiB
HTML
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!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"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>The Be Book - Classes And Methods - The Storage Kit</title><link rel="stylesheet" href="be_book.css" type="text/css" media="all" /><link rel="shortcut icon" type="image/vnd.microsoft.icon" href="./images/favicon.ico" /><!--[if IE]>
<link rel="stylesheet" type="text/css" href="be_book_ie.css" />
<![endif]--><meta name="generator" content="DocBook XSL Stylesheets V1.73.2" /><meta name="keywords" content="Access, BeOS, BeBook, API" /><link rel="start" href="index.html" title="The Be Book" /><link rel="up" href="TheStorageKit.html" title="The Storage Kit" /><link rel="prev" href="BVolume.html" title="BVolume" /><link rel="next" href="The_Node_Monitor.html" title="The Node Monitor" /></head><body><div id="header"><div id="headerT"><div id="headerTL"><a accesskey="p" href="BVolume.html" title="BVolume"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a accesskey="u" href="TheStorageKit.html" title="The Storage Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a accesskey="n" href="The_Node_Monitor.html" title="The Node Monitor"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="headerTR"><div id="navigpeople"><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div><div class="navigboxed" id="navigindex"><a accesskey="i" href="ClassIndex.html" title="Index">I</a></div><div class="navigboxed" id="naviglang" title="English">en</div></div><div id="headerTC">The Be Book - Classes And Methods - The Storage Kit</div></div><div id="headerB">Prev: <a href="BVolume.html">BVolume</a>  Up: <a href="TheStorageKit.html">The Storage Kit</a>  Next: <a href="The_Node_Monitor.html">The Node Monitor</a></div><hr /></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h2 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster"></a>BVolumeRoster</h2></div></div></div><a id="id1255827" class="indexterm"></a><div class="classheader"><table border="0"><colgroup><col /><col /></colgroup><tbody><tr><td><table width="100%" border="0"><colgroup><col /><col /></colgroup><tbody><tr><td>Derived From:</td><td>None</td></tr><tr><td>Mix-in Classes:</td><td>None</td></tr><tr><td>Declared In:</td><td><code class="filename">storage/VolumeRoster.h</code></td></tr><tr><td>Library:</td><td><code class="filename">libbe.so</code></td></tr><tr><td>Allocation:</td><td></td></tr></tbody></table></td><td>
<a class="link overview" href="BVolumeRoster_Overview.html" title="BVolumeRoster">Class Overview</a>
<div class="toc"><ul><li><span class="section"><a href="BVolumeRoster.html#BVolumeRoster_ConstructorDestructor">Constructor and Destructor</a></span></li><li><span class="section"><a href="BVolumeRoster.html#BVolumeRoster_Member_Functions">Member Functions</a></span></li></ul></div>
</td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster_ConstructorDestructor"></a>Constructor and Destructor</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster_Constructor"></a>BVolumeRoster()</h4></div></div></div><code class="constructorsynopsis cpp"><span class="methodname">BVolumeRoster</span>();</code><p>
Creates a new <code class="classname">BVolumeRoster</code> object. You don't have to "initialize" the
object before using it (as you do with most other Storage Kit classes).
You can call <a class="link" href="BVolumeRoster.html#BVolumeRoster_GetNextVolume" title="GetNextVolume(), Rewind()"><code class="methodname">GetNextVolume()</code></a>
(or whatever) immediately after constructing.
</p></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster_Destructor"></a>~BVolumeRoster()</h4></div></div></div><code class="destructorsynopsis cpp"><span class="modifier">virtual </span><span class="methodname">~BVolumeRoster</span>();</code><p>
Destroys the object. If this <code class="classname">BVolumeRoster</code> object was watching volumes,
the watch is called off.
</p></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><hr /><div xmlns:d="http://docbook.org/ns/docbook"><h3 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster_Member_Functions"></a>Member Functions</h3></div></div></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster_GetBootVolume"></a>GetBootVolume()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">GetBootVolume</span>(<span class="methodparam"><span class="type">BVolume* </span><span class="parameter">boot_vol</span></span>);</code><p>
Initializes <code class="parameter">boot_vol</code> to refer to the "boot volume." This is the volume
that was used to boot the computer. <code class="parameter">boot_vol</code> must be allocated before you
pass it in. If the boot volume can't be found, the argument is
uninitialized.
</p><p>
(Currently, this function looks for the volume that's mounted at
<code class="filename">/boot</code>.
The only way to fool the system into thinking that there isn't a boot
volume is to rename <code class="filename">/boot</code>—not a smart thing to do.)
</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_NO_ERROR</code>.</span></p></td><td><p>The boot volume was successfully retrieved.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_ENTRY_NOT_FOUND</code>.</span></p></td><td><p>The boot volume wasn't found.
</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster_GetNextVolume"></a><a id="BVolumeRoster_Rewind"></a>
GetNextVolume(), Rewind()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">GetNextVolume</span>(<span class="methodparam"><span class="type">BVolume* </span><span class="parameter">volume</span></span>);</code><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">Rewind</span>();</code><p>
<code class="methodname">GetNextVolume()</code> retrieves the "next" volume from the volume list and uses
it to initialize the argument (which must be allocated). When the
function return <code class="constant">B_BAD_VALUE</code>, you've reached the end of the list.
</p><p>
<code class="methodname">Rewind()</code> rewinds the volume list such that the next
<code class="methodname">GetNextVolume()</code> will
return the first element in the list.
</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_NO_ERROR</code>.</span></p></td><td><p>The next volume was successfully retrieved.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_VALUE</code>.</span></p></td><td><p>You've reached the end of the volume list.</p></td></tr></tbody></table></div><div class="section"><div xmlns="" xmlns:d="http://docbook.org/ns/docbook" class="titlepage"><div><div xmlns:d="http://docbook.org/ns/docbook"><h4 xmlns="http://www.w3.org/1999/xhtml" class="title"><a id="BVolumeRoster_StartWatching"></a><a id="BVolumeRoster_Messenger"></a>
<a id="BVolumeRoster_StopWatching"></a>
StartWatching(), StopWatching(), Messenger()</h4></div></div></div><code class="methodsynopsis cpp"><span class="type">status_t </span><span class="methodname">StartWatching</span>(<span class="methodparam"><span class="type"><a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a>* </span><span class="parameter">messenger</span><span class="initializer"> = <span class="varname">be_app_messenger </span></span></span>);</code><code class="methodsynopsis cpp"><span class="void">void </span><span class="methodname">StopWatching</span>();</code><code class="methodsynopsis cpp"><span class="type"><a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a> </span><span class="methodname">Messenger</span>() <span class="modifier">const</span>;</code><p>
These functions start and stop the <code class="classname">BVolumeRoster</code>'s volume-watching
facility. (This is actually just a convenient cover for the Node Monitor.)
</p><ul class="itemizedlist"><li><p>
<code class="methodname">StartWatching()</code> registers a request for notifications of volume
mounts and unmounts. The notifications are sent (as
<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>s) to the
<a class="link" href="BHandler.html" title="BHandler"><code class="classname">BHandler</code></a> /
<a class="link" href="BLooper.html" title="BLooper"><code class="classname">BLooper</code></a> pair specified by the argument. There are separate
messages for mounting and unmounting; their formats are described
below. The caller retains possession of the
<a class="link" href="BHandler.html" title="BHandler"><code class="classname">BHandler</code></a> /
<a class="link" href="BLooper.html" title="BLooper"><code class="classname">BLooper</code></a> that the
<a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a>
represents. The volume watching continues until this
<code class="classname">BVolumeRoster</code> object is destroyed, or until you call…
</p></li><li><p>
<code class="methodname">StopWatching()</code>. This function tells the volume-watcher to stop
watching. In other words, notifications of volume mounts and unmounts
are no longer sent to the <code class="classname">BVolumeRoster</code>'s target.
</p></li><li><p>
<code class="methodname">Messenger()</code> returns a copy of the
<a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a> object that was set in
the previous <code class="methodname">StartWatching()</code> call.
</p></li></ul><p>
There are separate notifications (<a class="link" href="BMessage.html" title="BMessage"><code class="classname">BMessage</code></a>s)
for volume-mounted and
volume-unmounted events. See the <code class="constant">B_DEVICE_MOUNTED</code> and <code class="constant">B_DEVICE_UNMOUNTED</code>
descriptions in "<a class="xref" href="The_Node_Monitor.html" title="The Node Monitor">The Node Monitor</a>" section of this chapter.
</p><table class="variablelist returncodes"><thead><tr><th>Return Code</th><th>Description</th></tr></thead><tbody><tr><td><p><span class="term"><code class="constant">B_NO_ERROR</code>.</span></p></td><td><p>The volume-watcher was successfully started or stopped.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_BAD_VALUE</code>.</span></p></td><td><p>Poorly formed
<a class="link" href="BMessenger.html" title="BMessenger"><code class="classname">BMessenger</code></a>.</p></td></tr><tr><td><p><span class="term"><code class="constant">B_NO_MEMORY</code>.</span></p></td><td><p>Couldn't allocate resources.</p></td></tr></tbody></table></div></div></div><div id="footer"><hr /><div id="footerT">Prev: <a href="BVolume.html">BVolume</a>  Up: <a href="TheStorageKit.html">The Storage Kit</a>  Next: <a href="The_Node_Monitor.html">The Node Monitor</a> </div><div id="footerB"><div id="footerBL"><a href="BVolume.html" title="BVolume"><img src="./images/navigation/prev.png" alt="Prev" /></a> <a href="TheStorageKit.html" title="The Storage Kit"><img src="./images/navigation/up.png" alt="Up" /></a> <a href="The_Node_Monitor.html" title="The Node Monitor"><img src="./images/navigation/next.png" alt="Next" /></a></div><div id="footerBR"><div><a href="http://www.haiku-os.org"><img src="./images/People_24.png" alt="haiku-os.org" title="Visit The Haiku Website" /></a></div><div class="navighome" title="Home"><a accesskey="h" href="index.html"><img src="./images/navigation/home.png" alt="Home" /></a></div></div><div id="footerBC"><a href="http://www.access-company.com/home.html" title="ACCESS Co."><img alt="Access Company" src="./images/access_logo.png" /></a></div></div></div><div id="licenseFooter"><div id="licenseFooterBL"><a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/" title="Creative Commons License"><img alt="Creative Commons License" style="border-width:0" src="https://licensebuttons.net/l/by-nc-nd/3.0/88x31.png" /></a></div><div id="licenseFooterBR"><a href="./LegalNotice.html">Legal Notice</a></div><div id="licenseFooterBC"><span id="licenseText">This work is licensed under a
<a rel="license" href="http://creativecommons.org/licenses/by-nc-nd/3.0/">Creative
Commons Attribution-Non commercial-No Derivative Works 3.0 License</a>.</span></div></div></body></html>