Add more #ifndef DOXYGEN comments to hide boost::enable_if type constructs
g0dil [Mon, 23 Jul 2007 23:23:33 +0000 (23:23 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@344 270642c3-0616-0410-b53a-bc976706d245

Socket/ClientSocketHandle.cti
Socket/ClientSocketHandle.hh
Socket/CommunicationPolicy.cti
Socket/CommunicationPolicy.hh
Socket/GenericAddressingPolicy.cti
Socket/GenericAddressingPolicy.hh
Socket/ReadWritePolicy.cti
Socket/ReadWritePolicy.hh

index 7f46c6c..f584a18 100644 (file)
@@ -102,6 +102,7 @@ template <class Policy>
 prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle()
 {}
 
+#ifndef DOXYGEN
 template <class Policy>
 template <class OtherPolicy>
 prefix_ senf::ClientSocketHandle<Policy>::
@@ -109,6 +110,13 @@ ClientSocketHandle(ClientSocketHandle<OtherPolicy> other,
                    typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type *)
     : SocketHandle<Policy>(other,true) 
 {}
+#else
+template <class Policy>
+template <class OtherPolicy>
+prefix_ senf::ClientSocketHandle<Policy>::
+ClientSocketHandle(ClientSocketHandle<OtherPolicy> other)
+{}
+#endif
 
 template <class Policy>
 prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle(FileHandle other, bool isChecked)
@@ -124,6 +132,7 @@ senf::ClientSocketHandle<Policy>::ClientSocketHandle(std::auto_ptr<SocketProtoco
     this->body().fd(fd);
 }
 
+#ifndef DOXYGEN
 template <class Policy>
 template <class OtherPolicy>
 prefix_ typename senf::SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
@@ -132,6 +141,13 @@ senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> othe
     assign(other);
     return *this;
 }
+#else 
+template <class Policy>
+template <class OtherPolicy>
+prefix_ OtherPolicy const &
+senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> other)
+{}
+#endif
 
 ////////////////////////////////////////
 // reading and writing
@@ -163,6 +179,7 @@ read(ForwardWritableRange const & range)
 {}
 #endif
 
+#ifndef DOXYGEN
 template <class Policy>
 template <class ForwardWritableRange>
 prefix_ typename boost::range_iterator<ForwardWritableRange>::type
@@ -178,6 +195,14 @@ read(ForwardWritableRange & range,
         >::value && sizeof(typename boost::range_value<ForwardWritableRange>::type)==sizeof(char)
         >::read(*this, range);
 }
+#else
+template <class Policy>
+template <class ForwardWritableRange>
+prefix_ typename boost::range_iterator<ForwardWritableRange>::type
+senf::ClientSocketHandle<Policy>::
+read(ForwardWritableRange & range)
+{}
+#endif
 
 template <class Policy>
 prefix_ char * senf::ClientSocketHandle<Policy>::read(char * start, char * end)
index 2e2372a..1eff5ce 100644 (file)
@@ -123,13 +123,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        
 
         ///@}
         ///////////////////////////////////////////////////////////////////////////
@@ -190,14 +199,20 @@ namespace senf {
                                              \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);
                                         ///< Read data into range
                                         /**< \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
index 92b410b..36d5a19 100644 (file)
@@ -31,6 +31,7 @@
 #define prefix_ inline
 ///////////////////////////////cti.p///////////////////////////////////////
 
+#ifndef DOXYGEN
 template <class Policy>
 prefix_ void senf::ConnectedCommunicationPolicy::
 listen(ServerSocketHandle<Policy> handle, unsigned backlog,
@@ -38,7 +39,14 @@ listen(ServerSocketHandle<Policy> handle, unsigned backlog,
 {
     do_listen(handle, backlog);
 }
+#else
+template <class Policy>
+prefix_ void senf::ConnectedCommunicationPolicy::
+listen(ServerSocketHandle<Policy> handle, unsigned backlog)
+{}
+#endif
 
+#ifndef DOXYGEN
 template <class Policy>
 prefix_ int senf::ConnectedCommunicationPolicy::
 accept(ServerSocketHandle<Policy> handle,
@@ -47,6 +55,13 @@ accept(ServerSocketHandle<Policy> handle,
 {
     return do_accept(handle,address.sockaddr_p(),address.sockaddr_len());
 }
+#else
+template <class Policy>
+prefix_ int senf::ConnectedCommunicationPolicy::
+accept(ServerSocketHandle<Policy> handle,
+       typename ServerSocketHandle<Policy>::Address & address)
+{}
+#endif
 
 ///////////////////////////////cti.e///////////////////////////////////////
 #undef prefix_
index 1f8bb03..0da9930 100644 (file)
@@ -51,16 +51,27 @@ namespace senf {
      */
     struct ConnectedCommunicationPolicy : public CommunicationPolicyBase
     {
+#       ifndef DOXYGEN
         template <class Policy>
         static void listen(ServerSocketHandle<Policy> handle, unsigned backlog,
                            typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type * = 0);
+#       else
+        template <class Policy>
+        static void listen(ServerSocketHandle<Policy> handle, unsigned backlog);
                                         ///< Enable establishing new connections on the socket
                                         /**< \param[in] handle socket handle to enable reception on
                                              \param[in] backlog size of backlog queue */
+#       endif
+
+#       ifndef DOXYGEN
         template <class Policy>
         static int accept(ServerSocketHandle<Policy> handle,
                           typename ServerSocketHandle<Policy>::Address & address,
                           typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type * = 0);
+#       else
+        template <class Policy>
+        static int accept(ServerSocketHandle<Policy> handle,
+                          typename ServerSocketHandle<Policy>::Address & address);
                                         ///< accept a new connection on the socket.
                                         /**< The accept() member will return a new client file
                                              descriptor. This file descriptor will be used by the
@@ -71,6 +82,8 @@ namespace senf {
                                              \param[out] address address of newly connected remote
                                                  peer
                                              \returns file descriptor of new client socket */
+#       endif
+
     private:
         static void do_listen(FileHandle handle, unsigned backlog);
         static int do_accept(FileHandle handle, struct sockaddr * addr, unsigned len);
index 5f7a4a7..68f31cd 100644 (file)
@@ -34,6 +34,7 @@
 ///////////////////////////////////////////////////////////////////////////
 // senf::GenericAddressingPolicy<Address>
 
+#ifndef DOXYGEN
 template <class Address>
 template <class Policy>
 prefix_ void senf::GenericAddressingPolicy<Address>::
@@ -43,7 +44,15 @@ peer(SocketHandle<Policy> handle, Address & addr,
     addr.clear();
     do_peer(handle,addr.sockaddr_p(),addr.sockaddr_len());
 }
+#else
+template <class Address>
+template <class Policy>
+prefix_ void senf::GenericAddressingPolicy<Address>::
+peer(SocketHandle<Policy> handle, Address & addr)
+{}
+#endif
 
+#ifndef DOXYGEN
 template <class Address>
 template <class Policy>
 prefix_ void senf::GenericAddressingPolicy<Address>::
@@ -52,6 +61,13 @@ connect(SocketHandle<Policy> handle, Address const & addr,
 {
     do_connect(handle,addr.sockaddr_p(),addr.sockaddr_len());
 }
+#else
+template <class Address>
+template <class Policy>
+prefix_ void senf::GenericAddressingPolicy<Address>::
+connect(SocketHandle<Policy> handle, Address const & addr)
+{}
+#endif
 
 template <class Address>
 prefix_ void senf::GenericAddressingPolicy<Address>::local(FileHandle handle,
index 07e67b9..b8bcfc3 100644 (file)
@@ -81,23 +81,32 @@ namespace senf {
     struct GenericAddressingPolicy
         : private GenericAddressingPolicy_Base
     {
+#       ifndef DOXYGEN
         template <class Policy>
         static void peer(SocketHandle<Policy> handle, Address & addr,
                          typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type * = 0);
+#       else
+        template <class Policy>
+        static void peer(SocketHandle<Policy> handle, Address & addr);
                                         ///< Return address of remote peer on connected sockets
                                         /**< This member is only available if the socket handles
                                              communication policy is ConnectedCommunicationPolicy.
 
                                              \param[in] handle socket handle to get peer address of
                                              \param[out] addr address of remote peer */
+#       endif
         static void local(FileHandle handle, Address & addr);
                                         ///< Return local of socket
                                         /**< \param[in] handle socket handle to check
                                              \param[out] addr local socket address */
 
+#       ifndef DOXYGEN
         template <class Policy>
         static void connect(SocketHandle<Policy> handle, Address const & addr,
                             typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type * = 0);
+#       else
+        template <class Policy>
+        static void connect(SocketHandle<Policy> handle, Address const & addr);
                                         ///< Connect to remote host
                                         /**< This member is only available if the socket handles
                                              communication policy is ConnectedCommunicationPolicy.
@@ -105,6 +114,7 @@ namespace senf {
                                              \param[in] handle socket handle
                                              \param[in] addr address of remote peer to connect
                                                  to */
+#       endif
         static void bind(FileHandle handle, Address const & addr);
                                         ///< Set local socket address
                                         /**< \param[in] handle socket handle
index 7bd6ceb..2c5976c 100644 (file)
@@ -31,6 +31,7 @@
 #define prefix_ inline
 ///////////////////////////////cti.p///////////////////////////////////////
 
+#ifndef DOXYGEN
 template <class Policy>
 prefix_ unsigned senf::ReadablePolicy::
 readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
@@ -39,7 +40,15 @@ readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
 {
     return do_rcvfrom(handle, buffer, size, address.sockaddr_p(), address.sockaddr_len());
 }
+#else
+template <class Policy>
+prefix_ unsigned senf::ReadablePolicy::
+readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
+         typename Policy::AddressingPolicy::Address & address)
+{}
+#endif
 
+#ifndef DOXYGEN
 template <class Policy>
 prefix_ unsigned senf::WriteablePolicy::
 write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
@@ -47,7 +56,14 @@ write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
 {
     return do_write(handle,buffer,size);
 }
+#else
+template <class Policy>
+prefix_ unsigned senf::WriteablePolicy::
+write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size)
+{}
+#endif
 
+#ifndef DOXYGEN
 template <class Policy>
 prefix_ unsigned senf::WriteablePolicy::
 writeto(ClientSocketHandle<Policy> handle,
@@ -57,6 +73,14 @@ writeto(ClientSocketHandle<Policy> handle,
 {
     return do_writeto(handle, buffer, size, addr.sockaddr_p(), addr.sockaddr_len());
 }
+#else
+template <class Policy>
+prefix_ unsigned senf::WriteablePolicy::
+writeto(ClientSocketHandle<Policy> handle,
+        typename Policy::AddressingPolicy::Address const & addr,
+        char const * buffer, unsigned size)
+{}
+#endif
 
 ///////////////////////////////cti.e///////////////////////////////////////
 #undef prefix_
index f5f7207..a35b570 100644 (file)
@@ -58,17 +58,23 @@ namespace senf {
                                              \param[in] buffer address of buffer to write data to
                                              \param[in] size size of buffer
                                              \returns number of bytes read */
+#       ifndef DOXYGEN
         template <class Policy>
         static unsigned readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
                                  typename Policy::AddressingPolicy::Address & address,
                                  typename IfCommunicationPolicyIs<
                                      Policy,UnconnectedCommunicationPolicy>::type * = 0);
+#       else
+        template <class Policy>
+        static unsigned readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
+                                 typename Policy::AddressingPolicy::Address & address);
                                         ///< read data from socket returning peer address
                                         /**< \param[in] handle socket handle to read from
                                              \param[in] buffer address of buffer to write data to
                                              \param[in] size size of buffer
                                              \param[out] address peer address
                                              \returns number of bytes read */
+#       endif
 
     private:
         static unsigned do_readfrom(FileHandle handle, char * buffer, unsigned size,
@@ -91,10 +97,15 @@ namespace senf {
      */
     struct WriteablePolicy : public WritePolicyBase
     {
+#       ifndef DOXYGEN
         template <class Policy>
         static unsigned write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
                               typename IfCommunicationPolicyIs<
                                   Policy,ConnectedCommunicationPolicy>::type * = 0);
+#       else
+        template <class Policy>
+        static unsigned write(ClientSocketHandle<Policy> handle, char const * buffer, 
+                              unsigned size);
                                         ///< write data to socket
                                         /**< This member is only enabled if the socket uses
                                              connected communication. Otherwise the communication
@@ -105,6 +116,8 @@ namespace senf {
                                              \param[in] buffer address of buffer to send
                                              \param[in] size number of bytes to write
                                              \returns number of bytes written */
+#       endif
+#       ifndef DOXYGEN
         template <class Policy>
         static unsigned writeto(ClientSocketHandle<Policy> handle,
                                 typename boost::call_traits<
@@ -112,6 +125,11 @@ namespace senf {
                                 char const * buffer, unsigned size,
                                 typename IfCommunicationPolicyIs<
                                     Policy,UnconnectedCommunicationPolicy>::type * = 0);
+#       else
+        template <class Policy>
+        static unsigned writeto(ClientSocketHandle<Policy> handle,
+                                typename Policy::AddressingPolicy::Address const & addr,
+                                char const * buffer, unsigned size);
                                         ///< write data to socket sending to given peer
                                         /**< This member is only enabled if the socket uses
                                              unconnected communication. Otherwise no target may be
@@ -123,6 +141,7 @@ namespace senf {
                                              \param[in] addr peer to send data to
                                              \returns number of bytes written
                                           */
+#       endif
 
     private:
         static unsigned do_write(FileHandle handle, char const * buffer, unsigned size);