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 non-inline non-template implementation */
26 #include "AreaRegistry.hh"
27 #include "AreaRegistry.ih"
32 //#include "AreaRegistry.mpp"
34 ///////////////////////////////cc.p////////////////////////////////////////
36 ///////////////////////////////////////////////////////////////////////////
37 // senf::log::detail::AreaBase
39 prefix_ senf::log::detail::AreaBase::~AreaBase()
42 prefix_ void senf::log::detail::AreaBase::updateRoutingCache(Target & target,
43 StreamBase const & stream,
47 if (stream.index >= routingCache_.size())
48 routingCache_.resize(stream.index+1);
50 Routes::iterator i (routingCache_[stream.index].routes.begin());
51 Routes::iterator const i_end (routingCache_[stream.index].routes.end());
52 for (; i != i_end; ++i) {
53 if (i->target == &target) {
61 routingCache_[stream.index].routes.push_back(RouteEntry(limit, &target));
63 for (; i != i_end; ++i)
66 routingCache_[stream.index].limit = l;
69 prefix_ void senf::log::detail::AreaBase::removeRoutingCache(Target & target,
70 StreamBase const & stream)
73 if (stream.index >= routingCache_.size())
75 unsigned l (DISABLED::value);
76 Routes::iterator i (routingCache_[stream.index].routes.begin());
77 Routes::iterator const i_end (routingCache_[stream.index].routes.end());
79 if (i->target == &target)
80 i = routingCache_[stream.index].routes.erase(i);
87 routingCache_[stream.index].limit = l;
90 prefix_ void senf::log::detail::AreaBase::write(time_type timestamp,
91 StreamBase const & stream, unsigned level,
92 std::string const & msg)
95 if (stream.index >= routingCache_.size())
97 Routes::iterator i (routingCache_[stream.index].routes.begin());
98 Routes::iterator const i_end (routingCache_[stream.index].routes.end());
99 for (; i != i_end; ++i)
100 i->target->write(timestamp, stream, *this, level, msg);
103 ///////////////////////////////cc.e////////////////////////////////////////
105 //#include "AreaRegistry.mpp"
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"