// $Id$ // // 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 // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the // Free Software Foundation, Inc., // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. /** \file \brief BSDAddressingPolicyMixin inline template implementation */ //#include "BSDAddressingPolicy.ih" // Custom includes #define prefix_ inline //-///////////////////////////////////////////////////////////////////////////////////////////////// //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::BSDAddressingPolicyMixin
#ifndef DOXYGEN template template prefix_ void senf::BSDAddressingPolicyMixin
:: peer(SocketHandle const & handle, Address & addr, typename IfCommunicationPolicyIs::type *) { try { do_peer(handle,addr.sockaddr_p(),addr.socklen_p()); } catch (Exception & e) { e << "; could not get peer for address \"" << addr << "\""; throw; } } #else template template prefix_ void senf::BSDAddressingPolicyMixin
:: peer(SocketHandle const & handle, Address & addr) {} #endif #ifndef DOXYGEN template template prefix_ void senf::BSDAddressingPolicyMixin
:: connect(SocketHandle const & handle, Address const & addr, typename IfCommunicationPolicyIs::type *) { try { do_connect(handle,addr.sockaddr_p(),addr.socklen()); } catch (Exception & e) { e << "; could not connect to address \"" << addr << "\""; throw; } } #else template template prefix_ void senf::BSDAddressingPolicyMixin
:: connect(SocketHandle const & handle, Address const & addr) {} #endif template prefix_ void senf::BSDAddressingPolicyMixin
::local(FileHandle const & handle, Address & addr) { try { do_local(handle,addr.sockaddr_p(),addr.socklen_p()); } catch (Exception & e) { // TODO: identify socket by some meaningful attribute e << "; could not get name for address \"" << addr << "\""; throw; } } template prefix_ void senf::BSDAddressingPolicyMixin
::bind(FileHandle const & handle, Address const & addr) { try { do_bind(handle,addr.sockaddr_p(),addr.socklen()); } catch (Exception & e) { e << "; could not bind to address \"" << addr << "\""; throw; } } //-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ // 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: