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 ReadHelper inline template implementation */
17 #include "ReadHelper.ih"
20 #include <senf/Utils/Exception.hh>
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 template <class Handle>
26 prefix_ typename senf::ReadHelper<Handle>::ptr
27 senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
30 return ptr(new ReadHelper(handle, maxSize, 0, callback));
33 template <class Handle>
34 template <class Predicate>
35 prefix_ typename senf::ReadHelper<Handle>::ptr
36 senf::ReadHelper<Handle>::dispatch(Handle handle, std::string::size_type maxSize,
37 Predicate const & predicate, Callback callback)
39 return ptr(new ReadHelper(handle, maxSize,
40 new typename InternalPredicate::template Dispatcher<Predicate>(predicate),
44 template <class Handle>
45 prefix_ Handle senf::ReadHelper<Handle>::handle()
51 template <class Handle>
52 prefix_ std::string::size_type senf::ReadHelper<Handle>::maxSize()
58 template <class Handle>
59 prefix_ std::string const & senf::ReadHelper<Handle>::data()
65 template <class Handle>
66 prefix_ std::string const & senf::ReadHelper<Handle>::tail()
72 template <class Handle>
73 prefix_ bool senf::ReadHelper<Handle>::complete()
79 template <class Handle>
80 prefix_ bool senf::ReadHelper<Handle>::error()
86 template <class Handle>
87 prefix_ void senf::ReadHelper<Handle>::throw_error()
90 if (errno_ != 0) throw SystemException(errno_ SENF_EXC_DEBUGINFO);
93 //-/////////////////////////////////////////////////////////////////////////////////////////////////
100 // c-file-style: "senf"
101 // indent-tabs-mode: nil
102 // ispell-local-dictionary: "american"
103 // compile-command: "scons -u test"
104 // comment-column: 40