X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Socket%2FServerSocketHandle.cti;h=132625d789786bec3248d05e9fca5d9d5d2a2e29;hb=532240d72e09e19e57fac9bb55c2560b9c9e5b97;hp=0887c90b573a21335c9d271e81056e61176f97d1;hpb=c52cd7d87dbb525c1267aad27391b8b7365dbb57;p=senf.git diff --git a/Socket/ServerSocketHandle.cti b/Socket/ServerSocketHandle.cti index 0887c90..132625d 100644 --- a/Socket/ServerSocketHandle.cti +++ b/Socket/ServerSocketHandle.cti @@ -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,6 +20,10 @@ // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +/** \file + \brief ServerSocketHandle inline template implementation + */ + // Definition of inline template functions //#include "ServerSocketHandle.ih" @@ -30,24 +34,28 @@ #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// -template +template +prefix_ senf::ServerSocketHandle::ServerSocketHandle() +{} + +template template -prefix_ satcom::lib::ServerSocketHandle:: +prefix_ senf::ServerSocketHandle:: ServerSocketHandle(ServerSocketHandle other, - typename SocketHandle::template IsCompatible::type *) - : SocketHandle(other,true) + typename SocketHandle::template IsCompatible::type *) + : SocketHandle(other,true) {} -template -prefix_ satcom::lib::ServerSocketHandle:: -ServerSocketHandle(std::auto_ptr protocol) - : SocketHandle(protocol,true) +template +prefix_ senf::ServerSocketHandle:: +ServerSocketHandle(std::auto_ptr body) + : SocketHandle(body) {} -template +template template -prefix_ typename satcom::lib::SocketHandle::template IsCompatible::type const & -satcom::lib::ServerSocketHandle::operator=(ServerSocketHandle other) +prefix_ typename senf::SocketHandle::template IsCompatible::type const & +senf::ServerSocketHandle::operator=(ServerSocketHandle other) { assign(other); return *this; @@ -56,94 +64,94 @@ satcom::lib::ServerSocketHandle::operator=(ServerSocketHandle -prefix_ void satcom::lib::ServerSocketHandle::bind(AddressParam addr) +template +prefix_ void senf::ServerSocketHandle::bind(AddressParam addr) { - Policy::AddressingPolicy::bind(*this,addr); + SPolicy::AddressingPolicy::bind(*this,addr); } -template -prefix_ void satcom::lib::ServerSocketHandle::listen(unsigned backlog) +template +prefix_ void senf::ServerSocketHandle::listen(unsigned backlog) { - Policy::CommunicationPolicy::listen(*this,backlog); + SPolicy::CommunicationPolicy::listen(*this,backlog); } -template -prefix_ typename satcom::lib::ServerSocketHandle::Address -satcom::lib::ServerSocketHandle::local() +template +prefix_ typename senf::ServerSocketHandle::Address +senf::ServerSocketHandle::local() { - typename Policy::AddressingPolicy::Address addr; + typename SPolicy::AddressingPolicy::Address addr; this->local(addr); return addr; } -template -prefix_ void satcom::lib::ServerSocketHandle::local(Address & addr) +template +prefix_ void senf::ServerSocketHandle::local(Address & addr) { - Policy::AddressingPolicy::local(*this,addr); + SPolicy::AddressingPolicy::local(*this,addr); } -template -prefix_ typename satcom::lib::ServerSocketHandle::ClientSocketHandle -satcom::lib::ServerSocketHandle::accept() +template +prefix_ typename senf::ServerSocketHandle::ClientHandle +senf::ServerSocketHandle::accept() { - Address address; - return acceptfrom(address); + return ClientHandle(this->body().clone( + SPolicy::CommunicationPolicy::accept(*this), false)); } -template -prefix_ std::pair::ClientSocketHandle, - typename satcom::lib::ServerSocketHandle::Address> -satcom::lib::ServerSocketHandle::acceptfrom() +template +prefix_ std::pair::ClientHandle, + typename senf::ServerSocketHandle::Address> +senf::ServerSocketHandle::acceptfrom() { Address address; - ClientSocketHandle handle = accept(address); + ClientHandle handle = acceptfrom(address); return std::make_pair(handle,address); } -template -prefix_ typename satcom::lib::ServerSocketHandle::ClientSocketHandle -satcom::lib::ServerSocketHandle::acceptfrom(Address & addr) +template +prefix_ typename senf::ServerSocketHandle::ClientHandle +senf::ServerSocketHandle::acceptfrom(Address & addr) { - return ClientSocketHandle(this->protocol().clone(), - Policy::CommunicationPolicy::accept(*this,addr)); + return ClientHandle(this->body().clone( + SPolicy::CommunicationPolicy::accept(*this,addr), false)); } /////////////////////////////////////////////////////////////////////////// -template -prefix_ satcom::lib::ServerSocketHandle::ServerSocketHandle(FileHandle other, +template +prefix_ senf::ServerSocketHandle::ServerSocketHandle(FileHandle other, bool isChecked) - : SocketHandle(other, isChecked) + : SocketHandle(other, isChecked) {} -template -prefix_ satcom::lib::ServerSocketHandle -satcom::lib::ServerSocketHandle::cast_static(FileHandle handle) +template +prefix_ senf::ServerSocketHandle +senf::ServerSocketHandle::cast_static(FileHandle handle) { return ServerSocketHandle(handle,true); } -template -prefix_ satcom::lib::ServerSocketHandle -satcom::lib::ServerSocketHandle::cast_dynamic(FileHandle handle) +template +prefix_ senf::ServerSocketHandle +senf::ServerSocketHandle::cast_dynamic(FileHandle handle) { - SocketHandle h (SocketHandle::cast_dynamic(handle)); + SocketHandle h (SocketHandle::cast_dynamic(handle)); if (! static_cast(FileHandle::body(handle)).isServer()) throw std::bad_cast(); return cast_static(handle); } -template -prefix_ void satcom::lib::ServerSocketHandle::state(SocketStateMap & map, unsigned lod) +template +prefix_ void senf::ServerSocketHandle::state(SocketStateMap & map, unsigned lod) { map["handle"] = prettyName(typeid(*this)); this->body().state(map,lod); } -template -prefix_ std::string satcom::lib::ServerSocketHandle::dumpState(unsigned lod) +template +prefix_ std::string senf::ServerSocketHandle::dumpState(unsigned lod) { SocketStateMap map; state(map,lod); @@ -156,5 +164,10 @@ prefix_ std::string satcom::lib::ServerSocketHandle::dumpState(unsigned // Local Variables: // mode: c++ -// c-file-style: "satcom" +// fill-column: 100 +// c-file-style: "senf" +// indent-tabs-mode: nil +// ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: