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