X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cci;h=896d13af0274659928e2a31503e16fd9ecc76c94;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=833b8b683ea2556e6585fe90f4540050a83bd170;hpb=f73fa16ed5abdce272ac77f8b8b9ef2b9922c266;p=senf.git diff --git a/Socket/SocketHandle.cci b/Socket/SocketHandle.cci index 833b8b6..896d13a 100644 --- a/Socket/SocketHandle.cci +++ b/Socket/SocketHandle.cci @@ -27,32 +27,30 @@ #include "SocketHandle.ih" // Custom includes +#include "../Utils/senfassert.hh" #include "../Utils/Exception.hh" #include "SocketProtocol.hh" #define prefix_ inline ///////////////////////////////cci.p/////////////////////////////////////// -prefix_ senf::SocketBody::SocketBody(std::auto_ptr protocol, - bool isServer) - : protocol_(protocol), isServer_(isServer) -{ - BOOST_ASSERT( ! protocol_->body_ ); - protocol_->body_ = this; -} +prefix_ senf::SocketBody::SocketBody(bool isServer) + : isServer_(isServer) +{} + +prefix_ senf::SocketBody::SocketBody(bool isServer, int fd) + : FileBody(fd), isServer_(isServer) +{} -prefix_ senf::SocketBody::SocketBody(std::auto_ptr protocol, - bool isServer, int fd) - : FileBody(fd), protocol_(protocol), isServer_(isServer) +prefix_ senf::SocketProtocol & senf::SocketBody::protocol() { - BOOST_ASSERT( ! protocol_->body_ ); - protocol_->body_ = this; + return const_cast(v_protocol()); } prefix_ senf::SocketProtocol const & senf::SocketBody::protocol() const { - return *protocol_; + return v_protocol(); } prefix_ bool senf::SocketBody::isServer() @@ -60,6 +58,18 @@ prefix_ bool senf::SocketBody::isServer() return isServer_; } +prefix_ std::auto_ptr senf::SocketBody::clone(bool isServer) + const +{ + return protocol().clone(isServer); +} + +prefix_ std::auto_ptr senf::SocketBody::clone(int fd, bool isServer) + const +{ + return protocol().clone(fd, isServer); +} + /////////////////////////////////////////////////////////////////////////// // senf::detail::StreamableString