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 EventManager inline non-template implementation */
26 //#include "EventManager.ih"
30 #define prefix_ inline
31 ///////////////////////////////cci.p///////////////////////////////////////
33 ///////////////////////////////////////////////////////////////////////////
34 // senf::scheduler::detail::Event
36 prefix_ senf::scheduler::detail::Event::Event(std::string const & name)
37 : name_ (name), runCount_ (0u)
39 EventManager::instance().add(*this);
42 prefix_ senf::scheduler::detail::Event::~Event()
44 EventManager::instance().remove(*this);
47 prefix_ void senf::scheduler::detail::EventManager::add(Event & event)
49 events_.push_back(event);
52 prefix_ void senf::scheduler::detail::EventManager::remove(Event & event)
54 events_.erase(EventList::current(event));
57 prefix_ std::string const & senf::scheduler::detail::Event::name()
63 prefix_ bool senf::scheduler::detail::Event::enabled()
69 prefix_ unsigned senf::scheduler::detail::Event::runCount()
75 prefix_ char const * senf::scheduler::detail::Event::type()
81 prefix_ std::string senf::scheduler::detail::Event::info()
87 prefix_ void senf::scheduler::detail::Event::countRun()
92 ///////////////////////////////////////////////////////////////////////////
93 // senf::scheduler::detail::EventManager
95 prefix_ bool senf::scheduler::detail::EventManager::IteratorFilter::operator()(Event const & e)
100 prefix_ senf::scheduler::detail::EventManager::iterator
101 senf::scheduler::detail::EventManager::begin()
104 // We need to filter out elements with e.type() == 0 ... the NullTask temporarily added
105 // by the FIFORunner is such an element and must be skipped.
106 return boost::make_filter_iterator(
107 IteratorFilter(), events_.begin(), events_.end());
110 prefix_ senf::scheduler::detail::EventManager::iterator
111 senf::scheduler::detail::EventManager::end()
114 return boost::make_filter_iterator(
115 IteratorFilter(), events_.end(), events_.end());
118 ///////////////////////////////cci.e///////////////////////////////////////
125 // comment-column: 40
126 // c-file-style: "senf"
127 // indent-tabs-mode: nil
128 // ispell-local-dictionary: "american"
129 // compile-command: "scons -u test"