3 // Copyright (C) 2006 Stefan Bund <g0dil@berlios.de>
5 // The contents of this file are subject to the Fraunhofer FOKUS Public License
6 // Version 1.0 (the "License"); you may not use this file except in compliance
7 // with the License. You may obtain a copy of the License at
8 // http://senf.berlios.de/license.html
10 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
11 // but modifies the Mozilla Public License Version 1.1.
12 // See the full license text for the amendments.
14 // Software distributed under the License is distributed on an "AS IS" basis,
15 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
16 // for the specific language governing rights and limitations under the License.
18 // The Original Code is Fraunhofer FOKUS code.
20 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
21 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
22 // All Rights Reserved.
28 \brief ReadHelper inline template implementation */
30 #include "ReadHelper.ih"
33 #include <senf/Utils/Exception.hh>
35 #define prefix_ inline
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
38 template <class Handle>
39 prefix_ typename senf::ReadHelper<Handle>::ptr
40 senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
43 return ptr(new ReadHelper(handle, maxSize, 0, callback));
46 template <class Handle>
47 template <class Predicate>
48 prefix_ typename senf::ReadHelper<Handle>::ptr
49 senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
50 Predicate const & predicate, Callback callback)
52 return ptr(new ReadHelper(handle, maxSize,
53 new typename InternalPredicate::template Dispatcher<Predicate>(predicate),
57 template <class Handle>
58 prefix_ Handle senf::ReadHelper<Handle>::handle()
64 template <class Handle>
65 prefix_ std::string::size_type senf::ReadHelper<Handle>::maxSize()
71 template <class Handle>
72 prefix_ std::string const & senf::ReadHelper<Handle>::data()
78 template <class Handle>
79 prefix_ std::string const & senf::ReadHelper<Handle>::tail()
85 template <class Handle>
86 prefix_ bool senf::ReadHelper<Handle>::complete()
92 template <class Handle>
93 prefix_ bool senf::ReadHelper<Handle>::error()
99 template <class Handle>
100 prefix_ void senf::ReadHelper<Handle>::throw_error()
103 if (errno_ != 0) throw SystemException(errno_ SENF_EXC_DEBUGINFO);
106 //-/////////////////////////////////////////////////////////////////////////////////////////////////
113 // c-file-style: "senf"
114 // indent-tabs-mode: nil
115 // ispell-local-dictionary: "american"
116 // compile-command: "scons -u test"
117 // comment-column: 40