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 internal header */
17 #ifndef IH_SENF_Scheduler_ReadHelper_
18 #define IH_SENF_Scheduler_ReadHelper_ 1
22 //-/////////////////////////////////////////////////////////////////////////////////////////////////
27 /** \brief Abstract predicate interface
30 template <class Handle>
31 struct ReadHelper<Handle>::InternalPredicate
33 virtual ~InternalPredicate() {}
35 /** \brief template to runtime polymorphic barrier for the predicate interface
38 \implementation This class will provide a polymorphic
39 wrapper around the non-polymorphic ReadHelper
40 predicate. This is used, so the predicate can be
41 specified as an arbitrary callable object (even a
42 boost::function or a Boost.Lambda expression) without
43 imposing any inheritance relationship on the predicate
45 template <class Predicate>
48 virtual std::string::size_type operator()(std::string const & data) = 0;
51 template <class Handle>
52 template <class Predicate>
53 struct ReadHelper<Handle>::InternalPredicate::Dispatcher
54 : public ReadHelper<Handle>::InternalPredicate
56 Dispatcher(Predicate p) : predicate(p) {}
57 virtual std::string::size_type operator()(std::string const & data);
63 //-/////////////////////////////////////////////////////////////////////////////////////////////////
70 // c-file-style: "senf"
71 // indent-tabs-mode: nil
72 // ispell-local-dictionary: "american"
73 // compile-command: "scons -u test"