From 1887f8ab06cb1a75212269a30811f19ed380a9b2 Mon Sep 17 00:00:00 2001 From: g0dil <g0dil@wiback.org> Date: Mon, 23 Jul 2007 23:23:33 +0000 Subject: [PATCH] Add more #ifndef DOXYGEN comments to hide boost::enable_if type constructs --- Socket/ClientSocketHandle.cti | 25 +++++++++++++++++++++++++ Socket/ClientSocketHandle.hh | 15 +++++++++++++++ Socket/CommunicationPolicy.cti | 15 +++++++++++++++ Socket/CommunicationPolicy.hh | 13 +++++++++++++ Socket/GenericAddressingPolicy.cti | 16 ++++++++++++++++ Socket/GenericAddressingPolicy.hh | 10 ++++++++++ Socket/ReadWritePolicy.cti | 24 ++++++++++++++++++++++++ Socket/ReadWritePolicy.hh | 19 +++++++++++++++++++ 8 files changed, 137 insertions(+) diff --git a/Socket/ClientSocketHandle.cti b/Socket/ClientSocketHandle.cti index 7f46c6cb0..f584a18e0 100644 --- a/Socket/ClientSocketHandle.cti +++ b/Socket/ClientSocketHandle.cti @@ -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) diff --git a/Socket/ClientSocketHandle.hh b/Socket/ClientSocketHandle.hh index 2e2372a1b..1eff5ce5d 100644 --- a/Socket/ClientSocketHandle.hh +++ b/Socket/ClientSocketHandle.hh @@ -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 diff --git a/Socket/CommunicationPolicy.cti b/Socket/CommunicationPolicy.cti index 92b410bf9..36d5a198c 100644 --- a/Socket/CommunicationPolicy.cti +++ b/Socket/CommunicationPolicy.cti @@ -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_ diff --git a/Socket/CommunicationPolicy.hh b/Socket/CommunicationPolicy.hh index 1f8bb0327..0da99308a 100644 --- a/Socket/CommunicationPolicy.hh +++ b/Socket/CommunicationPolicy.hh @@ -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); diff --git a/Socket/GenericAddressingPolicy.cti b/Socket/GenericAddressingPolicy.cti index 5f7a4a72d..68f31cdc3 100644 --- a/Socket/GenericAddressingPolicy.cti +++ b/Socket/GenericAddressingPolicy.cti @@ -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, diff --git a/Socket/GenericAddressingPolicy.hh b/Socket/GenericAddressingPolicy.hh index 07e67b9d8..b8bcfc346 100644 --- a/Socket/GenericAddressingPolicy.hh +++ b/Socket/GenericAddressingPolicy.hh @@ -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 diff --git a/Socket/ReadWritePolicy.cti b/Socket/ReadWritePolicy.cti index 7bd6ceb44..2c5976c35 100644 --- a/Socket/ReadWritePolicy.cti +++ b/Socket/ReadWritePolicy.cti @@ -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_ diff --git a/Socket/ReadWritePolicy.hh b/Socket/ReadWritePolicy.hh index f5f7207b8..a35b57050 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 <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); -- GitLab