|
From: <rus...@us...> - 2008-10-24 02:56:39
|
Revision: 338
http://gearbox.svn.sourceforge.net/gearbox/?rev=338&view=rev
Author: russo2503v
Date: 2008-10-24 02:56:23 +0000 (Fri, 24 Oct 2008)
Log Message:
-----------
docco: added not on smart pointers.
Modified Paths:
--------------
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h
gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2008-10-23 04:31:34 UTC (rev 337)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/buffer.h 2008-10-24 02:56:23 UTC (rev 338)
@@ -34,7 +34,9 @@
/*!
@brief A thread-safe data pipe with buffer semantics.
-For a type-safe buffer, template over the specific object Type you want to put in it. Buffering Ice smart pointers requires a specialized class PtrBuffer.
+For a type-safe buffer, template over the specific object Type you want to put in it. You can use
+this container for storing smart pointers (e.g. IceUtil smart pointers). In this case the container will
+only store the pointers and will not perform a deep copy.
You should always try to @ref get() data before blocking with @ref getNext() because closely spaced push events may be lost. For example:
@verbatim
@@ -57,7 +59,7 @@
@endverbatim
@note This implementation uses IceUtil threading classes. See example in sec. 28.9.2 of the Ice manual.
-@see PtrBuffer, Notify, Proxy
+@see Notify, Proxy
*/
template<class Type>
class Buffer : public IceUtil::Monitor<IceUtil::Mutex>
@@ -113,7 +115,7 @@
* Non-popping and non-blocking read from the front of the buffer.
*
* Calls to @ref get() on an empty buffer raises an gbxutilacfr::Exception exception.
- * You can trap these and call @ref getNext() which will block until new data arrives.
+ * You can catch these and call @ref getNext() which will block until new data arrives.
*/
void get( Type & obj ) const;
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h 2008-10-23 04:31:34 UTC (rev 337)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/notify.h 2008-10-24 02:56:23 UTC (rev 338)
@@ -43,6 +43,9 @@
* Write new data with Notify::set. The data is delivered to the data handler by
* calling NotifyHandler::handleData in the registered NotifyHandler.
*
+ * When used with smart pointers (e.g. IceUtil smart pointers), this class will not
+ * perform a deep copy.
+ *
* @see Buffer, Proxy
*/
template<class Type>
Modified: gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h
===================================================================
--- gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2008-10-23 04:31:34 UTC (rev 337)
+++ gearbox/trunk/src/gbxsickacfr/gbxiceutilacfr/store.h 2008-10-24 02:56:23 UTC (rev 338)
@@ -1,6 +1,6 @@
/*
* GearBox Project: Peer-Reviewed Open-Source Libraries for Robotics
- * http://gearbox.sf.net/
+ http://gearbox.sf.net/
* Copyright (c) 2004-2008 Alex Brooks, Alexei Makarenko, Tobias Kaupp
*
* This distribution is licensed to you under the terms described in
@@ -20,20 +20,23 @@
namespace gbxiceutilacfr {
/*!
- * @brief Thread-safe storage for a single data objects.
- *
- * This container is similar to a circular Buffer of size one but with two
- * differences:
- * - a copy of the data is always available, yet the user knows when new
- * data has arrived by calling isNewData().
- * - getNext() returns the new data arrives (not when the buffer
- * is non-empty.
- *
- * Write to it with set(). Read its contents with get(). Trying to read from
- * an empty Store raises an gbxutilacfr::Exception.
- *
- * @note Replaces the deprecated Proxy class.
- * @see Buffer, Notify
+@brief Thread-safe storage for a single data objects.
+
+This container is similar to a circular Buffer of size one but with two
+differences:
+- a copy of the data is always available, yet the user knows when new
+ data has arrived by calling isNewData().
+- getNext() returns the new data arrives (not when the buffer
+ is non-empty.
+
+You can use this container for storing smart pointers (e.g. IceUtil smart pointers).
+In this case the container will only store the pointer and will not perform a deep copy.
+
+Write to it with set(). Read its contents with get(). Trying to read from
+an empty Store raises an gbxutilacfr::Exception.
+
+@note Replaces the deprecated Proxy class.
+@see Buffer, Notify
*/
template<class Type>
class Store : public IceUtil::Monitor<IceUtil::Mutex>
@@ -60,14 +63,13 @@
void get( Type & obj ) const;
/*!
- * @brief Waits until the next update and returns the new value.
- * If the Store is empty, @ref getNext blocks until the Store is set and returns the new value.
- * By default, there is no timeout (negative value). Returns 0 if successful.
- *
- * If timeout is set to a positive value (in milliseconds) and the wait times out, the function returns -1
- * and the object argument itself is not touched. In the rare event of spurious wakeup,
- * the return value is 1.
- *
+ @brief Waits until the next update and returns the new value.
+ If the Store is empty, @ref getNext blocks until the Store is set and returns the new value.
+ By default, there is no timeout (negative value). Returns 0 if successful.
+
+ If timeout is set to a positive value (in milliseconds) and the wait times out, the function returns -1
+ and the object argument itself is not touched. In the rare event of spurious wakeup,
+ the return value is 1.
*/
int getNext( Type & obj, int timeoutMs=-1 ) const;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|