4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
6 // The contents of this file are subject to the Fraunhofer FOKUS Public License
7 // Version 1.0 (the "License"); you may not use this file except in compliance
8 // with the License. You may obtain a copy of the License at
9 // http://senf.berlios.de/license.html
11 // The Fraunhofer FOKUS Public License Version 1.0 is based on,
12 // but modifies the Mozilla Public License Version 1.1.
13 // See the full license text for the amendments.
15 // Software distributed under the License is distributed on an "AS IS" basis,
16 // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
17 // for the specific language governing rights and limitations under the License.
19 // The Original Code is Fraunhofer FOKUS code.
21 // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V.
22 // (registered association), Hansastraße 27 c, 80686 Munich, Germany.
23 // All Rights Reserved.
26 // Stefan Bund <g0dil@berlios.de>
29 \brief FdDispatcher internal header */
31 #ifndef IH_SENF_Scheduler_FdEvent_
32 #define IH_SENF_Scheduler_FdEvent_ 1
35 #include <senf/boost_intrusive/iset.hpp>
37 //-/////////////////////////////////////////////////////////////////////////////////////////////////
47 bool operator()(FdEvent const & a, FdEvent const & b) const
48 { return a.fd_ < b.fd_; }
52 : public senf::singleton<FdDispatcher>
55 using senf::singleton<FdDispatcher>::instance;
56 using senf::singleton<FdDispatcher>::alive;
58 bool add(FdEvent & event);
59 void remove(FdEvent & event);
69 typedef boost::intrusive::imultiset< FdSetBase::value_traits<FdEvent>,
75 friend void senf::scheduler::restart();
76 friend class singleton<FdDispatcher>;
77 friend class senf::scheduler::FdEvent;
81 : public senf::singleton<FileDispatcher>
84 using senf::singleton<FileDispatcher>::instance;
85 using senf::singleton<FileDispatcher>::alive;
87 void add(FdEvent & event);
88 void remove(FdEvent & event);
92 // Called by IdleEventDispatcher
104 // We really only need a list here but we need to use the same event structure used by
106 typedef boost::intrusive::imultiset< FdSetBase::value_traits<FdEvent>,
113 friend void senf::scheduler::restart();
114 friend class singleton<FileDispatcher>;
117 template <class Handle>
118 int get_descriptor(Handle const & handle);
120 int retrieve_filehandle(int fd);
124 //-/////////////////////////////////////////////////////////////////////////////////////////////////
131 // comment-column: 40
132 // c-file-style: "senf"
133 // indent-tabs-mode: nil
134 // ispell-local-dictionary: "american"
135 // compile-command: "scons -u test"