Skip to content
Snippets Groups Projects
Commit 1887f8ab authored by g0dil's avatar g0dil
Browse files

Add more #ifndef DOXYGEN comments to hide boost::enable_if type constructs

parent dfd00463
No related branches found
No related tags found
No related merge requests found
...@@ -102,6 +102,7 @@ template <class Policy> ...@@ -102,6 +102,7 @@ template <class Policy>
prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle() prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle()
{} {}
#ifndef DOXYGEN
template <class Policy> template <class Policy>
template <class OtherPolicy> template <class OtherPolicy>
prefix_ senf::ClientSocketHandle<Policy>:: prefix_ senf::ClientSocketHandle<Policy>::
...@@ -109,6 +110,13 @@ ClientSocketHandle(ClientSocketHandle<OtherPolicy> other, ...@@ -109,6 +110,13 @@ ClientSocketHandle(ClientSocketHandle<OtherPolicy> other,
typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type *) typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type *)
: SocketHandle<Policy>(other,true) : SocketHandle<Policy>(other,true)
{} {}
#else
template <class Policy>
template <class OtherPolicy>
prefix_ senf::ClientSocketHandle<Policy>::
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other)
{}
#endif
template <class Policy> template <class Policy>
prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle(FileHandle other, bool isChecked) prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle(FileHandle other, bool isChecked)
...@@ -124,6 +132,7 @@ senf::ClientSocketHandle<Policy>::ClientSocketHandle(std::auto_ptr<SocketProtoco ...@@ -124,6 +132,7 @@ senf::ClientSocketHandle<Policy>::ClientSocketHandle(std::auto_ptr<SocketProtoco
this->body().fd(fd); this->body().fd(fd);
} }
#ifndef DOXYGEN
template <class Policy> template <class Policy>
template <class OtherPolicy> template <class OtherPolicy>
prefix_ typename senf::SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const & prefix_ typename senf::SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
...@@ -132,6 +141,13 @@ senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> othe ...@@ -132,6 +141,13 @@ senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> othe
assign(other); assign(other);
return *this; return *this;
} }
#else
template <class Policy>
template <class OtherPolicy>
prefix_ OtherPolicy const &
senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> other)
{}
#endif
//////////////////////////////////////// ////////////////////////////////////////
// reading and writing // reading and writing
...@@ -163,6 +179,7 @@ read(ForwardWritableRange const & range) ...@@ -163,6 +179,7 @@ read(ForwardWritableRange const & range)
{} {}
#endif #endif
#ifndef DOXYGEN
template <class Policy> template <class Policy>
template <class ForwardWritableRange> template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange>::type prefix_ typename boost::range_iterator<ForwardWritableRange>::type
...@@ -178,6 +195,14 @@ read(ForwardWritableRange & range, ...@@ -178,6 +195,14 @@ read(ForwardWritableRange & range,
>::value && sizeof(typename boost::range_value<ForwardWritableRange>::type)==sizeof(char) >::value && sizeof(typename boost::range_value<ForwardWritableRange>::type)==sizeof(char)
>::read(*this, range); >::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> template <class Policy>
prefix_ char * senf::ClientSocketHandle<Policy>::read(char * start, char * end) prefix_ char * senf::ClientSocketHandle<Policy>::read(char * start, char * end)
......
...@@ -123,13 +123,22 @@ namespace senf { ...@@ -123,13 +123,22 @@ namespace senf {
ClientSocketHandle(); ClientSocketHandle();
// conversion constructors // conversion constructors
# ifndef DOXYGEN
template <class OtherPolicy> template <class OtherPolicy>
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other, ClientSocketHandle(ClientSocketHandle<OtherPolicy> other,
typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type * = 0); typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type * = 0);
# else
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other);
# endif
# ifndef DOXYGEN
template <class OtherPolicy> template <class OtherPolicy>
typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const & typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
operator=(ClientSocketHandle<OtherPolicy> other); operator=(ClientSocketHandle<OtherPolicy> other);
# else
template <class OtherPolicy>
OtherPolicy const & operator=(ClientSocketHandle<OtherPolicy> other);
# endif
///@} ///@}
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
...@@ -190,14 +199,20 @@ namespace senf { ...@@ -190,14 +199,20 @@ namespace senf {
\see \ref read() \n \see \ref read() \n
<a href="http://www.boost.org/libs/range/index.html">Boost.Range</a> */ <a href="http://www.boost.org/libs/range/index.html">Boost.Range</a> */
# endif # endif
# ifndef DOXYGEN
template <class ForwardWritableRange> template <class ForwardWritableRange>
typename boost::range_iterator<ForwardWritableRange>::type typename boost::range_iterator<ForwardWritableRange>::type
read (ForwardWritableRange & range, read (ForwardWritableRange & range,
typename boost::disable_if< boost::is_convertible<ForwardWritableRange,unsigned> >::type * = 0); 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 ///< Read data into range
/**< \see read(ForwardWritableRange const &) \n /**< \see read(ForwardWritableRange const &) \n
read() \n read() \n
<a href="http://www.boost.org/libs/range/index.html">Boost.Range</a> */ <a href="http://www.boost.org/libs/range/index.html">Boost.Range</a> */
# endif
template <class Sequence> template <class Sequence>
void read (Sequence & container, unsigned limit); void read (Sequence & container, unsigned limit);
///< Read data into container ///< Read data into container
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define prefix_ inline #define prefix_ inline
///////////////////////////////cti.p/////////////////////////////////////// ///////////////////////////////cti.p///////////////////////////////////////
#ifndef DOXYGEN
template <class Policy> template <class Policy>
prefix_ void senf::ConnectedCommunicationPolicy:: prefix_ void senf::ConnectedCommunicationPolicy::
listen(ServerSocketHandle<Policy> handle, unsigned backlog, listen(ServerSocketHandle<Policy> handle, unsigned backlog,
...@@ -38,7 +39,14 @@ listen(ServerSocketHandle<Policy> handle, unsigned backlog, ...@@ -38,7 +39,14 @@ listen(ServerSocketHandle<Policy> handle, unsigned backlog,
{ {
do_listen(handle, 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> template <class Policy>
prefix_ int senf::ConnectedCommunicationPolicy:: prefix_ int senf::ConnectedCommunicationPolicy::
accept(ServerSocketHandle<Policy> handle, accept(ServerSocketHandle<Policy> handle,
...@@ -47,6 +55,13 @@ accept(ServerSocketHandle<Policy> handle, ...@@ -47,6 +55,13 @@ accept(ServerSocketHandle<Policy> handle,
{ {
return do_accept(handle,address.sockaddr_p(),address.sockaddr_len()); 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/////////////////////////////////////// ///////////////////////////////cti.e///////////////////////////////////////
#undef prefix_ #undef prefix_
......
...@@ -51,16 +51,27 @@ namespace senf { ...@@ -51,16 +51,27 @@ namespace senf {
*/ */
struct ConnectedCommunicationPolicy : public CommunicationPolicyBase struct ConnectedCommunicationPolicy : public CommunicationPolicyBase
{ {
# ifndef DOXYGEN
template <class Policy> template <class Policy>
static void listen(ServerSocketHandle<Policy> handle, unsigned backlog, static void listen(ServerSocketHandle<Policy> handle, unsigned backlog,
typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type * = 0); 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 ///< Enable establishing new connections on the socket
/**< \param[in] handle socket handle to enable reception on /**< \param[in] handle socket handle to enable reception on
\param[in] backlog size of backlog queue */ \param[in] backlog size of backlog queue */
# endif
# ifndef DOXYGEN
template <class Policy> template <class Policy>
static int accept(ServerSocketHandle<Policy> handle, static int accept(ServerSocketHandle<Policy> handle,
typename ServerSocketHandle<Policy>::Address & address, typename ServerSocketHandle<Policy>::Address & address,
typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type * = 0); 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. ///< accept a new connection on the socket.
/**< The accept() member will return a new client file /**< The accept() member will return a new client file
descriptor. This file descriptor will be used by the descriptor. This file descriptor will be used by the
...@@ -71,6 +82,8 @@ namespace senf { ...@@ -71,6 +82,8 @@ namespace senf {
\param[out] address address of newly connected remote \param[out] address address of newly connected remote
peer peer
\returns file descriptor of new client socket */ \returns file descriptor of new client socket */
# endif
private: private:
static void do_listen(FileHandle handle, unsigned backlog); static void do_listen(FileHandle handle, unsigned backlog);
static int do_accept(FileHandle handle, struct sockaddr * addr, unsigned len); static int do_accept(FileHandle handle, struct sockaddr * addr, unsigned len);
......
...@@ -34,6 +34,7 @@ ...@@ -34,6 +34,7 @@
/////////////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////////////
// senf::GenericAddressingPolicy<Address> // senf::GenericAddressingPolicy<Address>
#ifndef DOXYGEN
template <class Address> template <class Address>
template <class Policy> template <class Policy>
prefix_ void senf::GenericAddressingPolicy<Address>:: prefix_ void senf::GenericAddressingPolicy<Address>::
...@@ -43,7 +44,15 @@ peer(SocketHandle<Policy> handle, Address & addr, ...@@ -43,7 +44,15 @@ peer(SocketHandle<Policy> handle, Address & addr,
addr.clear(); addr.clear();
do_peer(handle,addr.sockaddr_p(),addr.sockaddr_len()); 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 Address>
template <class Policy> template <class Policy>
prefix_ void senf::GenericAddressingPolicy<Address>:: prefix_ void senf::GenericAddressingPolicy<Address>::
...@@ -52,6 +61,13 @@ connect(SocketHandle<Policy> handle, Address const & addr, ...@@ -52,6 +61,13 @@ connect(SocketHandle<Policy> handle, Address const & addr,
{ {
do_connect(handle,addr.sockaddr_p(),addr.sockaddr_len()); 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> template <class Address>
prefix_ void senf::GenericAddressingPolicy<Address>::local(FileHandle handle, prefix_ void senf::GenericAddressingPolicy<Address>::local(FileHandle handle,
......
...@@ -81,23 +81,32 @@ namespace senf { ...@@ -81,23 +81,32 @@ namespace senf {
struct GenericAddressingPolicy struct GenericAddressingPolicy
: private GenericAddressingPolicy_Base : private GenericAddressingPolicy_Base
{ {
# ifndef DOXYGEN
template <class Policy> template <class Policy>
static void peer(SocketHandle<Policy> handle, Address & addr, static void peer(SocketHandle<Policy> handle, Address & addr,
typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type * = 0); 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 ///< Return address of remote peer on connected sockets
/**< This member is only available if the socket handles /**< This member is only available if the socket handles
communication policy is ConnectedCommunicationPolicy. communication policy is ConnectedCommunicationPolicy.
\param[in] handle socket handle to get peer address of \param[in] handle socket handle to get peer address of
\param[out] addr address of remote peer */ \param[out] addr address of remote peer */
# endif
static void local(FileHandle handle, Address & addr); static void local(FileHandle handle, Address & addr);
///< Return local of socket ///< Return local of socket
/**< \param[in] handle socket handle to check /**< \param[in] handle socket handle to check
\param[out] addr local socket address */ \param[out] addr local socket address */
# ifndef DOXYGEN
template <class Policy> template <class Policy>
static void connect(SocketHandle<Policy> handle, Address const & addr, static void connect(SocketHandle<Policy> handle, Address const & addr,
typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type * = 0); typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type * = 0);
# else
template <class Policy>
static void connect(SocketHandle<Policy> handle, Address const & addr);
///< Connect to remote host ///< Connect to remote host
/**< This member is only available if the socket handles /**< This member is only available if the socket handles
communication policy is ConnectedCommunicationPolicy. communication policy is ConnectedCommunicationPolicy.
...@@ -105,6 +114,7 @@ namespace senf { ...@@ -105,6 +114,7 @@ namespace senf {
\param[in] handle socket handle \param[in] handle socket handle
\param[in] addr address of remote peer to connect \param[in] addr address of remote peer to connect
to */ to */
# endif
static void bind(FileHandle handle, Address const & addr); static void bind(FileHandle handle, Address const & addr);
///< Set local socket address ///< Set local socket address
/**< \param[in] handle socket handle /**< \param[in] handle socket handle
......
...@@ -31,6 +31,7 @@ ...@@ -31,6 +31,7 @@
#define prefix_ inline #define prefix_ inline
///////////////////////////////cti.p/////////////////////////////////////// ///////////////////////////////cti.p///////////////////////////////////////
#ifndef DOXYGEN
template <class Policy> template <class Policy>
prefix_ unsigned senf::ReadablePolicy:: prefix_ unsigned senf::ReadablePolicy::
readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size, readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
...@@ -39,7 +40,15 @@ 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()); 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> template <class Policy>
prefix_ unsigned senf::WriteablePolicy:: prefix_ unsigned senf::WriteablePolicy::
write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size, write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
...@@ -47,7 +56,14 @@ 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); 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> template <class Policy>
prefix_ unsigned senf::WriteablePolicy:: prefix_ unsigned senf::WriteablePolicy::
writeto(ClientSocketHandle<Policy> handle, writeto(ClientSocketHandle<Policy> handle,
...@@ -57,6 +73,14 @@ writeto(ClientSocketHandle<Policy> handle, ...@@ -57,6 +73,14 @@ writeto(ClientSocketHandle<Policy> handle,
{ {
return do_writeto(handle, buffer, size, addr.sockaddr_p(), addr.sockaddr_len()); 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/////////////////////////////////////// ///////////////////////////////cti.e///////////////////////////////////////
#undef prefix_ #undef prefix_
......
...@@ -58,17 +58,23 @@ namespace senf { ...@@ -58,17 +58,23 @@ namespace senf {
\param[in] buffer address of buffer to write data to \param[in] buffer address of buffer to write data to
\param[in] size size of buffer \param[in] size size of buffer
\returns number of bytes read */ \returns number of bytes read */
# ifndef DOXYGEN
template <class Policy> template <class Policy>
static unsigned readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size, static unsigned readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
typename Policy::AddressingPolicy::Address & address, typename Policy::AddressingPolicy::Address & address,
typename IfCommunicationPolicyIs< typename IfCommunicationPolicyIs<
Policy,UnconnectedCommunicationPolicy>::type * = 0); 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 ///< read data from socket returning peer address
/**< \param[in] handle socket handle to read from /**< \param[in] handle socket handle to read from
\param[in] buffer address of buffer to write data to \param[in] buffer address of buffer to write data to
\param[in] size size of buffer \param[in] size size of buffer
\param[out] address peer address \param[out] address peer address
\returns number of bytes read */ \returns number of bytes read */
# endif
private: private:
static unsigned do_readfrom(FileHandle handle, char * buffer, unsigned size, static unsigned do_readfrom(FileHandle handle, char * buffer, unsigned size,
...@@ -91,10 +97,15 @@ namespace senf { ...@@ -91,10 +97,15 @@ namespace senf {
*/ */
struct WriteablePolicy : public WritePolicyBase struct WriteablePolicy : public WritePolicyBase
{ {
# ifndef DOXYGEN
template <class Policy> template <class Policy>
static unsigned write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size, static unsigned write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
typename IfCommunicationPolicyIs< typename IfCommunicationPolicyIs<
Policy,ConnectedCommunicationPolicy>::type * = 0); Policy,ConnectedCommunicationPolicy>::type * = 0);
# else
template <class Policy>
static unsigned write(ClientSocketHandle<Policy> handle, char const * buffer,
unsigned size);
///< write data to socket ///< write data to socket
/**< This member is only enabled if the socket uses /**< This member is only enabled if the socket uses
connected communication. Otherwise the communication connected communication. Otherwise the communication
...@@ -105,6 +116,8 @@ namespace senf { ...@@ -105,6 +116,8 @@ namespace senf {
\param[in] buffer address of buffer to send \param[in] buffer address of buffer to send
\param[in] size number of bytes to write \param[in] size number of bytes to write
\returns number of bytes written */ \returns number of bytes written */
# endif
# ifndef DOXYGEN
template <class Policy> template <class Policy>
static unsigned writeto(ClientSocketHandle<Policy> handle, static unsigned writeto(ClientSocketHandle<Policy> handle,
typename boost::call_traits< typename boost::call_traits<
...@@ -112,6 +125,11 @@ namespace senf { ...@@ -112,6 +125,11 @@ namespace senf {
char const * buffer, unsigned size, char const * buffer, unsigned size,
typename IfCommunicationPolicyIs< typename IfCommunicationPolicyIs<
Policy,UnconnectedCommunicationPolicy>::type * = 0); 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 ///< write data to socket sending to given peer
/**< This member is only enabled if the socket uses /**< This member is only enabled if the socket uses
unconnected communication. Otherwise no target may be unconnected communication. Otherwise no target may be
...@@ -123,6 +141,7 @@ namespace senf { ...@@ -123,6 +141,7 @@ namespace senf {
\param[in] addr peer to send data to \param[in] addr peer to send data to
\returns number of bytes written \returns number of bytes written
*/ */
# endif
private: private:
static unsigned do_write(FileHandle handle, char const * buffer, unsigned size); static unsigned do_write(FileHandle handle, char const * buffer, unsigned size);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment