2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief FdDispatcher inline non-template implementation */
20 #include "FdManager.hh"
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
26 // senf::scheduler::FdEvent
28 prefix_ senf::scheduler::FdEvent::FdEvent(std::string const & name, Callback const & cb)
29 : detail::FIFORunner::TaskInfo (name), cb_ (cb), fd_ (-1), pollable_ (true), events_ (0),
33 prefix_ senf::scheduler::FdEvent::~FdEvent()
35 if (detail::FdDispatcher::alive())
39 prefix_ senf::scheduler::FdEvent & senf::scheduler::FdEvent::action(Callback const & cb)
45 prefix_ senf::scheduler::FdEvent & senf::scheduler::FdEvent::addEvents(int e)
47 events( events() | e );
51 prefix_ senf::scheduler::FdEvent & senf::scheduler::FdEvent::removeEvents(int e)
53 events( events() & ~e );
57 prefix_ int senf::scheduler::FdEvent::events()
62 //-/////////////////////////////////////////////////////////////////////////////////////////////////
63 // senf::scheduler::detail::FdDispatcher
65 prefix_ senf::scheduler::detail::FdDispatcher::FdDispatcher()
68 prefix_ bool senf::scheduler::detail::FdDispatcher::empty()
74 //-/////////////////////////////////////////////////////////////////////////////////////////////////
75 // senf::scheduler::detail::FileDispatcher
77 prefix_ void senf::scheduler::detail::FileDispatcher::timeout(int t)
81 detail::FdManager::instance().timeout(managerTimeout_);
84 prefix_ int senf::scheduler::detail::FileDispatcher::timeout()
87 return managerTimeout_;
90 prefix_ bool senf::scheduler::detail::FileDispatcher::empty()
96 //-/////////////////////////////////////////////////////////////////////////////////////////////////
98 prefix_ int senf::scheduler::detail::retrieve_filehandle(int fd)
103 //-/////////////////////////////////////////////////////////////////////////////////////////////////
110 // comment-column: 40
111 // c-file-style: "senf"
112 // indent-tabs-mode: nil
113 // ispell-local-dictionary: "american"
114 // compile-command: "scons -u test"