Fix documentation build under maverick (doxygen 1.7.1)
[senf.git] / senf / Scheduler / ReadHelper.cti
1 // $Id$
2 //
3 // Copyright (C) 2006 Stefan Bund <g0dil@berlios.de>
4 //
5 // This program is free software; you can redistribute it and/or modify
6 // it under the terms of the GNU General Public License as published by
7 // the Free Software Foundation; either version 2 of the License, or
8 // (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the
17 // Free Software Foundation, Inc.,
18 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
19 // Copyright (C) 2006
20
21 /** \file
22     \brief ReadHelper inline template implementation */
23
24 #include "ReadHelper.ih"
25
26 // Custom includes
27 #include <senf/Utils/Exception.hh>
28
29 #define prefix_ inline
30 //-/////////////////////////////////////////////////////////////////////////////////////////////////
31
32 template <class Handle>
33 prefix_ typename senf::ReadHelper<Handle>::ptr
34 senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
35                                           Callback callback)
36 {
37     return ptr(new ReadHelper(handle, maxSize, 0, callback));
38 }
39
40 template <class Handle>
41 template <class Predicate>
42 prefix_ typename senf::ReadHelper<Handle>::ptr
43 senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
44                                    Predicate const & predicate, Callback callback)
45 {
46     return ptr(new ReadHelper(handle, maxSize,
47                               new typename InternalPredicate::template Dispatcher<Predicate>(predicate),
48                               callback));
49 }
50
51 template <class Handle>
52 prefix_ Handle senf::ReadHelper<Handle>::handle()
53     const
54 {
55     return handle_;
56 }
57
58 template <class Handle>
59 prefix_ std::string::size_type senf::ReadHelper<Handle>::maxSize()
60     const
61 {
62     return maxSize_;
63 }
64
65 template <class Handle>
66 prefix_ std::string const & senf::ReadHelper<Handle>::data()
67     const
68 {
69     return data_;
70 }
71
72 template <class Handle>
73 prefix_ std::string const & senf::ReadHelper<Handle>::tail()
74     const
75 {
76     return tail_;
77 }
78
79 template <class Handle>
80 prefix_ bool senf::ReadHelper<Handle>::complete()
81     const
82 {
83     return complete_;
84 }
85
86 template <class Handle>
87 prefix_ bool senf::ReadHelper<Handle>::error()
88     const
89 {
90     return errno_ != 0;
91 }
92
93 template <class Handle>
94 prefix_ void senf::ReadHelper<Handle>::throw_error()
95     const
96 {
97     if (errno_ != 0) throw SystemException(errno_ SENF_EXC_DEBUGINFO);
98 }
99
100 //-/////////////////////////////////////////////////////////////////////////////////////////////////
101 #undef prefix_
102
103 \f
104 // Local Variables:
105 // mode: c++
106 // fill-column: 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
112 // End: