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 ClientSocketHandle internal header */
17 #ifndef IH_SENF_Socket_ClientSocketHandle_
18 #define IH_SENF_Socket_ClientSocketHandle_ 1
21 #include <senf/Utils/IteratorTraits.hh>
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
28 //-/////////////////////////////////////////////////////////////////////////////////////////////
29 // senf::detail::ReadRange
31 /** \brief Internal: Choose optimal read implementation
35 If the range iterator is a contiguous_storage_iterator, the data is *directly* read into the
36 range, otherwise a temporary storage area is used.
38 template <class Handle, class ForwardWritableRange, bool IsContiguous>
41 static typename boost::range_iterator<ForwardWritableRange>::type
42 read(Handle & handle, ForwardWritableRange & range);
44 static typename boost::range_iterator<ForwardWritableRange>::type
45 readfrom(Handle & handle, ForwardWritableRange & range, typename Handle::Address & addr);
50 template <class Handle, class ForwardWritableRange>
51 struct ReadRange<Handle, ForwardWritableRange, true>
53 static typename boost::range_iterator<ForwardWritableRange>::type
54 read(Handle & handle, ForwardWritableRange & range);
56 static typename boost::range_iterator<ForwardWritableRange>::type
57 readfrom(Handle & handle, ForwardWritableRange & range, typename Handle::Address & addr);
62 //-/////////////////////////////////////////////////////////////////////////////////////////////
63 // senf::detail::WriteRange
65 /** \brief Internal: Choose optimal write implementation
69 If the range iterator is a contiguous_storage_iterator, the data is *directly* written from
70 the range, otherwise a temporary storage area is used.
72 template <class Handle, class ForwardReadableRange, bool IsContiguous>
75 static typename boost::range_const_iterator<ForwardReadableRange>::type
76 write(Handle & handle, ForwardReadableRange & range);
78 static typename boost::range_const_iterator<ForwardReadableRange>::type
79 writeto(Handle & handle, ForwardReadableRange & range,
80 typename Handle::Address const & addr);
85 template <class Handle, class ForwardReadableRange>
86 struct WriteRange<Handle, ForwardReadableRange, true>
88 static typename boost::range_const_iterator<ForwardReadableRange>::type
89 write(Handle & handle, ForwardReadableRange & range);
91 static typename boost::range_const_iterator<ForwardReadableRange>::type
92 writeto(Handle & handle, ForwardReadableRange & range,
93 typename Handle::Address const & addr);
100 //-/////////////////////////////////////////////////////////////////////////////////////////////////
107 // c-file-style: "senf"
108 // indent-tabs-mode: nil
109 // ispell-local-dictionary: "american"
110 // compile-command: "scons -u test"
111 // comment-column: 40