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 inline non-template implementation */
29 #include <senf/Utils/senfassert.hh>
30 #include "FdManager.hh"
32 #define prefix_ inline
33 ///////////////////////////////cci.p///////////////////////////////////////
35 ///////////////////////////////////////////////////////////////////////////
36 // senf::scheduler::FdEvent
38 prefix_ senf::scheduler::FdEvent::FdEvent(std::string const & name, Callback const & cb)
39 : detail::FIFORunner::TaskInfo (name), cb_ (cb), fd_ (-1), pollable_ (true), events_ (0)
42 prefix_ senf::scheduler::FdEvent::~FdEvent()
44 if (detail::FdDispatcher::alive())
48 prefix_ senf::scheduler::FdEvent & senf::scheduler::FdEvent::action(Callback const & cb)
54 prefix_ senf::scheduler::FdEvent & senf::scheduler::FdEvent::addEvents(int e)
56 events( events() | e );
60 prefix_ senf::scheduler::FdEvent & senf::scheduler::FdEvent::removeEvents(int e)
62 events( events() & ~e );
66 prefix_ int senf::scheduler::FdEvent::events()
71 ///////////////////////////////////////////////////////////////////////////
72 // senf::scheduler::detail::FdDispatcher
74 prefix_ senf::scheduler::detail::FdDispatcher::FdDispatcher()
77 prefix_ bool senf::scheduler::detail::FdDispatcher::empty()
83 ///////////////////////////////////////////////////////////////////////////
84 // senf::scheduler::detail::FileDispatcher
86 prefix_ void senf::scheduler::detail::FileDispatcher::timeout(int t)
90 detail::FdManager::instance().timeout(managerTimeout_);
93 prefix_ int senf::scheduler::detail::FileDispatcher::timeout()
96 return managerTimeout_;
99 prefix_ bool senf::scheduler::detail::FileDispatcher::empty()
105 ///////////////////////////////////////////////////////////////////////////
107 prefix_ int senf::scheduler::detail::retrieve_filehandle(int fd)
112 ///////////////////////////////cci.e///////////////////////////////////////
119 // comment-column: 40
120 // c-file-style: "senf"
121 // indent-tabs-mode: nil
122 // ispell-local-dictionary: "american"
123 // compile-command: "scons -u test"