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 Target inline non-template implementation */
34 #include "AreaRegistry.hh"
36 #define prefix_ inline
37 //-/////////////////////////////////////////////////////////////////////////////////////////////////
39 //-/////////////////////////////////////////////////////////////////////////////////////////////////
42 prefix_ void senf::log::Target::route(action_t action, int index)
44 route(0, 0, NONE::value, action, index);
47 prefix_ void senf::log::Target::unroute(action_t action)
49 unroute(0, 0, NONE::value, action);
52 prefix_ senf::log::Target::iterator senf::log::Target::begin()
58 prefix_ senf::log::Target::iterator senf::log::Target::end()
64 prefix_ senf::log::Target::RoutingEntry const & senf::log::Target::operator[](size_type i)
70 prefix_ senf::log::Target::size_type senf::log::Target::size()
76 prefix_ bool senf::log::Target::empty()
82 //-/////////////////////////////////////////////////////////////////////////////////////////////////
83 // senf::log::Target::RoutingEntry
85 prefix_ senf::log::Target::RoutingEntry::RoutingEntry(detail::StreamBase const * stream,
86 detail::AreaBase const * area,
87 unsigned level, action_t action)
88 : stream_(stream), area_(area), level_(level), action_(action)
91 prefix_ senf::log::Target::RoutingEntry::RoutingEntry()
92 : stream_(0), area_(0), level_(0), action_(ACCEPT)
95 prefix_ bool senf::log::Target::RoutingEntry::operator==(RoutingEntry const & other)
99 stream_ == other.stream_ &&
100 area_ == other.area_ &&
101 level_ == other.level_ &&
102 action_ == other.action_;
105 prefix_ std::string senf::log::Target::RoutingEntry::stream()
108 return stream_ ? stream_->v_name() : "";
111 prefix_ std::string senf::log::Target::RoutingEntry::area()
114 return area_ ? area_->v_name() : "";
117 prefix_ unsigned senf::log::Target::RoutingEntry::level()
123 prefix_ senf::log::Target::action_t senf::log::Target::RoutingEntry::action()
129 //-/////////////////////////////////////////////////////////////////////////////////////////////////
130 // senf::log::detail::TargetRegistry
132 prefix_ void senf::log::detail::TargetRegistry::routed()
134 fallbackRouting_ = false;
137 prefix_ bool senf::log::detail::TargetRegistry::fallbackRouting()
139 return fallbackRouting_;
142 prefix_ senf::console::ScopedDirectory<> & senf::log::detail::TargetRegistry::consoleDir()
144 return consoleDir_();
147 //-/////////////////////////////////////////////////////////////////////////////////////////////////
150 prefix_ void senf::log::detail::TargetRegistry::unregisterTarget(Target * target)
152 targets_.erase(target);
155 //-/////////////////////////////////////////////////////////////////////////////////////////////////
162 // comment-column: 40
163 // c-file-style: "senf"
164 // indent-tabs-mode: nil
165 // ispell-local-dictionary: "american"
166 // compile-command: "scons -u test"