4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief GenericAddressingPolicy inline template implementation
27 //#include "GenericAddressingPolicy.ih"
31 #define prefix_ inline
32 ///////////////////////////////cti.p///////////////////////////////////////
34 ///////////////////////////////////////////////////////////////////////////
35 // senf::GenericAddressingPolicy<Address>
38 template <class Address>
39 template <class SPolicy>
40 prefix_ void senf::GenericAddressingPolicy<Address>::
41 peer(SocketHandle<SPolicy> handle, Address & addr,
42 typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
46 do_peer(handle,addr.sockaddr_p(),addr.sockaddr_len());
47 } catch (SystemException & e) {
48 e << "; could not get peer for address \"" << addr << "\"";
53 template <class Address>
54 template <class SPolicy>
55 prefix_ void senf::GenericAddressingPolicy<Address>::
56 peer(SocketHandle<SPolicy> handle, Address & addr)
61 template <class Address>
62 template <class SPolicy>
63 prefix_ void senf::GenericAddressingPolicy<Address>::
64 connect(SocketHandle<SPolicy> handle, Address const & addr,
65 typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
68 do_connect(handle,addr.sockaddr_p(),addr.sockaddr_len());
69 } catch (SystemException & e) {
70 e << "; could not connect to address \"" << addr << "\"";
75 template <class Address>
76 template <class SPolicy>
77 prefix_ void senf::GenericAddressingPolicy<Address>::
78 connect(SocketHandle<SPolicy> handle, Address const & addr)
82 template <class Address>
83 prefix_ void senf::GenericAddressingPolicy<Address>::local(FileHandle handle,
88 do_local(handle,addr.sockaddr_p(),addr.sockaddr_len());
89 } catch (SystemException & e) {
90 e << "; could not get name for address \"" << addr << "\"";
95 template <class Address>
96 prefix_ void senf::GenericAddressingPolicy<Address>::bind(FileHandle handle,
100 do_bind(handle,addr.sockaddr_p(),addr.sockaddr_len());
101 } catch (SystemException & e) {
102 e << "; could not bind to address \"" << addr << "\"";
107 ///////////////////////////////cti.e///////////////////////////////////////
114 // c-file-style: "senf"
115 // indent-tabs-mode: nil
116 // ispell-local-dictionary: "american"
117 // compile-command: "scons -u ../test"
118 // comment-column: 40