X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cci;h=896d13af0274659928e2a31503e16fd9ecc76c94;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=60a522095937d6dd4b18e334eaa3ef5832f206ad;hpb=ac6a813d9d99f7add4e13aff7a4bcd314d5604a6;p=senf.git diff --git a/Socket/SocketHandle.cci b/Socket/SocketHandle.cci index 60a5220..896d13a 100644 --- a/Socket/SocketHandle.cci +++ b/Socket/SocketHandle.cci @@ -1,9 +1,9 @@ // $Id$ // -// Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// Copyright (C) 2006 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY +// Stefan Bund // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -20,37 +20,37 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// Definition of inline non-template functions +/** \file + \brief SocketHandle inline non-template implementation + */ #include "SocketHandle.ih" // Custom includes -#include "Utils/Exception.hh" +#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() @@ -58,15 +58,25 @@ prefix_ bool senf::SocketBody::isServer() return isServer_; } -/////////////////////////////////////////////////////////////////////////// -// senf::detail::ConvertibleString +prefix_ std::auto_ptr senf::SocketBody::clone(bool isServer) + const +{ + return protocol().clone(isServer); +} -prefix_ senf::detail::ConvertibleString::ConvertibleString() -{} +prefix_ std::auto_ptr senf::SocketBody::clone(int fd, bool isServer) + const +{ + return protocol().clone(fd, isServer); +} -prefix_ senf::detail::ConvertibleString::ConvertibleString(bool v) - : std::string(v ? "true" : "false") -{} +/////////////////////////////////////////////////////////////////////////// +// senf::detail::StreamableString + +prefix_ senf::detail::StreamableString & senf::detail::StreamableString::operator<<(bool v) +{ + return (*this) << std::string(v ? "true" : "false"); +} ///////////////////////////////cci.e/////////////////////////////////////// #undef prefix_ @@ -74,5 +84,10 @@ prefix_ senf::detail::ConvertibleString::ConvertibleString(bool v) // Local Variables: // mode: c++ +// fill-column: 100 // c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: