Move include files in debian packge into 'senf' subdirectory
[senf.git] / Socket / ClientSocketHandle.ih
1 // Copyright (C) 2007 
2 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
3 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
4 //     Stefan Bund <g0dil@berlios.de>
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU General Public License as published by
8 // the Free Software Foundation; either version 2 of the License, or
9 // (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20
21 /** \file
22     \brief ClientSocketHandle internal header */
23
24 #ifndef IH_ClientSocketHandle_
25 #define IH_ClientSocketHandle_ 1
26
27 // Custom includes
28 #include "../Utils/IteratorTraits.hh"
29
30 ///////////////////////////////ih.p////////////////////////////////////////
31
32 namespace senf {
33 namespace detail {
34
35     ///////////////////////////////////////////////////////////////////////
36     // senf::detail::ReadRange
37
38     /** \brief Internal: Choose optimal read implementation
39
40         \internal
41
42         If the range iterator is a contiguous_storage_iterator, the data is *directly* read into the
43         range, otherwise a temporary storage area is used.
44      */
45     template <class Handle, class ForwardWritableRange, bool IsContiguous>
46     struct ReadRange 
47     {
48         static typename boost::range_iterator<ForwardWritableRange>::type
49         read(Handle & handle, ForwardWritableRange & range);
50
51         static typename boost::range_iterator<ForwardWritableRange>::type
52         readfrom(Handle & handle, ForwardWritableRange & range, typename Handle::Address & addr);
53     };
54
55 #   ifndef DOXYGEN
56
57     template <class Handle, class ForwardWritableRange>
58     struct ReadRange<Handle, ForwardWritableRange, true>
59     {
60         static typename boost::range_iterator<ForwardWritableRange>::type
61         read(Handle & handle, ForwardWritableRange & range);
62
63         static typename boost::range_iterator<ForwardWritableRange>::type
64         readfrom(Handle & handle, ForwardWritableRange & range, typename Handle::Address & addr);
65     };
66
67 #   endif
68
69     ///////////////////////////////////////////////////////////////////////
70     // senf::detail::WriteRange
71
72     /** \brief Internal: Choose optimal write implementation
73
74         \internal
75
76         If the range iterator is a contiguous_storage_iterator, the data is *directly* written from
77         the range, otherwise a temporary storage area is used.
78      */
79     template <class Handle, class ForwardReadableRange, bool IsContiguous>
80     struct WriteRange
81     {
82         static typename boost::range_iterator<ForwardReadableRange>::type
83         write(Handle & handle, ForwardReadableRange & range);
84         
85         static typename boost::range_iterator<ForwardReadableRange>::type
86         writeto(Handle & handle, ForwardReadableRange & range,
87                 typename Handle::Address const & addr);
88     };
89
90 #   ifndef DOXYGEN
91
92     template <class Handle, class ForwardReadableRange>
93     struct WriteRange<Handle, ForwardReadableRange, true>
94     {
95         static typename boost::range_const_iterator<ForwardReadableRange>::type
96         write(Handle & handle, ForwardReadableRange & range);
97         
98         static typename boost::range_const_iterator<ForwardReadableRange>::type
99         writeto(Handle & handle, ForwardReadableRange & range,
100                 typename Handle::Address const & addr);
101     };
102
103 #   endif
104
105 }}
106
107 ///////////////////////////////ih.e////////////////////////////////////////
108 #endif
109
110 \f
111 // Local Variables:
112 // mode: c++
113 // fill-column: 100
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
119 // End: