Merged revisions 570-572,574-575,578-579,581-595,598-611 via svnmerge from
[senf.git] / Socket / ClientSocketHandle.hh
index 07f2069..6150e28 100644 (file)
@@ -1,9 +1,9 @@
 // $Id$
 //
 // Copyright (C) 2006
-// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
-// Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
-//     Stefan Bund <stefan.bund@fokus.fraunhofer.de>
+// Fraunhofer Institute for Open Communication Systems (FOKUS) 
+// Competence Center NETwork research (NET), St. Augustin, GERMANY 
+//     Stefan Bund <g0dil@berlios.de>
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License as published by
@@ -30,6 +30,8 @@
 // Custom includes
 #include <boost/call_traits.hpp>
 #include <boost/range.hpp>
+#include <boost/utility.hpp>
+#include <boost/type_traits.hpp>
 #include "SocketHandle.hh"
 
 //#include "ClientSocketHandle.mpp"
@@ -61,8 +63,6 @@ namespace senf {
         <tr><td>bind()</td>       <td>AddressingPolicy::bind (\ref senf::AddressingPolicyBase)</td>      <td></td></tr>
         <tr><td>peer()</td>       <td>AddressingPolicy::peer (\ref senf::AddressingPolicyBase)</td>      <td></td></tr>
         <tr><td>local()</td>      <td>AddressingPolicy::local (\ref senf::AddressingPolicyBase)</td>     <td></td></tr>
-        <tr><td>rcvbuf()</td>     <td>BufferingPolicy::sndbuf (\ref senf::BufferingPolicyBase)</td>      <td></td></tr>
-        <tr><td>sndbuf()</td>     <td>BufferingPolicy::rcvbuf (\ref senf::BufferingPolicyBase)</td>      <td></td></tr>
         </table>
 
         It is important to note, that not all members are always accessible. Which are depends on
@@ -84,10 +84,6 @@ namespace senf {
 
         \see \ref policy_group \n
              \ref protocol_group
-
-        \fixme Add enable_if conditions so anything convertible to unsigned will not be interpreted
-            as a Range template argument but will use the unsigned variant of
-            read/readfrom/write/writeto.
       */
     template <class Policy>
     class ClientSocketHandle
@@ -125,13 +121,22 @@ namespace senf {
         ClientSocketHandle();
 
         // conversion constructors
+#       ifndef DOXYGEN
         template <class OtherPolicy>
         ClientSocketHandle(ClientSocketHandle<OtherPolicy> other,
                            typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type * = 0);
+#       else
+        ClientSocketHandle(ClientSocketHandle<OtherPolicy> other);
+#       endif
 
+#       ifndef DOXYGEN
         template <class OtherPolicy>
         typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
         operator=(ClientSocketHandle<OtherPolicy> other);
+#       else
+        template <class OtherPolicy>
+        OtherPolicy const & operator=(ClientSocketHandle<OtherPolicy> other);
+#       endif        
 
         ///@}
         ///////////////////////////////////////////////////////////////////////////
@@ -172,6 +177,11 @@ namespace senf {
         */
         std::string  read         (unsigned limit=0);
         template <class ForwardWritableRange>
+#       ifndef DOXYGEN
+        typename boost::range_iterator<ForwardWritableRange>::type
+                     read         (ForwardWritableRange const & range,
+                                   typename boost::disable_if< boost::is_convertible<ForwardWritableRange,unsigned> >::type * = 0);
+#       else
         typename boost::range_iterator<ForwardWritableRange>::type
                      read         (ForwardWritableRange const & range);
                                         ///< Read data into range
@@ -186,6 +196,13 @@ namespace senf {
                                                  last read character 
                                              \see \ref read() \n
                                                   <a href="http://www.boost.org/libs/range/index.html">Boost.Range</a> */
+#       endif
+#       ifndef DOXYGEN
+        template <class ForwardWritableRange>
+        typename boost::range_iterator<ForwardWritableRange>::type
+                     read         (ForwardWritableRange & range,
+                                   typename boost::disable_if< boost::is_convertible<ForwardWritableRange,unsigned> >::type * = 0);
+#       else
         template <class ForwardWritableRange>
         typename boost::range_iterator<ForwardWritableRange>::type
                      read         (ForwardWritableRange & range);
@@ -193,6 +210,7 @@ namespace senf {
                                         /**< \see read(ForwardWritableRange const &) \n
                                                   read() \n
                                                   <a href="http://www.boost.org/libs/range/index.html">Boost.Range</a>  */
+#       endif
         template <class Sequence>
         void         read         (Sequence & container, unsigned limit);
                                         ///< Read data into container
@@ -402,24 +420,6 @@ namespace senf {
 
         ///@}
 
-        ///////////////////////////////////////////////////////////////////////////
-        ///\name Buffering
-        ///@{
-
-        unsigned     rcvbuf      ();    ///< Check size of receive buffer
-                                        /**< \returns size of receive buffer in bytes */
-        void         rcvbuf      (unsigned size);
-                                        ///< Set size of receive buffer
-                                        /**< \param[in] size size of receive buffer in bytes */
-
-        unsigned     sndbuf      ();    ///< Check size of send buffer
-                                        /**< \returns size of send buffer in bytes */
-        void         sndbuf      (unsigned size);
-                                        ///< Set size of send buffer
-                                        /**< \param[in] size size of send buffer in bytes */
-
-        ///@}
-
         static ClientSocketHandle cast_static(FileHandle handle);
         static ClientSocketHandle cast_dynamic(FileHandle handle);