Merge branch 'master' into sam460ex
This commit is contained in:
@@ -35,6 +35,9 @@
|
||||
\var B_STOP_WATCHING
|
||||
|
||||
Flag for watch_node(). Unsubscribe from watching a node.
|
||||
|
||||
\attention \c B_STOP_WATCHING does not apply to volume watching, you must
|
||||
call stop_watching() instead.
|
||||
*/
|
||||
|
||||
|
||||
@@ -329,13 +332,13 @@
|
||||
- \c B_WATCH_ALL
|
||||
- \c B_WATCH_MOUNT
|
||||
|
||||
Note, that the latter two cases are not mutual exclusive, i.e. mount and
|
||||
Note that the latter two cases are not mutual exclusive, i.e. mount and
|
||||
node watching can be requested with a single call.
|
||||
|
||||
\param node node_ref referring to the node to be watched. May be \c NULL,
|
||||
if only mount watching is requested.
|
||||
\param flags Flags indicating the actions to be performed.
|
||||
\param target Messenger referring to the target. Must be valid.
|
||||
\param target BMessenger object referring to the \a target.
|
||||
|
||||
\return \c B_OK if everything went fine, an error code otherwise.
|
||||
*/
|
||||
@@ -368,7 +371,7 @@
|
||||
- \c B_WATCH_ALL
|
||||
- \c B_WATCH_MOUNT
|
||||
|
||||
Note, that the latter two cases are not mutual exlusive, i.e. mount and
|
||||
Note that the latter two cases are not mutual exclusive, i.e. mount and
|
||||
node watching can be requested with a single call.
|
||||
|
||||
\param node node_ref referring to the node to be watched. May be \c NULL,
|
||||
@@ -387,20 +390,41 @@
|
||||
\fn status_t stop_watching(BMessenger target)
|
||||
\brief Unsubscribes \a target from node and mount monitoring.
|
||||
|
||||
\param target Messenger referring to the target. Must be valid.
|
||||
You may still receive notification messages after calling stop_watching()
|
||||
because while node monitoring is asynchronous and all changes are atomic,
|
||||
message sending is not atomic so there is a lag time from when you
|
||||
stop monitoring and when the message is received in your message receiving
|
||||
thread. You can check the timestamp of the message to determine if
|
||||
it was sent after stop_watching() was called.
|
||||
|
||||
\return \c B_OK if everything went fine, an error code otherwise.
|
||||
\param target BMessenger object referring to the \a target.
|
||||
|
||||
\return A status code.
|
||||
\retval B_OK Stopped sending notification messages to the \a target.
|
||||
\retval B_BAD_VALUE \a target was invalid.
|
||||
\retval B_ENTRY_NOT_FOUND Node not found.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn status_t stop_watching(const BHandler *handler, const BLooper *looper)
|
||||
\brief Unsubscribes \a target from node and mount monitoring.
|
||||
\brief Unsubscribes \a handler or \a looper target from node and mount
|
||||
monitoring.
|
||||
|
||||
\param handler The target handler. May be \c NULL, if \a looper is not
|
||||
\c NULL. Then the preferred handler of the looper is targeted.
|
||||
\param looper The target looper. May be \c NULL, if \a handler is not
|
||||
\c NULL. Then the handler's looper is the target looper.
|
||||
You may still receive notification messages after calling stop_watching()
|
||||
because while node monitoring is asynchronous and all changes are atomic,
|
||||
message sending is not atomic so there is a lag time from when you
|
||||
stop monitoring and when the message is received in your message receiving
|
||||
thread. You can check the timestamp of the message to determine if
|
||||
it was sent after stop_watching() was called.
|
||||
|
||||
\return \c B_OK if everything went fine, an error code otherwise.
|
||||
\param handler The target handler, may be \c NULL. If \a looper is not
|
||||
\c NULL then the looper's preferred handler is targeted.
|
||||
\param looper The target looper, may be \c NULL. If \a handler is not
|
||||
\c NULL then the handler's looper is targeted.
|
||||
|
||||
\return A status code.
|
||||
\retval B_OK Stopped sending notification messages to the target.
|
||||
\retval B_BAD_VALUE Target from \a handler or \a looper was invalid.
|
||||
\retval B_ENTRY_NOT_FOUND Node not found.
|
||||
*/
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
/*
|
||||
* Copyright 2002-2013 Haiku Inc. All rights reserved.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*
|
||||
* Authors:
|
||||
* Vincent Dominguez
|
||||
* John Scipione, [email protected]
|
||||
* Ingo Weinhold, [email protected]
|
||||
*
|
||||
* Corresponds to:
|
||||
* headers/os/storage/VolumeRoster.h hrev45306
|
||||
* src/kits/storage/VolumeRoster.cpp hrev45306
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\file VolumeRoster.h
|
||||
\ingroup storage
|
||||
\ingroup libbe
|
||||
\brief Provides the BVolumeRoster class.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\class BVolumeRoster
|
||||
\ingroup storage
|
||||
\ingroup libbe
|
||||
\brief Provides an interface for iterating through available volumes
|
||||
and watching for mounting/unmounting.
|
||||
|
||||
This class wraps the next_dev() function for iterating through the
|
||||
list of available volumes and watch_node()/stop_watching() for
|
||||
watching volumes.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn BVolumeRoster::BVolumeRoster()
|
||||
\brief Creates a BVolumeRoster object. The object is ready to be used.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn BVolumeRoster::~BVolumeRoster()
|
||||
\brief Deletes the volume roster and frees all associated resources.
|
||||
|
||||
If a watch was activated (by StartWatching()), it is deactivated.
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/*!
|
||||
\fn status_t BVolumeRoster::GetNextVolume(BVolume *volume)
|
||||
\brief Fills out the passed in BVolume object with the next available
|
||||
volume.
|
||||
|
||||
\param volume A pointer to a pre-allocated BVolume object to be
|
||||
initialized to the next available volume.
|
||||
|
||||
\return A status code.
|
||||
\retval B_OK Everything went fine.
|
||||
\retval B_BAD_VALUE The last volume in the list was already returned.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn void BVolumeRoster::Rewind()
|
||||
\brief Rewinds the list of available volumes back to the first item.
|
||||
|
||||
The next call to GetNextVolume() will return the first available volume.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn status_t BVolumeRoster::GetBootVolume(BVolume *volume)
|
||||
\brief Fills out the passed in BVolume object with the boot volume.
|
||||
|
||||
Currently, this method looks for the volume that is mounted at "/boot".
|
||||
The only way to fool the system into thinking that there is not a boot
|
||||
volume is to rename "/boot" -- but, please refrain from doing this.
|
||||
|
||||
\param volume A pointer to a pre-allocated BVolume to be initialized to
|
||||
refer to the boot volume.
|
||||
|
||||
\return A status code, \c B_OK if everything went fine or an error code
|
||||
otherwise.
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn status_t BVolumeRoster::StartWatching(BMessenger messenger)
|
||||
\brief Starts watching the available volumes for changes.
|
||||
|
||||
Notifications are sent to the specified target whenever a volume is
|
||||
mounted or unmounted. The format of the notification messages is
|
||||
described under watch_node(). Actually BVolumeRoster just provides a
|
||||
more convenient interface for it.
|
||||
|
||||
If StartWatching() has been called before with another target and no
|
||||
StopWatching() since, StopWatching() is called first, so that the former
|
||||
target won't receive any notifications anymore.
|
||||
|
||||
When the object is destroyed all watching ends as well.
|
||||
|
||||
\param messenger The target which the notification messages are sent.
|
||||
|
||||
\return A status code.
|
||||
\retval B_OK Everything went fine.
|
||||
\retval B_BAD_VALUE The supplied BMessenger was invalid.
|
||||
\retval B_NO_MEMORY There was insufficient memory to carry out this
|
||||
operation.
|
||||
|
||||
\see watch_node()
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn void BVolumeRoster::StopWatching()
|
||||
\brief Stops watching volumes initiated by StartWatching().
|
||||
|
||||
\see stop_watching()
|
||||
*/
|
||||
|
||||
|
||||
/*!
|
||||
\fn BMessenger BVolumeRoster::Messenger() const
|
||||
\brief Returns the messenger currently watching the volume list.
|
||||
|
||||
\return A messenger to the target currently watching the volume list, or
|
||||
an invalid messenger if not watching.
|
||||
*/
|
||||
Reference in New Issue
Block a user