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 AreaRegistry non-inline non-template implementation */
31 #include "AreaRegistry.hh"
32 #include "AreaRegistry.ih"
37 //#include "AreaRegistry.mpp"
39 //-/////////////////////////////////////////////////////////////////////////////////////////////////
41 //-/////////////////////////////////////////////////////////////////////////////////////////////////
42 // senf::log::detail::AreaBase
44 prefix_ senf::log::detail::AreaBase::AreaBase()
48 prefix_ senf::log::detail::AreaBase::~AreaBase()
53 prefix_ void senf::log::detail::AreaBase::updateRoutingCache(Target & target,
54 StreamBase const & stream,
58 if (stream.index >= routingCache_.size())
59 routingCache_.resize(stream.index+1);
61 Routes::iterator i (routingCache_[stream.index].routes.begin());
62 Routes::iterator const i_end (routingCache_[stream.index].routes.end());
63 for (; i != i_end; ++i) {
64 if (i->target == &target) {
72 routingCache_[stream.index].routes.push_back(RouteEntry(limit, &target));
74 for (; i != i_end; ++i)
77 routingCache_[stream.index].limit = l;
80 prefix_ void senf::log::detail::AreaBase::removeRoutingCache(Target & target,
81 StreamBase const & stream)
84 if (stream.index >= routingCache_.size())
86 unsigned l (DISABLED::value);
87 Routes::iterator i (routingCache_[stream.index].routes.begin());
88 Routes::iterator const i_end (routingCache_[stream.index].routes.end());
90 if (i->target == &target)
91 i = routingCache_[stream.index].routes.erase(i);
98 routingCache_[stream.index].limit = l;
101 prefix_ void senf::log::detail::AreaBase::write(time_type timestamp,
102 StreamBase const & stream, unsigned level,
103 std::string const & msg)
106 if (stream.index >= routingCache_.size())
108 Routes::iterator i (routingCache_[stream.index].routes.begin());
109 Routes::iterator const i_end (routingCache_[stream.index].routes.end());
110 for (; i != i_end; ++i)
111 i->target->write(timestamp, stream, *this, level, msg);
114 //-/////////////////////////////////////////////////////////////////////////////////////////////////
116 //#include "AreaRegistry.mpp"
122 // comment-column: 40
123 // c-file-style: "senf"
124 // indent-tabs-mode: nil
125 // ispell-local-dictionary: "american"
126 // compile-command: "scons -u test"