prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle()
{}
+#ifndef DOXYGEN
template <class Policy>
template <class OtherPolicy>
prefix_ senf::ClientSocketHandle<Policy>::
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)
this->body().fd(fd);
}
+#ifndef DOXYGEN
template <class Policy>
template <class OtherPolicy>
prefix_ typename senf::SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
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
{}
#endif
+#ifndef DOXYGEN
template <class Policy>
template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange>::type
>::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)
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
///@}
///////////////////////////////////////////////////////////////////////////
\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
#define prefix_ inline
///////////////////////////////cti.p///////////////////////////////////////
+#ifndef DOXYGEN
template <class Policy>
prefix_ void senf::ConnectedCommunicationPolicy::
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,
{
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_
*/
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
\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);
///////////////////////////////////////////////////////////////////////////
// senf::GenericAddressingPolicy<Address>
+#ifndef DOXYGEN
template <class Address>
template <class Policy>
prefix_ void senf::GenericAddressingPolicy<Address>::
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>::
{
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,
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.
\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
#define prefix_ inline
///////////////////////////////cti.p///////////////////////////////////////
+#ifndef DOXYGEN
template <class Policy>
prefix_ unsigned senf::ReadablePolicy::
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,
{
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,
{
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_
\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,
*/
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
\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<
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
\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);