2 // Copyright (c) 2020 Fraunhofer Institute for Applied Information Technology (FIT)
3 // Network Research Group (NET)
4 // Schloss Birlinghoven, 53754 Sankt Augustin, GERMANY
5 // Contact: support@wiback.org
7 // This file is part of the SENF code tree.
8 // It is licensed under the 3-clause BSD License (aka New BSD License).
9 // See LICENSE.txt in the top level directory for details or visit
10 // https://opensource.org/licenses/BSD-3-Clause
15 \brief Target inline non-template implementation */
20 #include "AreaRegistry.hh"
22 #define prefix_ inline
23 //-/////////////////////////////////////////////////////////////////////////////////////////////////
25 //-/////////////////////////////////////////////////////////////////////////////////////////////////
28 prefix_ void senf::log::Target::route(action_t action, int index)
30 route(nullptr, nullptr, NONE::value, action, index);
33 prefix_ void senf::log::Target::unroute(action_t action)
35 unroute(nullptr, nullptr, NONE::value, action);
38 prefix_ senf::log::Target::iterator senf::log::Target::begin()
44 prefix_ senf::log::Target::iterator senf::log::Target::end()
50 prefix_ senf::log::Target::RoutingEntry const & senf::log::Target::operator[](size_type i)
56 prefix_ senf::log::Target::size_type senf::log::Target::size()
62 prefix_ bool senf::log::Target::empty()
68 //-/////////////////////////////////////////////////////////////////////////////////////////////////
69 // senf::log::Target::RoutingEntry
71 prefix_ senf::log::Target::RoutingEntry::RoutingEntry(detail::StreamBase const * stream,
72 detail::AreaBase const * area,
73 unsigned level, action_t action)
74 : stream_(stream), area_(area), level_(level), action_(action)
77 prefix_ senf::log::Target::RoutingEntry::RoutingEntry()
78 : stream_(nullptr), area_(nullptr), level_(0), action_(ACCEPT)
81 prefix_ bool senf::log::Target::RoutingEntry::operator==(RoutingEntry const & other)
85 stream_ == other.stream_ &&
86 area_ == other.area_ &&
87 level_ == other.level_ &&
88 action_ == other.action_;
91 prefix_ std::string senf::log::Target::RoutingEntry::stream()
94 return stream_ ? stream_->v_name() : "";
97 prefix_ std::string senf::log::Target::RoutingEntry::area()
100 return area_ ? area_->v_name() : "";
103 prefix_ unsigned senf::log::Target::RoutingEntry::level()
109 prefix_ senf::log::Target::action_t senf::log::Target::RoutingEntry::action()
115 //-/////////////////////////////////////////////////////////////////////////////////////////////////
116 // senf::log::detail::TargetRegistry
118 prefix_ void senf::log::detail::TargetRegistry::routed()
120 fallbackRouting_ = false;
123 prefix_ bool senf::log::detail::TargetRegistry::fallbackRouting()
125 return fallbackRouting_;
128 prefix_ senf::console::ScopedDirectory<> & senf::log::detail::TargetRegistry::consoleDir()
130 return consoleDir_();
133 //-/////////////////////////////////////////////////////////////////////////////////////////////////
136 prefix_ void senf::log::detail::TargetRegistry::unregisterTarget(Target * target)
138 targets_.erase(target);
141 //-/////////////////////////////////////////////////////////////////////////////////////////////////
148 // comment-column: 40
149 // c-file-style: "senf"
150 // indent-tabs-mode: nil
151 // ispell-local-dictionary: "american"
152 // compile-command: "scons -u test"