// senf::ClientSocketHandle<Policy>::read
-template <class Policy>
-prefix_ std::string senf::ClientSocketHandle<Policy>::read(unsigned limit)
+template <class SPolicy>
+prefix_ std::string senf::ClientSocketHandle<SPolicy>::read(unsigned limit)
{
std::string rv;
this->read(rv,limit);
return rv;
}
-template <class Policy>
+template <class SPolicy>
template <class Sequence>
-prefix_ void senf::ClientSocketHandle<Policy>::read(Sequence & container, unsigned limit)
+prefix_ void senf::ClientSocketHandle<SPolicy>::read(Sequence & container, unsigned limit)
{
unsigned nread (available());
if (limit>0 && nread>limit)
container.end());
}
-// senf::ClientSocketHandle<Policy>::readfrom
+// senf::ClientSocketHandle<SPolicy>::readfrom
-template <class Policy>
-prefix_ std::pair<std::string, typename Policy::AddressingPolicy::Address>
-senf::ClientSocketHandle<Policy>::readfrom(unsigned limit)
+template <class SPolicy>
+prefix_ std::pair<std::string, typename SPolicy::AddressingPolicy::Address>
+senf::ClientSocketHandle<SPolicy>::readfrom(unsigned limit)
{
std::string rv;
- typename Policy::AddressingPolicy::Address addr;
+ typename SPolicy::AddressingPolicy::Address addr;
this->readfrom(rv,addr,limit);
return std::make_pair(rv,addr);
}
-template <class Policy>
+template <class SPolicy>
template <class Sequence>
-prefix_ void senf::ClientSocketHandle<Policy>::readfrom(Sequence & container, Address & from,
+prefix_ void senf::ClientSocketHandle<SPolicy>::readfrom(Sequence & container, Address & from,
unsigned limit)
{
unsigned nread (available());
////////////////////////////////////////
// private members
-// senf::ClientSocketHandle<Policy>::available
+// senf::ClientSocketHandle<SPolicy>::available
-template <class Policy>
-prefix_ unsigned senf::ClientSocketHandle<Policy>::available()
+template <class SPolicy>
+prefix_ unsigned senf::ClientSocketHandle<SPolicy>::available()
{
unsigned nread = this->protocol().available();
if (nread == 0 && this->blocking()) {
////////////////////////////////////////
// structors
-template <class Policy>
-prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle()
+template <class SPolicy>
+prefix_ senf::ClientSocketHandle<SPolicy>::ClientSocketHandle()
{}
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
template <class OtherPolicy>
-prefix_ senf::ClientSocketHandle<Policy>::
+prefix_ senf::ClientSocketHandle<SPolicy>::
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other,
- typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type *)
- : SocketHandle<Policy>(other,true)
+ typename SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type *)
+ : SocketHandle<SPolicy>(other,true)
{}
#else
-template <class Policy>
+template <class SPolicy>
template <class OtherPolicy>
-prefix_ senf::ClientSocketHandle<Policy>::
+prefix_ senf::ClientSocketHandle<SPolicy>::
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other)
{}
#endif
-template <class Policy>
-prefix_ senf::ClientSocketHandle<Policy>::ClientSocketHandle(FileHandle other, bool isChecked)
- : SocketHandle<Policy>(other, isChecked)
+template <class SPolicy>
+prefix_ senf::ClientSocketHandle<SPolicy>::ClientSocketHandle(FileHandle other, bool isChecked)
+ : SocketHandle<SPolicy>(other, isChecked)
{}
-template <class Policy>
+template <class SPolicy>
prefix_
-senf::ClientSocketHandle<Policy>::ClientSocketHandle(std::auto_ptr<SocketBody> body)
- : SocketHandle<Policy>(body)
+senf::ClientSocketHandle<SPolicy>::ClientSocketHandle(std::auto_ptr<SocketBody> body)
+ : SocketHandle<SPolicy>(body)
{}
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
template <class OtherPolicy>
-prefix_ typename senf::SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
-senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> other)
+prefix_ typename senf::SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type const &
+senf::ClientSocketHandle<SPolicy>::operator=(ClientSocketHandle<OtherPolicy> other)
{
assign(other);
return *this;
}
#else
-template <class Policy>
+template <class SPolicy>
template <class OtherPolicy>
prefix_ OtherPolicy const &
-senf::ClientSocketHandle<Policy>::operator=(ClientSocketHandle<OtherPolicy> other)
+senf::ClientSocketHandle<SPolicy>::operator=(ClientSocketHandle<OtherPolicy> other)
{}
#endif
////////////////////////////////////////
// reading and writing
-// senf::ClientSocketHandle<Policy>::read
+// senf::ClientSocketHandle<SPolicy>::read
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange>::type
-senf::ClientSocketHandle<Policy>::
+senf::ClientSocketHandle<SPolicy>::
read(ForwardWritableRange const & range,
typename boost::disable_if< boost::is_convertible<ForwardWritableRange,unsigned> >::type *)
{
return detail::ReadRange<
- ClientSocketHandle<Policy>,
+ ClientSocketHandle<SPolicy>,
ForwardWritableRange const,
contiguous_storage_iterator<
typename boost::range_iterator<ForwardWritableRange>::type
>::read(*this, range);
}
#else
-template <class Policy>
+template <class SPolicy>
template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange>::type
-senf::ClientSocketHandle<Policy>::
+senf::ClientSocketHandle<SPolicy>::
read(ForwardWritableRange const & range)
{}
#endif
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange>::type
-senf::ClientSocketHandle<Policy>::
+senf::ClientSocketHandle<SPolicy>::
read(ForwardWritableRange & range,
typename boost::disable_if< boost::is_convertible<ForwardWritableRange,unsigned> >::type *)
{
return detail::ReadRange<
- ClientSocketHandle<Policy>,
+ ClientSocketHandle<SPolicy>,
ForwardWritableRange,
contiguous_storage_iterator<
typename boost::range_iterator<ForwardWritableRange>::type
>::read(*this, range);
}
#else
-template <class Policy>
+template <class SPolicy>
template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange>::type
-senf::ClientSocketHandle<Policy>::
+senf::ClientSocketHandle<SPolicy>::
read(ForwardWritableRange & range)
{}
#endif
-template <class Policy>
-prefix_ char * senf::ClientSocketHandle<Policy>::read(char * start, char * end)
+template <class SPolicy>
+prefix_ char * senf::ClientSocketHandle<SPolicy>::read(char * start, char * end)
{
- return start + Policy::ReadPolicy::read(*this, start, end-start);
+ return start + SPolicy::ReadPolicy::read(*this, start, end-start);
}
-// senf::ClientSocketHandle<Policy>::readfrom
+// senf::ClientSocketHandle<SPolicy>::readfrom
-template <class Policy>
+template <class SPolicy>
template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange const>::type
-senf::ClientSocketHandle<Policy>::readfrom(ForwardWritableRange const & range, Address & from)
+senf::ClientSocketHandle<SPolicy>::readfrom(ForwardWritableRange const & range, Address & from)
{
return detail::ReadRange<
- ClientSocketHandle<Policy>,
+ ClientSocketHandle<SPolicy>,
ForwardWritableRange const,
contiguous_storage_iterator<
typename boost::range_iterator<ForwardWritableRange>::type
>::readfrom(*this, range, from);
}
-template <class Policy>
+template <class SPolicy>
template <class ForwardWritableRange>
prefix_ typename boost::range_iterator<ForwardWritableRange>::type
-senf::ClientSocketHandle<Policy>::readfrom(ForwardWritableRange & range, Address & from)
+senf::ClientSocketHandle<SPolicy>::readfrom(ForwardWritableRange & range, Address & from)
{
return detail::ReadRange<
- ClientSocketHandle<Policy>,
+ ClientSocketHandle<SPolicy>,
ForwardWritableRange,
contiguous_storage_iterator<
typename boost::range_iterator<ForwardWritableRange>::type
>::readfrom(*this, range, from);
}
-template <class Policy>
-prefix_ char * senf::ClientSocketHandle<Policy>::readfrom(char * start, char * end,
+template <class SPolicy>
+prefix_ char * senf::ClientSocketHandle<SPolicy>::readfrom(char * start, char * end,
Address & from)
{
- return start + Policy::ReadPolicy::readfrom(*this, start, end-start, from);
+ return start + SPolicy::ReadPolicy::readfrom(*this, start, end-start, from);
}
-// senf::ClientSocketHandle<Policy>::write
+// senf::ClientSocketHandle<SPolicy>::write
-template <class Policy>
+template <class SPolicy>
template <class ForwardReadableRange>
prefix_ typename boost::range_const_iterator<ForwardReadableRange const>::type
-senf::ClientSocketHandle<Policy>::write(ForwardReadableRange const & range)
+senf::ClientSocketHandle<SPolicy>::write(ForwardReadableRange const & range)
{
return detail::WriteRange<
- ClientSocketHandle<Policy>,
+ ClientSocketHandle<SPolicy>,
ForwardReadableRange const,
contiguous_storage_iterator<
typename boost::range_iterator<ForwardReadableRange>::type
>::write(*this, range);
}
-template <class Policy>
-prefix_ char const * senf::ClientSocketHandle<Policy>::write(char const * start, char const * end)
+template <class SPolicy>
+prefix_ char const * senf::ClientSocketHandle<SPolicy>::write(char const * start, char const * end)
{
- return start + Policy::WritePolicy::write(*this, start, end-start);
+ return start + SPolicy::WritePolicy::write(*this, start, end-start);
}
-// senf::ClientSocketHandle<Policy>::writeto
+// senf::ClientSocketHandle<SPolicy>::writeto
-template <class Policy>
+template <class SPolicy>
template <class ForwardReadableRange>
prefix_ typename boost::range_const_iterator<ForwardReadableRange const>::type
-senf::ClientSocketHandle<Policy>::writeto(AddressParam addr, ForwardReadableRange const & range)
+senf::ClientSocketHandle<SPolicy>::writeto(AddressParam addr, ForwardReadableRange const & range)
{
return detail::WriteRange<
- ClientSocketHandle<Policy>,
+ ClientSocketHandle<SPolicy>,
ForwardReadableRange const,
contiguous_storage_iterator<
typename boost::range_iterator<ForwardReadableRange>::type
>::writeto(*this, range, addr);
}
-template <class Policy>
-prefix_ char const * senf::ClientSocketHandle<Policy>::writeto(AddressParam addr,
+template <class SPolicy>
+prefix_ char const * senf::ClientSocketHandle<SPolicy>::writeto(AddressParam addr,
char const * start,
char const * end)
{
- return start + Policy::WritePolicy::writeto(*this, addr, start, end-start);
+ return start + SPolicy::WritePolicy::writeto(*this, addr, start, end-start);
}
////////////////////////////////////////
// addressing
-// senf::ClientSocketHandle<Policy>::peer
+// senf::ClientSocketHandle<SPolicy>::peer
-template <class Policy>
-prefix_ typename Policy::AddressingPolicy::Address
-senf::ClientSocketHandle<Policy>::peer()
+template <class SPolicy>
+prefix_ typename SPolicy::AddressingPolicy::Address
+senf::ClientSocketHandle<SPolicy>::peer()
{
- typename Policy::AddressingPolicy::Address addr;
+ typename SPolicy::AddressingPolicy::Address addr;
this->peer(addr);
return addr;
}
-template <class Policy>
-prefix_ void senf::ClientSocketHandle<Policy>::
-peer(typename Policy::AddressingPolicy::Address & addr)
+template <class SPolicy>
+prefix_ void senf::ClientSocketHandle<SPolicy>::
+peer(typename SPolicy::AddressingPolicy::Address & addr)
{
- Policy::AddressingPolicy::peer(*this,addr);
+ SPolicy::AddressingPolicy::peer(*this,addr);
}
-// senf::ClientSocketHandle<Policy>::local
+// senf::ClientSocketHandle<SPolicy>::local
-template <class Policy>
-prefix_ typename Policy::AddressingPolicy::Address
-senf::ClientSocketHandle<Policy>::local()
+template <class SPolicy>
+prefix_ typename SPolicy::AddressingPolicy::Address
+senf::ClientSocketHandle<SPolicy>::local()
{
- typename Policy::AddressingPolicy::Address addr;
+ typename SPolicy::AddressingPolicy::Address addr;
this->local(addr);
return addr;
}
-template <class Policy>
-prefix_ void senf::ClientSocketHandle<Policy>::
-local(typename Policy::AddressingPolicy::Address & addr)
+template <class SPolicy>
+prefix_ void senf::ClientSocketHandle<SPolicy>::
+local(typename SPolicy::AddressingPolicy::Address & addr)
{
- Policy::AddressingPolicy::local(*this,addr);
+ SPolicy::AddressingPolicy::local(*this,addr);
}
-// senf::ClientSocketHandle<Policy>::connect
+// senf::ClientSocketHandle<SPolicy>::connect
-template <class Policy>
-prefix_ void senf::ClientSocketHandle<Policy>::connect(AddressParam addr)
+template <class SPolicy>
+prefix_ void senf::ClientSocketHandle<SPolicy>::connect(AddressParam addr)
{
- Policy::AddressingPolicy::connect(*this,addr);
+ SPolicy::AddressingPolicy::connect(*this,addr);
}
-// senf::ClientSocketHandle<Policy>::bind
+// senf::ClientSocketHandle<SPolicy>::bind
-template <class Policy>
-prefix_ void senf::ClientSocketHandle<Policy>::
-bind(typename boost::call_traits<typename Policy::AddressingPolicy::Address>::param_type addr)
+template <class SPolicy>
+prefix_ void senf::ClientSocketHandle<SPolicy>::
+bind(typename boost::call_traits<typename SPolicy::AddressingPolicy::Address>::param_type addr)
{
- Policy::AddressingPolicy::bind(*this,addr);
+ SPolicy::AddressingPolicy::bind(*this,addr);
}
////////////////////////////////////////
// Casting
-template <class Policy>
-prefix_ senf::ClientSocketHandle<Policy>
-senf::ClientSocketHandle<Policy>::cast_static(FileHandle handle)
+template <class SPolicy>
+prefix_ senf::ClientSocketHandle<SPolicy>
+senf::ClientSocketHandle<SPolicy>::cast_static(FileHandle handle)
{
return ClientSocketHandle(handle, true);
}
-template <class Policy>
-prefix_ senf::ClientSocketHandle<Policy>
-senf::ClientSocketHandle<Policy>::cast_dynamic(FileHandle handle)
+template <class SPolicy>
+prefix_ senf::ClientSocketHandle<SPolicy>
+senf::ClientSocketHandle<SPolicy>::cast_dynamic(FileHandle handle)
{
- SocketHandle<Policy> h (SocketHandle<Policy>::cast_dynamic(handle));
+ SocketHandle<SPolicy> h (SocketHandle<SPolicy>::cast_dynamic(handle));
if (static_cast<SocketBody&>(FileHandle::body(h)).isServer())
throw std::bad_cast();
return cast_static(handle);
////////////////////////////////////////
// State information
-template <class Policy>
-prefix_ void senf::ClientSocketHandle<Policy>::state(SocketStateMap & map, unsigned lod)
+template <class SPolicy>
+prefix_ void senf::ClientSocketHandle<SPolicy>::state(SocketStateMap & map, unsigned lod)
{
map["handle"] = prettyName(typeid(*this));
this->body().state(map,lod);
}
-template <class Policy>
-prefix_ std::string senf::ClientSocketHandle<Policy>::dumpState(unsigned lod)
+template <class SPolicy>
+prefix_ std::string senf::ClientSocketHandle<SPolicy>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
/// \addtogroup handle_group
/// @{
- template <class Policy> class ServerSocketHandle;
+ template <class SPolicy> class ServerSocketHandle;
/** \brief Generic SocketHandle with client interface
\see \ref policy_group \n
\ref protocol_group
*/
- template <class Policy>
+ template <class SPolicy>
class ClientSocketHandle
- : public SocketHandle<Policy>
+ : public SocketHandle<SPolicy>
{
public:
///////////////////////////////////////////////////////////////////////////
// Types
/// Address type from the addressing policy
- typedef typename Policy::AddressingPolicy::Address Address;
+ typedef typename SPolicy::AddressingPolicy::Address Address;
/// 'Best' type for passing address as parameter
/** Depending on the type of \c Address, this will be either <tt>Address</tt> or <tt>Address
const &</tt>. See <a
/** This class will probably only be usable, if the \c CommunicationPolicy is \c
ConnectedCommunicationPolicy and the \c AddressingPolicy is not \c
NoAddressingPolicy. */
- typedef ServerSocketHandle<Policy> ServerSocketHandle;
+ typedef ServerSocketHandle<SPolicy> ServerSocketHandle;
///////////////////////////////////////////////////////////////////////////
///\name Structors and default members
# ifndef DOXYGEN
template <class OtherPolicy>
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other,
- typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type * = 0);
+ typename SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type * = 0);
# else
ClientSocketHandle(ClientSocketHandle<OtherPolicy> other);
# endif
# ifndef DOXYGEN
template <class OtherPolicy>
- typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
+ typename SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type const &
operator=(ClientSocketHandle<OtherPolicy> other);
# else
template <class OtherPolicy>
- OtherPolicy const & operator=(ClientSocketHandle<OtherPolicy> other);
+ ClientSocketHandle<OtherPolicy> const & operator=(ClientSocketHandle<OtherPolicy> other);
# endif
///@}
private:
unsigned available();
- friend class senf::ServerSocketHandle<Policy>;
+ friend class senf::ServerSocketHandle<SPolicy>;
};
/// @}
///////////////////////////////cti.p///////////////////////////////////////
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
prefix_ void senf::ConnectedCommunicationPolicy::
-listen(ServerSocketHandle<Policy> handle, unsigned backlog,
- typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type *)
+listen(ServerSocketHandle<SPolicy> handle, unsigned backlog,
+ typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type *)
{
do_listen(handle, backlog);
}
#else
-template <class Policy>
+template <class SPolicy>
prefix_ void senf::ConnectedCommunicationPolicy::
-listen(ServerSocketHandle<Policy> handle, unsigned backlog)
+listen(ServerSocketHandle<SPolicy> handle, unsigned backlog)
{}
#endif
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
prefix_ int senf::ConnectedCommunicationPolicy::
-accept(ServerSocketHandle<Policy> handle,
- typename ServerSocketHandle<Policy>::Address & address,
- typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type *)
+accept(ServerSocketHandle<SPolicy> handle,
+ typename ServerSocketHandle<SPolicy>::Address & address,
+ typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type *)
{
return do_accept(handle,address.sockaddr_p(),address.sockaddr_len());
}
#else
-template <class Policy>
+template <class SPolicy>
prefix_ int senf::ConnectedCommunicationPolicy::
-accept(ServerSocketHandle<Policy> handle,
- typename ServerSocketHandle<Policy>::Address & address)
+accept(ServerSocketHandle<SPolicy> handle,
+ typename ServerSocketHandle<SPolicy>::Address & address)
{}
#endif
/// \addtogroup policy_impl_group
/// @{
- template <class Policy> class ServerSocketHandle;
+ template <class SPolicy> class ServerSocketHandle;
/** \brief CommunicationPolicy for connected sockets
struct ConnectedCommunicationPolicy : public CommunicationPolicyBase
{
# ifndef DOXYGEN
- template <class Policy>
- static void listen(ServerSocketHandle<Policy> handle, unsigned backlog,
- typename IfAddressingPolicyIsNot<Policy,NoAddressingPolicy>::type * = 0);
+ template <class SPolicy>
+ static void listen(ServerSocketHandle<SPolicy> handle, unsigned backlog,
+ typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type * = 0);
# else
- template <class Policy>
- static void listen(ServerSocketHandle<Policy> handle, unsigned backlog);
+ template <class SPolicy>
+ static void listen(ServerSocketHandle<SPolicy> 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);
+ template <class SPolicy>
+ static int accept(ServerSocketHandle<SPolicy> handle,
+ typename ServerSocketHandle<SPolicy>::Address & address,
+ typename IfAddressingPolicyIsNot<SPolicy,NoAddressingPolicy>::type * = 0);
# else
- template <class Policy>
- static int accept(ServerSocketHandle<Policy> handle,
- typename ServerSocketHandle<Policy>::Address & address);
+ template <class SPolicy>
+ static int accept(ServerSocketHandle<SPolicy> handle,
+ typename ServerSocketHandle<SPolicy>::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
#ifndef DOXYGEN
template <class Address>
-template <class Policy>
+template <class SPolicy>
prefix_ void senf::GenericAddressingPolicy<Address>::
-peer(SocketHandle<Policy> handle, Address & addr,
- typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type *)
+peer(SocketHandle<SPolicy> handle, Address & addr,
+ typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
{
addr.clear();
do_peer(handle,addr.sockaddr_p(),addr.sockaddr_len());
}
#else
template <class Address>
-template <class Policy>
+template <class SPolicy>
prefix_ void senf::GenericAddressingPolicy<Address>::
-peer(SocketHandle<Policy> handle, Address & addr)
+peer(SocketHandle<SPolicy> handle, Address & addr)
{}
#endif
#ifndef DOXYGEN
template <class Address>
-template <class Policy>
+template <class SPolicy>
prefix_ void senf::GenericAddressingPolicy<Address>::
-connect(SocketHandle<Policy> handle, Address const & addr,
- typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type *)
+connect(SocketHandle<SPolicy> handle, Address const & addr,
+ typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
{
do_connect(handle,addr.sockaddr_p(),addr.sockaddr_len());
}
#else
template <class Address>
-template <class Policy>
+template <class SPolicy>
prefix_ void senf::GenericAddressingPolicy<Address>::
-connect(SocketHandle<Policy> handle, Address const & addr)
+connect(SocketHandle<SPolicy> handle, Address const & addr)
{}
#endif
template <class Address>
prefix_ void senf::GenericAddressingPolicy<Address>::local(FileHandle handle,
- Address & addr)
+ Address & addr)
{
addr.clear();
do_local(handle,addr.sockaddr_p(),addr.sockaddr_len());
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
-// compile-command: "scons -u test"
+// compile-command: "scons -u ../test"
// comment-column: 40
// End:
: private GenericAddressingPolicy_Base
{
# ifndef DOXYGEN
- template <class Policy>
- static void peer(SocketHandle<Policy> handle, Address & addr,
- typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type * = 0);
+ template <class SPolicy>
+ static void peer(SocketHandle<SPolicy> handle, Address & addr,
+ typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type * = 0);
# else
- template <class Policy>
- static void peer(SocketHandle<Policy> handle, Address & addr);
+ template <class SPolicy>
+ static void peer(SocketHandle<SPolicy> 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[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);
+ template <class SPolicy>
+ static void connect(SocketHandle<SPolicy> handle, Address const & addr,
+ typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type * = 0);
# else
- template <class Policy>
- static void connect(SocketHandle<Policy> handle, Address const & addr);
+ template <class SPolicy>
+ static void connect(SocketHandle<SPolicy> handle, Address const & addr);
///< Connect to remote host
/**< This member is only available if the socket handles
communication policy is ConnectedCommunicationPolicy.
// c-file-style: "senf"
// indent-tabs-mode: nil
// ispell-local-dictionary: "american"
-// compile-command: "scons -u test"
+// compile-command: "scons -u ../test"
// comment-column: 40
// End:
///////////////////////////////cti.p///////////////////////////////////////
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
prefix_ unsigned senf::ReadablePolicy::
-readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
- typename Policy::AddressingPolicy::Address & address,
- typename IfCommunicationPolicyIs<Policy,UnconnectedCommunicationPolicy>::type *)
+readfrom(ClientSocketHandle<SPolicy> handle, char * buffer, unsigned size,
+ typename SPolicy::AddressingPolicy::Address & address,
+ typename IfCommunicationPolicyIs<SPolicy,UnconnectedCommunicationPolicy>::type *)
{
return do_rcvfrom(handle, buffer, size, address.sockaddr_p(), address.sockaddr_len());
}
#else
-template <class Policy>
+template <class SPolicy>
prefix_ unsigned senf::ReadablePolicy::
-readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
+readfrom(ClientSocketHandle<SPolicy> handle, char * buffer, unsigned size,
typename Policy::AddressingPolicy::Address & address)
{}
#endif
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
- typename IfCommunicationPolicyIs<Policy,ConnectedCommunicationPolicy>::type *)
+write(ClientSocketHandle<SPolicy> handle, char const * buffer, unsigned size,
+ typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
{
return do_write(handle,buffer,size);
}
#else
-template <class Policy>
+template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size)
+write(ClientSocketHandle<SPolicy> handle, char const * buffer, unsigned size)
{}
#endif
#ifndef DOXYGEN
-template <class Policy>
+template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-writeto(ClientSocketHandle<Policy> handle,
- typename boost::call_traits<typename Policy::AddressingPolicy::Address>::param_type addr,
+writeto(ClientSocketHandle<SPolicy> handle,
+ typename boost::call_traits<typename SPolicy::AddressingPolicy::Address>::param_type addr,
char const * buffer, unsigned size,
- typename IfCommunicationPolicyIs<Policy,UnconnectedCommunicationPolicy>::type *)
+ typename IfCommunicationPolicyIs<SPolicy,UnconnectedCommunicationPolicy>::type *)
{
return do_writeto(handle, buffer, size, addr.sockaddr_p(), addr.sockaddr_len());
}
#else
-template <class Policy>
+template <class SPolicy>
prefix_ unsigned senf::WriteablePolicy::
-writeto(ClientSocketHandle<Policy> handle,
+writeto(ClientSocketHandle<SPolicy> handle,
typename Policy::AddressingPolicy::Address const & addr,
char const * buffer, unsigned size)
{}
\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,
+ template <class SPolicy>
+ static unsigned readfrom(ClientSocketHandle<SPolicy> handle, char * buffer, unsigned size,
+ typename SPolicy::AddressingPolicy::Address & address,
typename IfCommunicationPolicyIs<
- Policy,UnconnectedCommunicationPolicy>::type * = 0);
+ SPolicy,UnconnectedCommunicationPolicy>::type * = 0);
# else
- template <class Policy>
- static unsigned readfrom(ClientSocketHandle<Policy> handle, char * buffer, unsigned size,
+ template <class SPolicy>
+ static unsigned readfrom(ClientSocketHandle<SPolicy> 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
struct WriteablePolicy : public WritePolicyBase
{
# ifndef DOXYGEN
- template <class Policy>
- static unsigned write(ClientSocketHandle<Policy> handle, char const * buffer, unsigned size,
+ template <class SPolicy>
+ static unsigned write(ClientSocketHandle<SPolicy> handle, char const * buffer, unsigned size,
typename IfCommunicationPolicyIs<
- Policy,ConnectedCommunicationPolicy>::type * = 0);
+ SPolicy,ConnectedCommunicationPolicy>::type * = 0);
# else
- template <class Policy>
- static unsigned write(ClientSocketHandle<Policy> handle, char const * buffer,
+ template <class SPolicy>
+ static unsigned write(ClientSocketHandle<SPolicy> handle, char const * buffer,
unsigned size);
///< write data to socket
/**< This member is only enabled if the socket uses
\returns number of bytes written */
# endif
# ifndef DOXYGEN
- template <class Policy>
- static unsigned writeto(ClientSocketHandle<Policy> handle,
+ template <class SPolicy>
+ static unsigned writeto(ClientSocketHandle<SPolicy> handle,
typename boost::call_traits<
- typename Policy::AddressingPolicy::Address>::param_type addr,
+ typename SPolicy::AddressingPolicy::Address>::param_type addr,
char const * buffer, unsigned size,
typename IfCommunicationPolicyIs<
- Policy,UnconnectedCommunicationPolicy>::type * = 0);
+ SPolicy,UnconnectedCommunicationPolicy>::type * = 0);
# else
- template <class Policy>
- static unsigned writeto(ClientSocketHandle<Policy> handle,
+ template <class SPolicy>
+ static unsigned writeto(ClientSocketHandle<SPolicy> handle,
typename Policy::AddressingPolicy::Address const & addr,
char const * buffer, unsigned size);
///< write data to socket sending to given peer
#define prefix_ inline
///////////////////////////////cti.p///////////////////////////////////////
-template <class Policy>
-prefix_ senf::ServerSocketHandle<Policy>::ServerSocketHandle()
+template <class SPolicy>
+prefix_ senf::ServerSocketHandle<SPolicy>::ServerSocketHandle()
{}
-template <class SocketPolicy>
+template <class SPolicy>
template <class OtherPolicy>
-prefix_ senf::ServerSocketHandle<SocketPolicy>::
+prefix_ senf::ServerSocketHandle<SPolicy>::
ServerSocketHandle(ServerSocketHandle<OtherPolicy> other,
- typename SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type *)
- : SocketHandle<SocketPolicy>(other,true)
+ typename SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type *)
+ : SocketHandle<SPolicy>(other,true)
{}
-template <class SocketPolicy>
-prefix_ senf::ServerSocketHandle<SocketPolicy>::
+template <class SPolicy>
+prefix_ senf::ServerSocketHandle<SPolicy>::
ServerSocketHandle(std::auto_ptr<SocketBody> body)
- : SocketHandle<SocketPolicy>(body)
+ : SocketHandle<SPolicy>(body)
{}
-template <class SocketPolicy>
+template <class SPolicy>
template <class OtherPolicy>
-prefix_ typename senf::SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type const &
-senf::ServerSocketHandle<SocketPolicy>::operator=(ServerSocketHandle<OtherPolicy> other)
+prefix_ typename senf::SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type const &
+senf::ServerSocketHandle<SPolicy>::operator=(ServerSocketHandle<OtherPolicy> other)
{
assign(other);
return *this;
///////////////////////////////////////////////////////////////////////////
// Server socket interface
-template <class Policy>
-prefix_ void senf::ServerSocketHandle<Policy>::bind(AddressParam addr)
+template <class SPolicy>
+prefix_ void senf::ServerSocketHandle<SPolicy>::bind(AddressParam addr)
{
- Policy::AddressingPolicy::bind(*this,addr);
+ SPolicy::AddressingPolicy::bind(*this,addr);
}
-template <class Policy>
-prefix_ void senf::ServerSocketHandle<Policy>::listen(unsigned backlog)
+template <class SPolicy>
+prefix_ void senf::ServerSocketHandle<SPolicy>::listen(unsigned backlog)
{
- Policy::CommunicationPolicy::listen(*this,backlog);
+ SPolicy::CommunicationPolicy::listen(*this,backlog);
}
-template <class Policy>
-prefix_ typename senf::ServerSocketHandle<Policy>::Address
-senf::ServerSocketHandle<Policy>::local()
+template <class SPolicy>
+prefix_ typename senf::ServerSocketHandle<SPolicy>::Address
+senf::ServerSocketHandle<SPolicy>::local()
{
- typename Policy::AddressingPolicy::Address addr;
+ typename SPolicy::AddressingPolicy::Address addr;
this->local(addr);
return addr;
}
-template <class Policy>
-prefix_ void senf::ServerSocketHandle<Policy>::local(Address & addr)
+template <class SPolicy>
+prefix_ void senf::ServerSocketHandle<SPolicy>::local(Address & addr)
{
- Policy::AddressingPolicy::local(*this,addr);
+ SPolicy::AddressingPolicy::local(*this,addr);
}
-template <class Policy>
-prefix_ typename senf::ServerSocketHandle<Policy>::ClientSocketHandle
-senf::ServerSocketHandle<Policy>::accept()
+template <class SPolicy>
+prefix_ typename senf::ServerSocketHandle<SPolicy>::ClientSocketHandle
+senf::ServerSocketHandle<SPolicy>::accept()
{
return ClientSocketHandle(this->body().clone(
- Policy::CommunicationPolicy::accept(*this), false));
+ SPolicy::CommunicationPolicy::accept(*this), false));
}
-template <class Policy>
-prefix_ std::pair<typename senf::ServerSocketHandle<Policy>::ClientSocketHandle,
- typename senf::ServerSocketHandle<Policy>::Address>
-senf::ServerSocketHandle<Policy>::acceptfrom()
+template <class SPolicy>
+prefix_ std::pair<typename senf::ServerSocketHandle<SPolicy>::ClientSocketHandle,
+ typename senf::ServerSocketHandle<SPolicy>::Address>
+senf::ServerSocketHandle<SPolicy>::acceptfrom()
{
Address address;
return std::make_pair(handle,address);
}
-template <class Policy>
-prefix_ typename senf::ServerSocketHandle<Policy>::ClientSocketHandle
-senf::ServerSocketHandle<Policy>::acceptfrom(Address & addr)
+template <class SPolicy>
+prefix_ typename senf::ServerSocketHandle<SPolicy>::ClientSocketHandle
+senf::ServerSocketHandle<SPolicy>::acceptfrom(Address & addr)
{
return ClientSocketHandle(this->protocol().clone(),
- Policy::CommunicationPolicy::accept(*this,addr));
+ SPolicy::CommunicationPolicy::accept(*this,addr));
}
///////////////////////////////////////////////////////////////////////////
-template <class Policy>
-prefix_ senf::ServerSocketHandle<Policy>::ServerSocketHandle(FileHandle other,
+template <class SPolicy>
+prefix_ senf::ServerSocketHandle<SPolicy>::ServerSocketHandle(FileHandle other,
bool isChecked)
- : SocketHandle<Policy>(other, isChecked)
+ : SocketHandle<SPolicy>(other, isChecked)
{}
-template <class Policy>
-prefix_ senf::ServerSocketHandle<Policy>
-senf::ServerSocketHandle<Policy>::cast_static(FileHandle handle)
+template <class SPolicy>
+prefix_ senf::ServerSocketHandle<SPolicy>
+senf::ServerSocketHandle<SPolicy>::cast_static(FileHandle handle)
{
return ServerSocketHandle(handle,true);
}
-template <class Policy>
-prefix_ senf::ServerSocketHandle<Policy>
-senf::ServerSocketHandle<Policy>::cast_dynamic(FileHandle handle)
+template <class SPolicy>
+prefix_ senf::ServerSocketHandle<SPolicy>
+senf::ServerSocketHandle<SPolicy>::cast_dynamic(FileHandle handle)
{
- SocketHandle<Policy> h (SocketHandle<Policy>::cast_dynamic(handle));
+ SocketHandle<SPolicy> h (SocketHandle<SPolicy>::cast_dynamic(handle));
if (! static_cast<SocketBody&>(FileHandle::body(handle)).isServer())
throw std::bad_cast();
return cast_static(handle);
}
-template <class Policy>
-prefix_ void senf::ServerSocketHandle<Policy>::state(SocketStateMap & map, unsigned lod)
+template <class SPolicy>
+prefix_ void senf::ServerSocketHandle<SPolicy>::state(SocketStateMap & map, unsigned lod)
{
map["handle"] = prettyName(typeid(*this));
this->body().state(map,lod);
}
-template <class Policy>
-prefix_ std::string senf::ServerSocketHandle<Policy>::dumpState(unsigned lod)
+template <class SPolicy>
+prefix_ std::string senf::ServerSocketHandle<SPolicy>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
/// \addtogroup handle_group
/// @{
- template <class Policy> class ClientSocketHandle;
+ template <class SPolicy> class ClientSocketHandle;
/** \brief Generic SocketHandle with server interface
classes. You can also find a summary of all members available in the leaf protocol class
documentation.
*/
- template <class Policy>
+ template <class SPolicy>
class ServerSocketHandle
- : public SocketHandle<Policy>
+ : public SocketHandle<SPolicy>
{
public:
///////////////////////////////////////////////////////////////////////////
// Types
/// Address type from the addressing policy
- typedef typename Policy::AddressingPolicy::Address Address;
+ typedef typename SPolicy::AddressingPolicy::Address Address;
/// 'Best' type for passing address as parameter
/** Depending on the type of \c Address, this will be either <tt>Address</tt> or <tt>Address
const &</tt>. See <a
*/
typedef typename boost::call_traits<Address>::param_type AddressParam;
/// Corresponding client socket handle with the same policy
- typedef ClientSocketHandle<Policy> ClientSocketHandle;
+ typedef ClientSocketHandle<SPolicy> ClientSocketHandle;
///////////////////////////////////////////////////////////////////////////
///\name Structors and default members
// conversion constructors
template <class OtherPolicy>
ServerSocketHandle(ServerSocketHandle<OtherPolicy> other,
- typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type * = 0);
+ typename SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type * = 0);
template <class OtherPolicy>
- typename SocketHandle<Policy>::template IsCompatible<OtherPolicy>::type const &
+ typename SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type const &
operator=(ServerSocketHandle<OtherPolicy> other);
///@}
return s.str();
}
-template <class Policy>
-prefix_ std::ostream & senf::operator<<(std::ostream & os, SocketHandle<Policy> handle)
-{
- os << handle.dumpState();
- return os;
-}
-
///////////////////////////////cc.e////////////////////////////////////////
#undef prefix_
//#include "SocketHandle.mpp"
///////////////////////////////cti.p///////////////////////////////////////
///////////////////////////////////////////////////////////////////////////
-// senf::SocketHandle<SocketPolicy>
+// senf::SocketHandle<SPolicy>
-template <class SocketPolicy>
-prefix_ senf::SocketHandle<SocketPolicy>::SocketHandle()
+template <class SPolicy>
+prefix_ senf::SocketHandle<SPolicy>::SocketHandle()
{}
-template <class SocketPolicy>
+template <class SPolicy>
template <class OtherPolicy>
-prefix_ senf::SocketHandle<SocketPolicy>::SocketHandle(SocketHandle<OtherPolicy> other,
+prefix_ senf::SocketHandle<SPolicy>::SocketHandle(SocketHandle<OtherPolicy> other,
typename IsCompatible<OtherPolicy>::type *)
: FileHandle(other)
{}
-template <class SocketPolicy>
+template <class SPolicy>
template <class OtherPolicy>
-prefix_ typename senf::SocketHandle<SocketPolicy>::template IsCompatible<OtherPolicy>::type const &
-senf::SocketHandle<SocketPolicy>::operator=(SocketHandle<OtherPolicy> other)
+prefix_ typename senf::SocketHandle<SPolicy>::template IsCompatible<OtherPolicy>::type const &
+senf::SocketHandle<SPolicy>::operator=(SocketHandle<OtherPolicy> other)
{
assign(other);
return *this;
}
-template <class SocketPolicy>
+template <class SPolicy>
prefix_
-senf::SocketHandle<SocketPolicy>::SocketHandle(std::auto_ptr<SocketBody> body)
+senf::SocketHandle<SPolicy>::SocketHandle(std::auto_ptr<SocketBody> body)
: FileHandle(std::auto_ptr<FileBody>(body.release()))
{}
-template <class SocketPolicy>
-prefix_ senf::SocketHandle<SocketPolicy>::SocketHandle(FileHandle other, bool isChecked)
+template <class SPolicy>
+prefix_ senf::SocketHandle<SPolicy>::SocketHandle(FileHandle other, bool isChecked)
: FileHandle(other)
{
SENF_ASSERT( isChecked );
SENF_ASSERT( dynamic_cast<SocketBody *>(&FileHandle::body()) );
}
-template <class SocketPolicy>
-prefix_ senf::SocketBody & senf::SocketHandle<SocketPolicy>::body()
+template <class SPolicy>
+prefix_ senf::SocketBody & senf::SocketHandle<SPolicy>::body()
{
SENF_ASSERT( dynamic_cast<SocketBody *>(&FileHandle::body()) );
return static_cast<SocketBody &>(FileHandle::body());
}
-template <class SocketPolicy>
-prefix_ senf::SocketBody const & senf::SocketHandle<SocketPolicy>::body()
+template <class SPolicy>
+prefix_ senf::SocketBody const & senf::SocketHandle<SPolicy>::body()
const
{
SENF_ASSERT( dynamic_cast<SocketBody const *>(&FileHandle::body()) );
return static_cast<SocketBody const &>(FileHandle::body());
}
-template <class SocketPolicy>
-prefix_ senf::SocketProtocol const & senf::SocketHandle<SocketPolicy>::protocol()
+template <class SPolicy>
+prefix_ senf::SocketProtocol const & senf::SocketHandle<SPolicy>::protocol()
const
{
return body().protocol();
}
-template <class SocketPolicy>
-prefix_ void senf::SocketHandle<SocketPolicy>::assign(FileHandle other)
+template <class SPolicy>
+prefix_ void senf::SocketHandle<SPolicy>::assign(FileHandle other)
{
FileHandle::operator=(other);
}
-template <class SocketPolicy>
-prefix_ senf::SocketHandle<SocketPolicy>
-senf::SocketHandle<SocketPolicy>::cast_static(FileHandle handle)
+template <class SPolicy>
+prefix_ senf::SocketHandle<SPolicy>
+senf::SocketHandle<SPolicy>::cast_static(FileHandle handle)
{
return SocketHandle(handle,true);
}
-template <class SocketPolicy>
-prefix_ senf::SocketHandle<SocketPolicy>
-senf::SocketHandle<SocketPolicy>::cast_dynamic(FileHandle handle)
+template <class SPolicy>
+prefix_ senf::SocketHandle<SPolicy>
+senf::SocketHandle<SPolicy>::cast_dynamic(FileHandle handle)
{
// throws bad_cast if the body is not a SocketBody
SocketBody & body (dynamic_cast<SocketBody&>(FileHandle::body(handle)));
// throws bad_cast if the policy is not compatible
- SocketPolicy::checkBaseOf(body.protocol().policy());
+ SPolicy::checkBaseOf(body.protocol().policy());
return cast_static(handle);
}
return true;
}
-template <class SocketPolicy>
-prefix_ void senf::SocketHandle<SocketPolicy>::state(SocketStateMap & map, unsigned lod)
+template <class SPolicy>
+prefix_ void senf::SocketHandle<SPolicy>::state(SocketStateMap & map, unsigned lod)
{
// We use typeid here even though the type of *this is static
// (SocketHandle is not polymorphic and has no vtable). This will
body().state(map,lod);
}
-template <class SocketPolicy>
-prefix_ std::string senf::SocketHandle<SocketPolicy>::dumpState(unsigned lod)
+template <class SPolicy>
+prefix_ std::string senf::SocketHandle<SPolicy>::dumpState(unsigned lod)
{
SocketStateMap map;
state(map,lod);
: SocketBody(isServer, fd)
{}
+///////////////////////////////////////////////////////////////////////////
+
+template <class SPolicy>
+prefix_ std::ostream & senf::operator<<(std::ostream & os, SocketHandle<SPolicy> handle)
+{
+ os << handle.dumpState();
+ return os;
+}
+
///////////////////////////////cti.e///////////////////////////////////////
#undef prefix_
\todo Create a SocketHandleBase class and move some non-Policy dependent code there
*/
- template <class SocketPolicy>
+ template <class SPolicy>
class SocketHandle
: public FileHandle
{
///////////////////////////////////////////////////////////////////////////
// Types
- typedef SocketPolicy Policy;
+ typedef SPolicy Policy;
/** \brief Check policy compatibility
*/
template <class OtherPolicy>
struct IsCompatible
- : public boost::enable_if< SocketPolicyIsBaseOf<SocketPolicy,OtherPolicy>,
- SocketHandle >
+ : public boost::enable_if< SocketPolicyIsBaseOf<Policy,OtherPolicy>, SocketHandle >
{};
///////////////////////////////////////////////////////////////////////////
\related senf::SocketHandle
*/
- template <class Policy>
- std::ostream & operator<<(std::ostream & os, SocketHandle<Policy> handle);
+ template <class SPolicy>
+ std::ostream & operator<<(std::ostream & os, SocketHandle<SPolicy> handle);
/** \brief static socket (down-)cast
\code
struct ExampleAddressingPolicy
{
- template <class Policy>
- void connect(senf::SocketHandle<Policy> handle, Address & addr,
+ template <class SPolicy>
+ void connect(senf::SocketHandle<SPolicy> handle, Address & addr,
typename senf::IfCommmunicationPolicyIs<
- Policy, senf::ConnectedCommunicationPolicy>::type * = 0);
+ SPolicy, senf::ConnectedCommunicationPolicy>::type * = 0);
};
\endcode
struct WritablePolicy : public WritePolicyBase {};
struct UnwritablePolicy : public WritePolicyBase {};
- template <class Policy>
+ template <class SPolicy>
struct ConvertibleValue
{
ConvertibleValue() {}
template <class OtherPolicy>
ConvertibleValue(ConvertibleValue<OtherPolicy> const & other,
- typename boost::enable_if< SocketPolicyIsBaseOf<Policy,OtherPolicy> >::type * = 0)
+ typename boost::enable_if< SocketPolicyIsBaseOf<SPolicy,OtherPolicy> >::type * = 0)
{}
ConvertibleValue const & operator=(ConvertibleValue const & other)
{ return *this; }
template <class OtherPolicy>
- typename boost::enable_if< SocketPolicyIsBaseOf<Policy,OtherPolicy>,
+ typename boost::enable_if< SocketPolicyIsBaseOf<SPolicy,OtherPolicy>,
ConvertibleValue >::type const &
operator=(ConvertibleValue<OtherPolicy> const & other)
{ return *this; }
friend class SocketBody;
};
- template <class Policy> class ClientSocketHandle;
- template <class Policy> class ServerSocketHandle;
+ template <class SPolicy> class ClientSocketHandle;
+ template <class SPolicy> class ServerSocketHandle;
/** \brief Concrete Socket Protocol implementation base class