4 // Fraunhofer Institute for Open Communication Systems (FOKUS)
5 // Competence Center NETwork research (NET), St. Augustin, GERMANY
6 // Stefan Bund <g0dil@berlios.de>
8 // This program is free software; you can redistribute it and/or modify
9 // it under the terms of the GNU General Public License as published by
10 // the Free Software Foundation; either version 2 of the License, or
11 // (at your option) any later version.
13 // This program is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 // GNU General Public License for more details.
18 // You should have received a copy of the GNU General Public License
19 // along with this program; if not, write to the
20 // Free Software Foundation, Inc.,
21 // 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
24 \brief FdDispatcher internal header */
26 #ifndef IH_SENF_Scheduler_FdEvent_
27 #define IH_SENF_Scheduler_FdEvent_ 1
30 #include <boost/intrusive/iset.hpp>
32 ///////////////////////////////ih.p////////////////////////////////////////
42 bool operator()(FdEvent const & a, FdEvent const & b) const
43 { return a.fd_ < b.fd_; }
47 bool operator()(FdEvent const & a, int b) const
49 bool operator()(int a, FdEvent const & b) const
54 : public senf::singleton<FdDispatcher>
57 using senf::singleton<FdDispatcher>::instance;
58 using senf::singleton<FdDispatcher>::alive;
60 bool add(FdEvent & event);
61 void remove(FdEvent & event);
71 typedef boost::intrusive::imultiset< FdSetBase::value_traits<FdEvent>,
77 friend void senf::scheduler::restart();
78 friend class singleton<FdDispatcher>;
79 friend class senf::scheduler::FdEvent;
83 : public senf::singleton<FileDispatcher>
86 using senf::singleton<FileDispatcher>::instance;
87 using senf::singleton<FileDispatcher>::alive;
89 void add(FdEvent & event);
90 void remove(FdEvent & event);
94 // Called by IdleEventDispatcher
106 // We really only need a list here but we need to use the same event structure used by
108 typedef boost::intrusive::imultiset< FdSetBase::value_traits<FdEvent>,
115 friend void senf::scheduler::restart();
116 friend class singleton<FileDispatcher>;
119 template <class Handle>
120 int get_descriptor(Handle const & handle);
122 int retrieve_filehandle(int fd);
126 ///////////////////////////////ih.e////////////////////////////////////////
133 // comment-column: 40
134 // c-file-style: "senf"
135 // indent-tabs-mode: nil
136 // ispell-local-dictionary: "american"
137 // compile-command: "scons -u test"