Socket: Fix template parameter names to correct doxygen images
g0dil [Fri, 1 Feb 2008 12:31:58 +0000 (12:31 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@656 270642c3-0616-0410-b53a-bc976706d245

17 files changed:
Socket/ClientSocketHandle.ct
Socket/ClientSocketHandle.cti
Socket/ClientSocketHandle.hh
Socket/CommunicationPolicy.cti
Socket/CommunicationPolicy.hh
Socket/Protocols/GenericAddressingPolicy.cti
Socket/Protocols/GenericAddressingPolicy.hh
Socket/ReadWritePolicy.cti
Socket/ReadWritePolicy.hh
Socket/ServerSocketHandle.cti
Socket/ServerSocketHandle.hh
Socket/SocketHandle.cc
Socket/SocketHandle.cti
Socket/SocketHandle.hh
Socket/SocketPolicy.hh
Socket/SocketPolicy.test.cc
Socket/SocketProtocol.hh

index a9d78dc..4ba87e5 100644 (file)
@@ -93,17 +93,17 @@ writeto(Handle & handle, ForwardReadableRange & range, typename Handle::Address
 
 // 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)
@@ -113,21 +113,21 @@ prefix_ void senf::ClientSocketHandle<Policy>::read(Sequence & container, unsign
                     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());
@@ -141,10 +141,10 @@ prefix_ void senf::ClientSocketHandle<Policy>::readfrom(Sequence & container, Ad
 ////////////////////////////////////////
 // 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()) {
index 9a5cd7b..74f2307 100644 (file)
@@ -97,69 +97,69 @@ writeto(Handle & handle, ForwardReadableRange & range, typename Handle::Address
 ////////////////////////////////////////
 // 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
@@ -167,24 +167,24 @@ read(ForwardWritableRange const & range,
         >::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
@@ -192,29 +192,29 @@ read(ForwardWritableRange & range,
         >::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
@@ -222,13 +222,13 @@ senf::ClientSocketHandle<Policy>::readfrom(ForwardWritableRange const & range, A
         >::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
@@ -236,22 +236,22 @@ senf::ClientSocketHandle<Policy>::readfrom(ForwardWritableRange & range, Address
         >::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
@@ -259,21 +259,21 @@ senf::ClientSocketHandle<Policy>::write(ForwardReadableRange const & range)
         >::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
@@ -281,85 +281,85 @@ senf::ClientSocketHandle<Policy>::writeto(AddressParam addr, ForwardReadableRang
         >::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);
@@ -368,15 +368,15 @@ senf::ClientSocketHandle<Policy>::cast_dynamic(FileHandle 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);
index 93cd252..bbae9b0 100644 (file)
@@ -42,7 +42,7 @@ namespace senf {
     /// \addtogroup handle_group
     /// @{
 
-    template <class Policy> class ServerSocketHandle;
+    template <class SPolicy> class ServerSocketHandle;
 
     /** \brief Generic SocketHandle with client interface
 
@@ -85,16 +85,16 @@ namespace senf {
         \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
@@ -106,7 +106,7 @@ namespace senf {
         /** 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
@@ -124,18 +124,18 @@ namespace senf {
 #       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        
 
         ///@}
@@ -434,7 +434,7 @@ namespace senf {
     private:
         unsigned available();
 
-        friend class senf::ServerSocketHandle<Policy>;
+        friend class senf::ServerSocketHandle<SPolicy>;
     };
 
     /// @}
index 3579bee..c877ff3 100644 (file)
 ///////////////////////////////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
 
index 588d735..39c0fc6 100644 (file)
@@ -42,7 +42,7 @@ namespace senf {
     /// \addtogroup policy_impl_group
     /// @{
 
-    template <class Policy> class ServerSocketHandle;
+    template <class SPolicy> class ServerSocketHandle;
 
     /** \brief CommunicationPolicy for connected sockets
 
@@ -52,26 +52,26 @@ 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);
+        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
index 94b3e05..d003fff 100644 (file)
 
 #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());
@@ -94,6 +94,6 @@ prefix_ void senf::GenericAddressingPolicy<Address>::bind(FileHandle handle,
 // 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:
index ef35b63..c9e9cfe 100644 (file)
@@ -85,12 +85,12 @@ namespace senf {
         : 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.
@@ -104,12 +104,12 @@ namespace senf {
                                              \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.
@@ -142,6 +142,6 @@ namespace senf {
 // 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:
index 40e5410..4f71d4a 100644 (file)
 ///////////////////////////////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)
 {}
index c173abc..c324e67 100644 (file)
@@ -59,14 +59,14 @@ namespace senf {
                                              \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
@@ -98,13 +98,13 @@ namespace senf {
     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
@@ -118,16 +118,16 @@ namespace senf {
                                              \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
index e0e133f..29e1541 100644 (file)
 #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;
@@ -64,45 +64,45 @@ senf::ServerSocketHandle<SocketPolicy>::operator=(ServerSocketHandle<OtherPolicy
 ///////////////////////////////////////////////////////////////////////////
 // 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;
@@ -110,48 +110,48 @@ senf::ServerSocketHandle<Policy>::acceptfrom()
     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);
index 68f29b0..a123698 100644 (file)
@@ -42,7 +42,7 @@ namespace senf {
     /// \addtogroup handle_group
     /// @{
 
-    template <class Policy> class ClientSocketHandle;
+    template <class SPolicy> class ClientSocketHandle;
 
     /** \brief Generic SocketHandle with server interface
 
@@ -72,16 +72,16 @@ namespace senf {
         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
@@ -90,7 +90,7 @@ namespace senf {
          */
         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
@@ -107,10 +107,10 @@ namespace senf {
         // 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);
 
         ///@}
index 042d267..afd1d89 100644 (file)
@@ -85,13 +85,6 @@ prefix_ std::string senf::detail::dumpState(SocketStateMap const & map)
     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"
index 983c5a5..f059c56 100644 (file)
 ///////////////////////////////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);
 }
 
@@ -164,8 +164,8 @@ prefix_ bool senf::check_socket_cast(Source 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
@@ -176,8 +176,8 @@ prefix_ void senf::SocketHandle<SocketPolicy>::state(SocketStateMap & map, unsig
     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);
@@ -197,6 +197,15 @@ prefix_ senf::ProtocolSocketBody<SProtocol>::ProtocolSocketBody(bool isServer, i
     : 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_
 
index 85a14b6..7b64f53 100644 (file)
@@ -63,7 +63,7 @@ namespace senf {
 
         \todo Create a SocketHandleBase class and move some non-Policy dependent code there
      */
-    template <class SocketPolicy>
+    template <class SPolicy>
     class SocketHandle
         : public FileHandle
     {
@@ -71,7 +71,7 @@ namespace senf {
         ///////////////////////////////////////////////////////////////////////////
         // Types
 
-        typedef SocketPolicy Policy;
+        typedef SPolicy Policy;
 
         /** \brief Check policy compatibility
 
@@ -81,8 +81,7 @@ namespace senf {
          */
         template <class OtherPolicy>
         struct IsCompatible
-            : public boost::enable_if< SocketPolicyIsBaseOf<SocketPolicy,OtherPolicy>,
-                                       SocketHandle >
+            : public boost::enable_if< SocketPolicyIsBaseOf<Policy,OtherPolicy>, SocketHandle >
         {};
 
         ///////////////////////////////////////////////////////////////////////////
@@ -200,8 +199,8 @@ namespace senf {
 
         \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
 
index b9070f2..fbb2980 100644 (file)
     \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
 
index 0a99bdf..2bcb149 100644 (file)
@@ -56,7 +56,7 @@ namespace {
     struct WritablePolicy : public WritePolicyBase {};
     struct UnwritablePolicy : public WritePolicyBase {};
 
-    template <class Policy>
+    template <class SPolicy>
     struct ConvertibleValue
     {
         ConvertibleValue() {}
@@ -64,14 +64,14 @@ namespace {
 
         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; }
index 5a25dd7..52f8195 100644 (file)
@@ -251,8 +251,8 @@ namespace senf {
         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