2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief ReadPolicy and WritePolicy inline template implementation
18 //#include "ReadWritePolicy.ih"
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 template <class SPolicy>
27 prefix_ unsigned senf::ReadablePolicy::
28 readfrom(ClientSocketHandle<SPolicy> & handle, char * buffer, unsigned size,
29 typename SPolicy::AddressingPolicy::Address & address,
30 typename IfCommunicationPolicyIs<SPolicy,UnconnectedCommunicationPolicy>::type *)
32 return do_readfrom(handle, buffer, size, address.sockaddr_p(), address.socklen_p());
35 template <class SPolicy>
36 prefix_ unsigned senf::ReadablePolicy::
37 readfrom(ClientSocketHandle<SPolicy> & handle, char * buffer, unsigned size,
38 typename Policy::AddressingPolicy::Address & address)
43 template <class SPolicy>
44 prefix_ unsigned senf::WriteablePolicy::
45 write(ClientSocketHandle<SPolicy> & handle, char const * buffer, unsigned size,
46 typename IfCommunicationPolicyIs<SPolicy,ConnectedCommunicationPolicy>::type *)
48 return do_write(handle,buffer,size);
51 template <class SPolicy>
52 prefix_ unsigned senf::WriteablePolicy::
53 write(ClientSocketHandle<SPolicy> & handle, char const * buffer, unsigned size)
58 template <class SPolicy>
59 prefix_ unsigned senf::WriteablePolicy::
60 writeto(ClientSocketHandle<SPolicy> & handle,
61 typename boost::call_traits<typename SPolicy::AddressingPolicy::Address>::param_type addr,
62 char const * buffer, unsigned size,
63 typename IfCommunicationPolicyIs<SPolicy,UnconnectedCommunicationPolicy>::type *)
65 return do_writeto(handle, buffer, size, addr.sockaddr_p(), addr.socklen());
68 template <class SPolicy>
69 prefix_ unsigned senf::WriteablePolicy::
70 writeto(ClientSocketHandle<SPolicy> & handle,
71 typename Policy::AddressingPolicy::Address const & addr,
72 char const * buffer, unsigned size)
76 //-/////////////////////////////////////////////////////////////////////////////////////////////////
83 // c-file-style: "senf"
84 // indent-tabs-mode: nil
85 // ispell-local-dictionary: "american"
86 // compile-command: "scons -u test"