made some ClientSocketHandle methods (except read/write) const
tho [Tue, 8 Jul 2008 13:46:16 +0000 (13:46 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@890 270642c3-0616-0410-b53a-bc976706d245

Socket/ClientSocketHandle.ct
Socket/ClientSocketHandle.cti
Socket/ClientSocketHandle.hh

index 549aa97..376ad68 100644 (file)
@@ -98,7 +98,7 @@ template <class SPolicy>
 prefix_ std::string senf::ClientSocketHandle<SPolicy>::read(unsigned limit)
 {
     std::string rv;
-    this->read(rv,limit);
+    this->read(rv, limit);
     return rv;
 }
 
@@ -122,8 +122,8 @@ senf::ClientSocketHandle<SPolicy>::readfrom(unsigned limit)
 {
     std::string rv;
     boost::value_initialized<typename SPolicy::AddressingPolicy::Address> addr;
-    this->readfrom(rv,addr.data(),limit);
-    return std::make_pair(rv,addr.data());
+    this->readfrom(rv, addr.data(), limit);
+    return std::make_pair(rv, addr.data());
 }
 
 template <class SPolicy>
index cba6c6f..fef092d 100644 (file)
@@ -297,6 +297,7 @@ prefix_ char const * senf::ClientSocketHandle<SPolicy>::writeto(AddressParam add
 template <class SPolicy>
 prefix_ typename SPolicy::AddressingPolicy::Address
 senf::ClientSocketHandle<SPolicy>::peer()
+    const
 {
     typename SPolicy::AddressingPolicy::Address addr;
     this->peer(addr);
@@ -306,8 +307,9 @@ senf::ClientSocketHandle<SPolicy>::peer()
 template <class SPolicy>
 prefix_ void senf::ClientSocketHandle<SPolicy>::
 peer(typename SPolicy::AddressingPolicy::Address & addr)
+    const
 {
-    SPolicy::AddressingPolicy::peer(*this,addr);
+    SPolicy::AddressingPolicy::peer(*this, addr);
 }
 
 // senf::ClientSocketHandle<SPolicy>::local
@@ -315,6 +317,7 @@ peer(typename SPolicy::AddressingPolicy::Address & addr)
 template <class SPolicy>
 prefix_ typename SPolicy::AddressingPolicy::Address
 senf::ClientSocketHandle<SPolicy>::local()
+    const
 {
     typename SPolicy::AddressingPolicy::Address addr;
     this->local(addr);
@@ -324,6 +327,7 @@ senf::ClientSocketHandle<SPolicy>::local()
 template <class SPolicy>
 prefix_ void senf::ClientSocketHandle<SPolicy>::
 local(typename SPolicy::AddressingPolicy::Address & addr)
+    const
 {
     SPolicy::AddressingPolicy::local(*this,addr);
 }
@@ -332,8 +336,9 @@ local(typename SPolicy::AddressingPolicy::Address & addr)
 
 template <class SPolicy>
 prefix_ void senf::ClientSocketHandle<SPolicy>::connect(AddressParam addr)
+    const
 {
-    SPolicy::AddressingPolicy::connect(*this,addr);
+    SPolicy::AddressingPolicy::connect(*this, addr);
 }
 
 // senf::ClientSocketHandle<SPolicy>::bind
@@ -341,8 +346,9 @@ prefix_ void senf::ClientSocketHandle<SPolicy>::connect(AddressParam addr)
 template <class SPolicy>
 prefix_ void senf::ClientSocketHandle<SPolicy>::
 bind(typename boost::call_traits<typename SPolicy::AddressingPolicy::Address>::param_type addr)
+    const
 {
-    SPolicy::AddressingPolicy::bind(*this,addr);
+    SPolicy::AddressingPolicy::bind(*this, addr);
 }
 
 ////////////////////////////////////////
@@ -372,7 +378,7 @@ template <class SPolicy>
 prefix_ void senf::ClientSocketHandle<SPolicy>::state(SocketStateMap & map, unsigned lod)
 {
     map["handle"] = prettyName(typeid(*this));
-    this->body().state(map,lod);
+    this->body().state(map, lod);
 }
 
 template <class SPolicy>
index ee23d52..cb9868f 100644 (file)
@@ -374,18 +374,18 @@ namespace senf {
 
             \throws senf::SystemException
          */
-        void         connect      (AddressParam addr);
+        void         connect      (AddressParam addr) const;
 
         /** \brief Set local address
 
             For addressable protocols (AddressingPolicy is not NoAddressingPolicy), bind() will set
             the local address of the socket.
 
-            \param[in] addr Local socket address to asign
+            \param[in] addr Local socket address to assign
 
             \throws senf::SystemException
          */
-        void         bind         (AddressParam addr);
+        void         bind         (AddressParam addr) const;
 
         /** \brief Query remote address
 
@@ -398,8 +398,8 @@ namespace senf {
 
             \throws senf::SystemException
          */
-        Address      peer         ();
-        void         peer         (Address & addr);
+        Address      peer         () const;
+        void         peer         (Address & addr) const;
                                         ///< Query remote address
                                         /**< \see \ref peer() */
 
@@ -413,8 +413,8 @@ namespace senf {
 
             \throws senf::SystemException
          */
-        Address      local        ();
-        void         local        (Address & addr);
+        Address      local        () const;
+        void         local        (Address & addr) const;
                                         ///< Query local address
                                         /**< \see \ref local() */