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 Target inline non-template implementation */
29 #include "AreaRegistry.hh"
31 #define prefix_ inline
32 ///////////////////////////////cci.p///////////////////////////////////////
34 ///////////////////////////////////////////////////////////////////////////
37 prefix_ void senf::log::Target::route(action_t action, int index)
39 route(0, 0, NONE::value, action, index);
42 prefix_ void senf::log::Target::unroute(action_t action)
44 unroute(0, 0, NONE::value, action);
47 prefix_ senf::log::Target::iterator senf::log::Target::begin()
53 prefix_ senf::log::Target::iterator senf::log::Target::end()
59 prefix_ senf::log::Target::RoutingEntry const & senf::log::Target::operator[](size_type i)
65 prefix_ senf::log::Target::size_type senf::log::Target::size()
71 prefix_ bool senf::log::Target::empty()
77 ///////////////////////////////////////////////////////////////////////////
78 // senf::log::Target::RoutingEntry
80 prefix_ senf::log::Target::RoutingEntry::RoutingEntry(detail::StreamBase const * stream,
81 detail::AreaBase const * area,
82 unsigned level, action_t action)
83 : stream_(stream), area_(area), level_(level), action_(action)
86 prefix_ senf::log::Target::RoutingEntry::RoutingEntry()
87 : stream_(0), area_(0), level_(0), action_(ACCEPT)
90 prefix_ bool senf::log::Target::RoutingEntry::operator==(RoutingEntry const & other)
94 stream_ == other.stream_ &&
95 area_ == other.area_ &&
96 level_ == other.level_ &&
97 action_ == other.action_;
100 prefix_ std::string senf::log::Target::RoutingEntry::stream()
103 return stream_ ? stream_->v_name() : "";
106 prefix_ std::string senf::log::Target::RoutingEntry::area()
109 return area_ ? area_->v_name() : "";
112 prefix_ unsigned senf::log::Target::RoutingEntry::level()
118 prefix_ senf::log::Target::action_t senf::log::Target::RoutingEntry::action()
124 ///////////////////////////////////////////////////////////////////////////
125 // senf::log::detail::TargetRegistry
127 prefix_ void senf::log::detail::TargetRegistry::routed()
129 fallbackRouting_ = false;
132 prefix_ bool senf::log::detail::TargetRegistry::fallbackRouting()
134 return fallbackRouting_;
137 ////////////////////////////////////////
140 prefix_ senf::log::detail::TargetRegistry::TargetRegistry()
141 : fallbackRouting_(true)
144 prefix_ void senf::log::detail::TargetRegistry::registerTarget(Target * target)
146 targets_.insert(target);
149 prefix_ void senf::log::detail::TargetRegistry::unregisterTarget(Target * target)
151 targets_.erase(target);
154 /////////////////////////////cci.e///////////////////////////////////////
161 // comment-column: 40
162 // c-file-style: "senf"
163 // indent-tabs-mode: nil
164 // ispell-local-dictionary: "american"
165 // compile-command: "scons -u test"