Update of /cvsroot/boost/boost/boost/asio
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2294/boost/asio
Modified Files:
completion_condition.hpp
Log Message:
Improve documentation for completion condition objects.
Index: completion_condition.hpp
===================================================================
RCS file: /cvsroot/boost/boost/boost/asio/completion_condition.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- completion_condition.hpp 4 Jan 2007 05:53:00 -0000 1.2
+++ completion_condition.hpp 31 Jul 2007 11:39:30 -0000 1.3
@@ -72,6 +72,28 @@
/// Return a completion condition function object that indicates that a read or
/// write operation should continue until all of the data has been transferred,
/// or until an error occurs.
+/**
+ * This function is used to create an object, of unspecified type, that meets
+ * CompletionCondition requirements.
+ *
+ * @par Example
+ * Reading until a buffer is full:
+ * @code
+ * boost::array<char, 128> buf;
+ * boost::system::error_code ec;
+ * std::size_t n = boost::asio::read(
+ * sock, boost::asio::buffer(buf),
+ * boost::asio::transfer_all(), ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * else
+ * {
+ * // n == 128
+ * }
+ * @endcode
+ */
#if defined(GENERATING_DOCUMENTATION)
unspecified transfer_all();
#else
@@ -84,6 +106,28 @@
/// Return a completion condition function object that indicates that a read or
/// write operation should continue until a minimum number of bytes has been
/// transferred, or until an error occurs.
+/**
+ * This function is used to create an object, of unspecified type, that meets
+ * CompletionCondition requirements.
+ *
+ * @par Example
+ * Reading until a buffer is full or contains at least 64 bytes:
+ * @code
+ * boost::array<char, 128> buf;
+ * boost::system::error_code ec;
+ * std::size_t n = boost::asio::read(
+ * sock, boost::asio::buffer(buf),
+ * boost::asio::transfer_at_least(64), ec);
+ * if (ec)
+ * {
+ * // An error occurred.
+ * }
+ * else
+ * {
+ * // n >= 64 && n <= 128
+ * }
+ * @endcode
+ */
#if defined(GENERATING_DOCUMENTATION)
unspecified transfer_at_least(std::size_t minimum);
#else
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
Boost-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/boost-cvs