From: g0dil Date: Mon, 23 Jul 2007 23:23:33 +0000 (+0000) Subject: Add more #ifndef DOXYGEN comments to hide boost::enable_if type constructs X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=afa15c46e79de0f407d41fda78b6e8d08700caa8;p=senf.git Add more #ifndef DOXYGEN comments to hide boost::enable_if type constructs git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@344 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/ClientSocketHandle.cti b/Socket/ClientSocketHandle.cti index 7f46c6c..f584a18 100644 --- a/Socket/ClientSocketHandle.cti +++ b/Socket/ClientSocketHandle.cti @@ -102,6 +102,7 @@ template prefix_ senf::ClientSocketHandle::ClientSocketHandle() {} +#ifndef DOXYGEN template template prefix_ senf::ClientSocketHandle:: @@ -109,6 +110,13 @@ ClientSocketHandle(ClientSocketHandle other, typename SocketHandle::template IsCompatible::type *) : SocketHandle(other,true) {} +#else +template +template +prefix_ senf::ClientSocketHandle:: +ClientSocketHandle(ClientSocketHandle other) +{} +#endif template prefix_ senf::ClientSocketHandle::ClientSocketHandle(FileHandle other, bool isChecked) @@ -124,6 +132,7 @@ senf::ClientSocketHandle::ClientSocketHandle(std::auto_ptrbody().fd(fd); } +#ifndef DOXYGEN template template prefix_ typename senf::SocketHandle::template IsCompatible::type const & @@ -132,6 +141,13 @@ senf::ClientSocketHandle::operator=(ClientSocketHandle othe assign(other); return *this; } +#else +template +template +prefix_ OtherPolicy const & +senf::ClientSocketHandle::operator=(ClientSocketHandle other) +{} +#endif //////////////////////////////////////// // reading and writing @@ -163,6 +179,7 @@ read(ForwardWritableRange const & range) {} #endif +#ifndef DOXYGEN template template prefix_ typename boost::range_iterator::type @@ -178,6 +195,14 @@ read(ForwardWritableRange & range, >::value && sizeof(typename boost::range_value::type)==sizeof(char) >::read(*this, range); } +#else +template +template +prefix_ typename boost::range_iterator::type +senf::ClientSocketHandle:: +read(ForwardWritableRange & range) +{} +#endif template prefix_ char * senf::ClientSocketHandle::read(char * start, char * end) diff --git a/Socket/ClientSocketHandle.hh b/Socket/ClientSocketHandle.hh index 2e2372a..1eff5ce 100644 --- a/Socket/ClientSocketHandle.hh +++ b/Socket/ClientSocketHandle.hh @@ -123,13 +123,22 @@ namespace senf { ClientSocketHandle(); // conversion constructors +# ifndef DOXYGEN template ClientSocketHandle(ClientSocketHandle other, typename SocketHandle::template IsCompatible::type * = 0); +# else + ClientSocketHandle(ClientSocketHandle other); +# endif +# ifndef DOXYGEN template typename SocketHandle::template IsCompatible::type const & operator=(ClientSocketHandle other); +# else + template + OtherPolicy const & operator=(ClientSocketHandle other); +# endif ///@} /////////////////////////////////////////////////////////////////////////// @@ -190,14 +199,20 @@ namespace senf { \see \ref read() \n Boost.Range */ # endif +# ifndef DOXYGEN template typename boost::range_iterator::type read (ForwardWritableRange & range, typename boost::disable_if< boost::is_convertible >::type * = 0); +# else + template + typename boost::range_iterator::type + read (ForwardWritableRange & range); ///< Read data into range /**< \see read(ForwardWritableRange const &) \n read() \n Boost.Range */ +# endif template void read (Sequence & container, unsigned limit); ///< Read data into container diff --git a/Socket/CommunicationPolicy.cti b/Socket/CommunicationPolicy.cti index 92b410b..36d5a19 100644 --- a/Socket/CommunicationPolicy.cti +++ b/Socket/CommunicationPolicy.cti @@ -31,6 +31,7 @@ #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// +#ifndef DOXYGEN template prefix_ void senf::ConnectedCommunicationPolicy:: listen(ServerSocketHandle handle, unsigned backlog, @@ -38,7 +39,14 @@ listen(ServerSocketHandle handle, unsigned backlog, { do_listen(handle, backlog); } +#else +template +prefix_ void senf::ConnectedCommunicationPolicy:: +listen(ServerSocketHandle handle, unsigned backlog) +{} +#endif +#ifndef DOXYGEN template prefix_ int senf::ConnectedCommunicationPolicy:: accept(ServerSocketHandle handle, @@ -47,6 +55,13 @@ accept(ServerSocketHandle handle, { return do_accept(handle,address.sockaddr_p(),address.sockaddr_len()); } +#else +template +prefix_ int senf::ConnectedCommunicationPolicy:: +accept(ServerSocketHandle handle, + typename ServerSocketHandle::Address & address) +{} +#endif ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_ diff --git a/Socket/CommunicationPolicy.hh b/Socket/CommunicationPolicy.hh index 1f8bb03..0da9930 100644 --- a/Socket/CommunicationPolicy.hh +++ b/Socket/CommunicationPolicy.hh @@ -51,16 +51,27 @@ namespace senf { */ struct ConnectedCommunicationPolicy : public CommunicationPolicyBase { +# ifndef DOXYGEN template static void listen(ServerSocketHandle handle, unsigned backlog, typename IfAddressingPolicyIsNot::type * = 0); +# else + template + static void listen(ServerSocketHandle 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 static int accept(ServerSocketHandle handle, typename ServerSocketHandle::Address & address, typename IfAddressingPolicyIsNot::type * = 0); +# else + template + static int accept(ServerSocketHandle handle, + typename ServerSocketHandle::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); diff --git a/Socket/GenericAddressingPolicy.cti b/Socket/GenericAddressingPolicy.cti index 5f7a4a7..68f31cd 100644 --- a/Socket/GenericAddressingPolicy.cti +++ b/Socket/GenericAddressingPolicy.cti @@ -34,6 +34,7 @@ /////////////////////////////////////////////////////////////////////////// // senf::GenericAddressingPolicy
+#ifndef DOXYGEN template template prefix_ void senf::GenericAddressingPolicy
:: @@ -43,7 +44,15 @@ peer(SocketHandle handle, Address & addr, addr.clear(); do_peer(handle,addr.sockaddr_p(),addr.sockaddr_len()); } +#else +template +template +prefix_ void senf::GenericAddressingPolicy
:: +peer(SocketHandle handle, Address & addr) +{} +#endif +#ifndef DOXYGEN template template prefix_ void senf::GenericAddressingPolicy
:: @@ -52,6 +61,13 @@ connect(SocketHandle handle, Address const & addr, { do_connect(handle,addr.sockaddr_p(),addr.sockaddr_len()); } +#else +template +template +prefix_ void senf::GenericAddressingPolicy
:: +connect(SocketHandle handle, Address const & addr) +{} +#endif template prefix_ void senf::GenericAddressingPolicy
::local(FileHandle handle, diff --git a/Socket/GenericAddressingPolicy.hh b/Socket/GenericAddressingPolicy.hh index 07e67b9..b8bcfc3 100644 --- a/Socket/GenericAddressingPolicy.hh +++ b/Socket/GenericAddressingPolicy.hh @@ -81,23 +81,32 @@ namespace senf { struct GenericAddressingPolicy : private GenericAddressingPolicy_Base { +# ifndef DOXYGEN template static void peer(SocketHandle handle, Address & addr, typename IfCommunicationPolicyIs::type * = 0); +# else + template + static void peer(SocketHandle 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 static void connect(SocketHandle handle, Address const & addr, typename IfCommunicationPolicyIs::type * = 0); +# else + template + static void connect(SocketHandle 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 diff --git a/Socket/ReadWritePolicy.cti b/Socket/ReadWritePolicy.cti index 7bd6ceb..2c5976c 100644 --- a/Socket/ReadWritePolicy.cti +++ b/Socket/ReadWritePolicy.cti @@ -31,6 +31,7 @@ #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// +#ifndef DOXYGEN template prefix_ unsigned senf::ReadablePolicy:: readfrom(ClientSocketHandle handle, char * buffer, unsigned size, @@ -39,7 +40,15 @@ readfrom(ClientSocketHandle handle, char * buffer, unsigned size, { return do_rcvfrom(handle, buffer, size, address.sockaddr_p(), address.sockaddr_len()); } +#else +template +prefix_ unsigned senf::ReadablePolicy:: +readfrom(ClientSocketHandle handle, char * buffer, unsigned size, + typename Policy::AddressingPolicy::Address & address) +{} +#endif +#ifndef DOXYGEN template prefix_ unsigned senf::WriteablePolicy:: write(ClientSocketHandle handle, char const * buffer, unsigned size, @@ -47,7 +56,14 @@ write(ClientSocketHandle handle, char const * buffer, unsigned size, { return do_write(handle,buffer,size); } +#else +template +prefix_ unsigned senf::WriteablePolicy:: +write(ClientSocketHandle handle, char const * buffer, unsigned size) +{} +#endif +#ifndef DOXYGEN template prefix_ unsigned senf::WriteablePolicy:: writeto(ClientSocketHandle handle, @@ -57,6 +73,14 @@ writeto(ClientSocketHandle handle, { return do_writeto(handle, buffer, size, addr.sockaddr_p(), addr.sockaddr_len()); } +#else +template +prefix_ unsigned senf::WriteablePolicy:: +writeto(ClientSocketHandle handle, + typename Policy::AddressingPolicy::Address const & addr, + char const * buffer, unsigned size) +{} +#endif ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_ diff --git a/Socket/ReadWritePolicy.hh b/Socket/ReadWritePolicy.hh index f5f7207..a35b570 100644 --- a/Socket/ReadWritePolicy.hh +++ b/Socket/ReadWritePolicy.hh @@ -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 static unsigned readfrom(ClientSocketHandle handle, char * buffer, unsigned size, typename Policy::AddressingPolicy::Address & address, typename IfCommunicationPolicyIs< Policy,UnconnectedCommunicationPolicy>::type * = 0); +# else + template + static unsigned readfrom(ClientSocketHandle 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 static unsigned write(ClientSocketHandle handle, char const * buffer, unsigned size, typename IfCommunicationPolicyIs< Policy,ConnectedCommunicationPolicy>::type * = 0); +# else + template + static unsigned write(ClientSocketHandle 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 static unsigned writeto(ClientSocketHandle handle, typename boost::call_traits< @@ -112,6 +125,11 @@ namespace senf { char const * buffer, unsigned size, typename IfCommunicationPolicyIs< Policy,UnconnectedCommunicationPolicy>::type * = 0); +# else + template + static unsigned writeto(ClientSocketHandle 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);