// $Id$ // // Copyright (C) 2007 // Fraunhofer Institute for Open Communication Systems (FOKUS) // // The contents of this file are subject to the Fraunhofer FOKUS Public License // Version 1.0 (the "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // http://senf.berlios.de/license.html // // The Fraunhofer FOKUS Public License Version 1.0 is based on, // but modifies the Mozilla Public License Version 1.1. // See the full license text for the amendments. // // Software distributed under the License is distributed on an "AS IS" basis, // WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License // for the specific language governing rights and limitations under the License. // // The Original Code is Fraunhofer FOKUS code. // // The Initial Developer of the Original Code is Fraunhofer-Gesellschaft e.V. // (registered association), Hansastraße 27 c, 80686 Munich, Germany. // All Rights Reserved. // // Contributor(s): // Stefan Bund /** \file \brief Target inline non-template implementation */ #include "Target.ih" // Custom includes #include "AreaRegistry.hh" #define prefix_ inline //-///////////////////////////////////////////////////////////////////////////////////////////////// //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::log::Target prefix_ void senf::log::Target::route(action_t action, int index) { route(0, 0, NONE::value, action, index); } prefix_ void senf::log::Target::unroute(action_t action) { unroute(0, 0, NONE::value, action); } prefix_ senf::log::Target::iterator senf::log::Target::begin() const { return rib_.begin(); } prefix_ senf::log::Target::iterator senf::log::Target::end() const { return rib_.end(); } prefix_ senf::log::Target::RoutingEntry const & senf::log::Target::operator[](size_type i) const { return rib_[i]; } prefix_ senf::log::Target::size_type senf::log::Target::size() const { return rib_.size(); } prefix_ bool senf::log::Target::empty() const { return rib_.empty(); } //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::log::Target::RoutingEntry prefix_ senf::log::Target::RoutingEntry::RoutingEntry(detail::StreamBase const * stream, detail::AreaBase const * area, unsigned level, action_t action) : stream_(stream), area_(area), level_(level), action_(action) {} prefix_ senf::log::Target::RoutingEntry::RoutingEntry() : stream_(0), area_(0), level_(0), action_(ACCEPT) {} prefix_ bool senf::log::Target::RoutingEntry::operator==(RoutingEntry const & other) const { return stream_ == other.stream_ && area_ == other.area_ && level_ == other.level_ && action_ == other.action_; } prefix_ std::string senf::log::Target::RoutingEntry::stream() const { return stream_ ? stream_->v_name() : ""; } prefix_ std::string senf::log::Target::RoutingEntry::area() const { return area_ ? area_->v_name() : ""; } prefix_ unsigned senf::log::Target::RoutingEntry::level() const { return level_; } prefix_ senf::log::Target::action_t senf::log::Target::RoutingEntry::action() const { return action_; } //-///////////////////////////////////////////////////////////////////////////////////////////////// // senf::log::detail::TargetRegistry prefix_ void senf::log::detail::TargetRegistry::routed() { fallbackRouting_ = false; } prefix_ bool senf::log::detail::TargetRegistry::fallbackRouting() { return fallbackRouting_; } prefix_ senf::console::ScopedDirectory<> & senf::log::detail::TargetRegistry::consoleDir() { return consoleDir_(); } //-///////////////////////////////////////////////////////////////////////////////////////////////// // private members prefix_ void senf::log::detail::TargetRegistry::unregisterTarget(Target * target) { targets_.erase(target); } //-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ // Local Variables: // mode: c++ // fill-column: 100 // comment-column: 40 // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" // compile-command: "scons -u test" // End: