3 // Copyright (C) 2006 Stefan Bund <g0dil@berlios.de>
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.
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.
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.
22 \brief ReadHelper internal header */
24 #ifndef IH_SENF_Scheduler_ReadHelper_
25 #define IH_SENF_Scheduler_ReadHelper_ 1
29 ///////////////////////////////ih.p////////////////////////////////////////
34 /** \brief Abstract predicate interface
37 template <class Handle>
38 struct ReadHelper<Handle>::InternalPredicate
40 virtual ~InternalPredicate() {}
42 /** \brief template to runtime polymorphic barrier for the predicate interface
45 \implementation This class will provide a polymorphic
46 wrapper around the non-polymorphic ReadHelper
47 predicate. This is used, so the predicate can be
48 specified as an arbitrary callable object (even a
49 boost::function or a Boost.Lambda expression) without
50 imposing any inheritance relationship on the predicate
52 template <class Predicate>
54 : public ReadHelper<Handle>::InternalPredicate
56 Dispatcher(Predicate p) : predicate(p) {}
57 virtual std::string::size_type operator()(std::string const & data);
61 virtual std::string::size_type operator()(std::string const & data) = 0;
67 ///////////////////////////////ih.e////////////////////////////////////////
74 // c-file-style: "senf"
75 // indent-tabs-mode: nil
76 // ispell-local-dictionary: "american"
77 // compile-command: "scons -u test"