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 EventManager inline non-template implementation */
31 //#include "EventManager.ih"
35 #define prefix_ inline
36 //-/////////////////////////////////////////////////////////////////////////////////////////////////
38 //-/////////////////////////////////////////////////////////////////////////////////////////////////
39 // senf::scheduler::detail::Event
41 prefix_ senf::scheduler::detail::Event::Event(std::string const & name)
42 : name_ (name), runCount_ (0u)
44 EventManager::instance().add(*this);
47 prefix_ senf::scheduler::detail::Event::~Event()
49 EventManager::instance().remove(*this);
52 prefix_ void senf::scheduler::detail::EventManager::add(Event & event)
54 events_.push_back(event);
57 prefix_ void senf::scheduler::detail::EventManager::remove(Event & event)
59 events_.erase(EventList::current(event));
62 prefix_ std::string const & senf::scheduler::detail::Event::name()
68 prefix_ bool senf::scheduler::detail::Event::enabled()
74 prefix_ unsigned senf::scheduler::detail::Event::runCount()
80 prefix_ char const * senf::scheduler::detail::Event::type()
86 prefix_ std::string senf::scheduler::detail::Event::info()
92 prefix_ void senf::scheduler::detail::Event::countRun()
97 //-/////////////////////////////////////////////////////////////////////////////////////////////////
98 // senf::scheduler::detail::EventManager
100 prefix_ bool senf::scheduler::detail::EventManager::IteratorFilter::operator()(Event const & e)
102 return e.type() != 0;
105 prefix_ senf::scheduler::detail::EventManager::iterator
106 senf::scheduler::detail::EventManager::begin()
109 // We need to filter out elements with e.type() == 0 ... the NullTask temporarily added
110 // by the FIFORunner is such an element and must be skipped.
111 return boost::make_filter_iterator(
112 IteratorFilter(), events_.begin(), events_.end());
115 prefix_ senf::scheduler::detail::EventManager::iterator
116 senf::scheduler::detail::EventManager::end()
119 return boost::make_filter_iterator(
120 IteratorFilter(), events_.end(), events_.end());
123 //-/////////////////////////////////////////////////////////////////////////////////////////////////
130 // comment-column: 40
131 // c-file-style: "senf"
132 // indent-tabs-mode: nil
133 // ispell-local-dictionary: "american"
134 // compile-command: "scons -u test"