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 ClientSocketHandle internal header */
26 #ifndef IH_SENF_Socket_ClientSocketHandle_
27 #define IH_SENF_Socket_ClientSocketHandle_ 1
30 #include <senf/Utils/IteratorTraits.hh>
32 ///////////////////////////////ih.p////////////////////////////////////////
37 ///////////////////////////////////////////////////////////////////////
38 // senf::detail::ReadRange
40 /** \brief Internal: Choose optimal read implementation
44 If the range iterator is a contiguous_storage_iterator, the data is *directly* read into the
45 range, otherwise a temporary storage area is used.
47 template <class Handle, class ForwardWritableRange, bool IsContiguous>
50 static typename boost::range_iterator<ForwardWritableRange>::type
51 read(Handle & handle, ForwardWritableRange & range);
53 static typename boost::range_iterator<ForwardWritableRange>::type
54 readfrom(Handle & handle, ForwardWritableRange & range, typename Handle::Address & addr);
59 template <class Handle, class ForwardWritableRange>
60 struct ReadRange<Handle, ForwardWritableRange, true>
62 static typename boost::range_iterator<ForwardWritableRange>::type
63 read(Handle & handle, ForwardWritableRange & range);
65 static typename boost::range_iterator<ForwardWritableRange>::type
66 readfrom(Handle & handle, ForwardWritableRange & range, typename Handle::Address & addr);
71 ///////////////////////////////////////////////////////////////////////
72 // senf::detail::WriteRange
74 /** \brief Internal: Choose optimal write implementation
78 If the range iterator is a contiguous_storage_iterator, the data is *directly* written from
79 the range, otherwise a temporary storage area is used.
81 template <class Handle, class ForwardReadableRange, bool IsContiguous>
84 static typename boost::range_const_iterator<ForwardReadableRange>::type
85 write(Handle & handle, ForwardReadableRange & range);
87 static typename boost::range_const_iterator<ForwardReadableRange>::type
88 writeto(Handle & handle, ForwardReadableRange & range,
89 typename Handle::Address const & addr);
94 template <class Handle, class ForwardReadableRange>
95 struct WriteRange<Handle, ForwardReadableRange, true>
97 static typename boost::range_const_iterator<ForwardReadableRange>::type
98 write(Handle & handle, ForwardReadableRange & range);
100 static typename boost::range_const_iterator<ForwardReadableRange>::type
101 writeto(Handle & handle, ForwardReadableRange & range,
102 typename Handle::Address const & addr);
109 ///////////////////////////////ih.e////////////////////////////////////////
116 // c-file-style: "senf"
117 // indent-tabs-mode: nil
118 // ispell-local-dictionary: "american"
119 // compile-command: "scons -u test"
120 // comment-column: 40