From: tho Date: Tue, 8 Jul 2008 13:46:16 +0000 (+0000) Subject: made some ClientSocketHandle methods (except read/write) const X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=e8a31ca63d661c8dd5402025c771b87798094a93;p=senf.git made some ClientSocketHandle methods (except read/write) const git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@890 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/Socket/ClientSocketHandle.ct b/Socket/ClientSocketHandle.ct index 549aa97..376ad68 100644 --- a/Socket/ClientSocketHandle.ct +++ b/Socket/ClientSocketHandle.ct @@ -98,7 +98,7 @@ template prefix_ std::string senf::ClientSocketHandle::read(unsigned limit) { std::string rv; - this->read(rv,limit); + this->read(rv, limit); return rv; } @@ -122,8 +122,8 @@ senf::ClientSocketHandle::readfrom(unsigned limit) { std::string rv; boost::value_initialized 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 diff --git a/Socket/ClientSocketHandle.cti b/Socket/ClientSocketHandle.cti index cba6c6f..fef092d 100644 --- a/Socket/ClientSocketHandle.cti +++ b/Socket/ClientSocketHandle.cti @@ -297,6 +297,7 @@ prefix_ char const * senf::ClientSocketHandle::writeto(AddressParam add template prefix_ typename SPolicy::AddressingPolicy::Address senf::ClientSocketHandle::peer() + const { typename SPolicy::AddressingPolicy::Address addr; this->peer(addr); @@ -306,8 +307,9 @@ senf::ClientSocketHandle::peer() template prefix_ void senf::ClientSocketHandle:: peer(typename SPolicy::AddressingPolicy::Address & addr) + const { - SPolicy::AddressingPolicy::peer(*this,addr); + SPolicy::AddressingPolicy::peer(*this, addr); } // senf::ClientSocketHandle::local @@ -315,6 +317,7 @@ peer(typename SPolicy::AddressingPolicy::Address & addr) template prefix_ typename SPolicy::AddressingPolicy::Address senf::ClientSocketHandle::local() + const { typename SPolicy::AddressingPolicy::Address addr; this->local(addr); @@ -324,6 +327,7 @@ senf::ClientSocketHandle::local() template prefix_ void senf::ClientSocketHandle:: local(typename SPolicy::AddressingPolicy::Address & addr) + const { SPolicy::AddressingPolicy::local(*this,addr); } @@ -332,8 +336,9 @@ local(typename SPolicy::AddressingPolicy::Address & addr) template prefix_ void senf::ClientSocketHandle::connect(AddressParam addr) + const { - SPolicy::AddressingPolicy::connect(*this,addr); + SPolicy::AddressingPolicy::connect(*this, addr); } // senf::ClientSocketHandle::bind @@ -341,8 +346,9 @@ prefix_ void senf::ClientSocketHandle::connect(AddressParam addr) template prefix_ void senf::ClientSocketHandle:: bind(typename boost::call_traits::param_type addr) + const { - SPolicy::AddressingPolicy::bind(*this,addr); + SPolicy::AddressingPolicy::bind(*this, addr); } //////////////////////////////////////// @@ -372,7 +378,7 @@ template prefix_ void senf::ClientSocketHandle::state(SocketStateMap & map, unsigned lod) { map["handle"] = prettyName(typeid(*this)); - this->body().state(map,lod); + this->body().state(map, lod); } template diff --git a/Socket/ClientSocketHandle.hh b/Socket/ClientSocketHandle.hh index ee23d52..cb9868f 100644 --- a/Socket/ClientSocketHandle.hh +++ b/Socket/ClientSocketHandle.hh @@ -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() */