X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cti;h=983c5a5c9bac83600c6e5bbfe7b9bf184ce392b2;hb=6f50bf49e282c0528f51faa0a245bbfa2b867399;hp=05b3790b7255705feafed24eac3b598c95fd0934;hpb=145f6a7d0f3a6aaa77b3625351c952d24cb0b8a1;p=senf.git diff --git a/Socket/SocketHandle.cti b/Socket/SocketHandle.cti index 05b3790..983c5a5 100644 --- a/Socket/SocketHandle.cti +++ b/Socket/SocketHandle.cti @@ -1,9 +1,9 @@ // $Id$ // // Copyright (C) 2006 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) -// Stefan Bund +// 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 @@ -27,13 +27,17 @@ #include "SocketHandle.ih" // Custom includes +#include "../Utils/senfassert.hh" #include #include -#include "Utils/TypeInfo.hh" +#include "../Utils/TypeInfo.hh" #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// +/////////////////////////////////////////////////////////////////////////// +// senf::SocketHandle + template prefix_ senf::SocketHandle::SocketHandle() {} @@ -56,23 +60,22 @@ senf::SocketHandle::operator=(SocketHandle other) template prefix_ -senf::SocketHandle::SocketHandle(std::auto_ptr protocol, - bool isServer) - : FileHandle(std::auto_ptr(new SocketBody(protocol,isServer))) +senf::SocketHandle::SocketHandle(std::auto_ptr body) + : FileHandle(std::auto_ptr(body.release())) {} template prefix_ senf::SocketHandle::SocketHandle(FileHandle other, bool isChecked) : FileHandle(other) { - BOOST_ASSERT( isChecked ); - BOOST_ASSERT( dynamic_cast(&FileHandle::body()) ); + SENF_ASSERT( isChecked ); + SENF_ASSERT( dynamic_cast(&FileHandle::body()) ); } template prefix_ senf::SocketBody & senf::SocketHandle::body() { - BOOST_ASSERT( dynamic_cast(&FileHandle::body()) ); + SENF_ASSERT( dynamic_cast(&FileHandle::body()) ); return static_cast(FileHandle::body()); } @@ -80,7 +83,7 @@ template prefix_ senf::SocketBody const & senf::SocketHandle::body() const { - BOOST_ASSERT( dynamic_cast(&FileHandle::body()) ); + SENF_ASSERT( dynamic_cast(&FileHandle::body()) ); return static_cast(FileHandle::body()); } @@ -123,7 +126,7 @@ prefix_ Target senf::static_socket_cast(Source handle) boost::is_convertible::value && ( boost::is_convertible::value || boost::is_convertible::value ) )); - BOOST_ASSERT( check_socket_cast(handle) ); + SENF_ASSERT( check_socket_cast(handle) ); return Target::cast_static(handle); } @@ -169,7 +172,7 @@ prefix_ void senf::SocketHandle::state(SocketStateMap & map, unsig // automatically include the SocketPolicy template parameter in // the type name and therefore show the \e static policy of the // socket handle. - map["handle"] = prettyName(typeid(*this)); + map["handle"] << prettyName(typeid(*this)); body().state(map,lod); } @@ -182,11 +185,16 @@ prefix_ std::string senf::SocketHandle::dumpState(unsigned lod) } /////////////////////////////////////////////////////////////////////////// -// senf::detail::ConvertibleString +// senf::ProtocolSocketBody + +template +prefix_ senf::ProtocolSocketBody::ProtocolSocketBody(bool isServer) + : SocketBody(isServer) +{} -template -prefix_ senf::detail::ConvertibleString::ConvertibleString(T const & other) - : std::string(boost::lexical_cast(other)) +template +prefix_ senf::ProtocolSocketBody::ProtocolSocketBody(bool isServer, int fd) + : SocketBody(isServer, fd) {} ///////////////////////////////cti.e///////////////////////////////////////