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 AreaRegistry inline non-template implementation */
26 #include "AreaRegistry.ih"
29 #include "../TypeInfo.hh"
31 #include "StreamRegistry.hh"
33 #define prefix_ inline
34 ///////////////////////////////cci.p///////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////////
37 // senf::log::AreaRegistry
39 prefix_ std::string const &
40 senf::log::AreaRegistry::SelectName::operator()(Registry::value_type const & v)
46 prefix_ senf::log::AreaRegistry::AreaRegistry()
49 prefix_ senf::log::AreaRegistry::iterator senf::log::AreaRegistry::begin()
51 return boost::make_transform_iterator(registry_.begin(), SelectName());
54 prefix_ senf::log::AreaRegistry::iterator senf::log::AreaRegistry::end()
56 return boost::make_transform_iterator(registry_.end(), SelectName());
59 prefix_ void senf::log::AreaRegistry::registerArea(detail::AreaBase const & area)
61 registry_.insert( std::make_pair(area.v_name(), &area) );
64 prefix_ senf::log::detail::AreaBase const *
65 senf::log::AreaRegistry::lookup(std::string const & name)
67 Registry::iterator i (registry_.find(name));
68 return i == registry_.end() ? 0 : i->second;
71 ///////////////////////////////////////////////////////////////////////////
72 // senf::log::detail::AreaBase
74 prefix_ std::string senf::log::detail::AreaBase::fullName()
77 return prettyName(typeid(*this));
80 prefix_ std::string senf::log::detail::AreaBase::v_name()
86 prefix_ void senf::log::detail::AreaBase::init()
88 senf::log::AreaRegistry::instance().registerArea(*this);
91 prefix_ bool senf::log::detail::AreaBase::alive()
97 prefix_ unsigned senf::log::detail::AreaBase::limit(StreamBase const & stream)
100 return stream.index >= routingCache_.size() ?
101 DISABLED::value : routingCache_[stream.index].limit;
104 ///////////////////////////////cci.e///////////////////////////////////////
111 // comment-column: 40
112 // c-file-style: "senf"
113 // indent-tabs-mode: nil
114 // ispell-local-dictionary: "american"
115 // compile-command: "scons -u test"