X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FSocketHandle.cti;h=56c14729488a4fd2e1a62d2add7cb428dbef27cf;hb=9a988902090d28007578e93bffd809f6bd913155;hp=dde5bf78fd8c63176fefb93bbb6cb47e905f0d17;hpb=c52cd7d87dbb525c1267aad27391b8b7365dbb57;p=senf.git diff --git a/Socket/SocketHandle.cti b/Socket/SocketHandle.cti index dde5bf7..56c1472 100644 --- a/Socket/SocketHandle.cti +++ b/Socket/SocketHandle.cti @@ -1,6 +1,6 @@ // $Id$ // -// Copyright (C) 2006 +// Copyright (C) 2006 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) // Kompetenzzentrum fuer Satelitenkommunikation (SatCom) // Stefan Bund @@ -20,7 +20,9 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -// Definition of inline template functions +/** \file + \brief SocketHandle inline template implementation + */ #include "SocketHandle.ih" @@ -34,29 +36,29 @@ template template -prefix_ satcom::lib::SocketHandle::SocketHandle(SocketHandle other, +prefix_ senf::SocketHandle::SocketHandle(SocketHandle other, typename IsCompatible::type *) : FileHandle(other) {} template template -prefix_ typename satcom::lib::SocketHandle::template IsCompatible::type const & -satcom::lib::SocketHandle::operator=(SocketHandle other) +prefix_ typename senf::SocketHandle::template IsCompatible::type const & +senf::SocketHandle::operator=(SocketHandle other) { assign(other); return *this; } template -prefix_ -satcom::lib::SocketHandle::SocketHandle(std::auto_ptr protocol, +prefix_ +senf::SocketHandle::SocketHandle(std::auto_ptr protocol, bool isServer) : FileHandle(std::auto_ptr(new SocketBody(protocol,isServer))) {} template -prefix_ satcom::lib::SocketHandle::SocketHandle(FileHandle other, bool isChecked) +prefix_ senf::SocketHandle::SocketHandle(FileHandle other, bool isChecked) : FileHandle(other) { BOOST_ASSERT( isChecked ); @@ -64,14 +66,14 @@ prefix_ satcom::lib::SocketHandle::SocketHandle(FileHandle other, } template -prefix_ satcom::lib::SocketBody & satcom::lib::SocketHandle::body() +prefix_ senf::SocketBody & senf::SocketHandle::body() { BOOST_ASSERT( dynamic_cast(&FileHandle::body()) ); return static_cast(FileHandle::body()); } template -prefix_ satcom::lib::SocketBody const & satcom::lib::SocketHandle::body() +prefix_ senf::SocketBody const & senf::SocketHandle::body() const { BOOST_ASSERT( dynamic_cast(&FileHandle::body()) ); @@ -79,38 +81,38 @@ prefix_ satcom::lib::SocketBody const & satcom::lib::SocketHandle: } template -prefix_ satcom::lib::SocketProtocol const & satcom::lib::SocketHandle::protocol() +prefix_ senf::SocketProtocol const & senf::SocketHandle::protocol() const { return body().protocol(); } template -prefix_ void satcom::lib::SocketHandle::assign(FileHandle other) +prefix_ void senf::SocketHandle::assign(FileHandle other) { FileHandle::operator=(other); } template -prefix_ satcom::lib::SocketHandle -satcom::lib::SocketHandle::cast_static(FileHandle handle) +prefix_ senf::SocketHandle +senf::SocketHandle::cast_static(FileHandle handle) { return SocketHandle(handle,true); } template -prefix_ satcom::lib::SocketHandle -satcom::lib::SocketHandle::cast_dynamic(FileHandle handle) +prefix_ senf::SocketHandle +senf::SocketHandle::cast_dynamic(FileHandle handle) { // throws bad_cast if the body is not a SocketBody SocketBody & body (dynamic_cast(FileHandle::body(handle))); - // throws bad_cast if the poplicy is not compatible + // throws bad_cast if the policy is not compatible SocketPolicy::checkBaseOf(body.protocol().policy()); return cast_static(handle); } template -prefix_ Target satcom::lib::static_socket_cast(Source handle) +prefix_ Target senf::static_socket_cast(Source handle) { BOOST_STATIC_ASSERT(( boost::is_convertible::value && @@ -122,7 +124,7 @@ prefix_ Target satcom::lib::static_socket_cast(Source handle) } template -prefix_ Target satcom::lib::dynamic_socket_cast(Source handle) +prefix_ Target senf::dynamic_socket_cast(Source handle) { BOOST_STATIC_ASSERT(( boost::is_convertible::value && @@ -133,7 +135,7 @@ prefix_ Target satcom::lib::dynamic_socket_cast(Source handle) } template -prefix_ bool satcom::lib::check_socket_cast(Source handle) +prefix_ bool senf::check_socket_cast(Source handle) { BOOST_STATIC_ASSERT(( boost::is_convertible::value && @@ -156,14 +158,19 @@ prefix_ bool satcom::lib::check_socket_cast(Source handle) } template -prefix_ void satcom::lib::SocketHandle::state(SocketStateMap & map, unsigned lod) +prefix_ void senf::SocketHandle::state(SocketStateMap & map, unsigned lod) { + // We use typeid here even though the type of *this is static + // (SocketHandle is not polymorphic and has no vtable). This will + // 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)); body().state(map,lod); } template -prefix_ std::string satcom::lib::SocketHandle::dumpState(unsigned lod) +prefix_ std::string senf::SocketHandle::dumpState(unsigned lod) { SocketStateMap map; state(map,lod); @@ -171,10 +178,10 @@ prefix_ std::string satcom::lib::SocketHandle::dumpState(unsigned } /////////////////////////////////////////////////////////////////////////// -// satcom::lib::detail::ConvertibleString +// senf::detail::ConvertibleString template -prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString(T const & other) +prefix_ senf::detail::ConvertibleString::ConvertibleString(T const & other) : std::string(boost::lexical_cast(other)) {} @@ -184,5 +191,8 @@ prefix_ satcom::lib::detail::ConvertibleString::ConvertibleString(T const & othe // Local Variables: // mode: c++ -// c-file-style: "satcom" +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" // End: