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 bool operator()(FdEvent const & a, int b) const
54 bool operator()(int a, FdEvent const & b) const
59 : public senf::singleton<FdDispatcher>
62 using senf::singleton<FdDispatcher>::instance;
63 using senf::singleton<FdDispatcher>::alive;
65 bool add(FdEvent & event);
66 void remove(FdEvent & event);
76 typedef boost::intrusive::imultiset< FdSetBase::value_traits<FdEvent>,
82 friend void senf::scheduler::restart();
83 friend class singleton<FdDispatcher>;
84 friend class senf::scheduler::FdEvent;
88 : public senf::singleton<FileDispatcher>
91 using senf::singleton<FileDispatcher>::instance;
92 using senf::singleton<FileDispatcher>::alive;
94 void add(FdEvent & event);
95 void remove(FdEvent & event);
99 // Called by IdleEventDispatcher
111 // We really only need a list here but we need to use the same event structure used by
113 typedef boost::intrusive::imultiset< FdSetBase::value_traits<FdEvent>,
120 friend void senf::scheduler::restart();
121 friend class singleton<FileDispatcher>;
124 template <class Handle>
125 int get_descriptor(Handle const & handle);
127 int retrieve_filehandle(int fd);
131 //-/////////////////////////////////////////////////////////////////////////////////////////////////
138 // comment-column: 40
139 // c-file-style: "senf"
140 // indent-tabs-mode: nil
141 // ispell-local-dictionary: "american"
142 // compile-command: "scons -u test"