Utils/Logger: Correct newline handling in IOStreamLogger
[senf.git] / Utils / Logger / Target.cci
1 // $Id$
2 //
3 // Copyright (C) 2007 
4 // Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS)
5 // Kompetenzzentrum fuer Satelitenkommunikation (SatCom)
6 //     Stefan Bund <g0dil@berlios.de>
7 //
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.
12 //
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.
17 //
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.
22
23 /** \file
24     \brief Target inline non-template implementation */
25
26 //#include "Target.ih"
27
28 // Custom includes
29 #include <algorithm>
30
31 #define prefix_ inline
32 ///////////////////////////////cci.p///////////////////////////////////////
33
34 ///////////////////////////////////////////////////////////////////////////
35 // senf::log::Target
36
37 prefix_ iterator senf::log::Target::begin()
38     const
39 {
40     return rib_.begin();
41 }
42
43 prefix_ iterator senf::log::Target::end()
44     const
45 {
46     return rib_.end();
47 }
48
49 ///////////////////////////////////////////////////////////////////////////
50 // senf::log::Target::RoutingEntry
51
52 prefix_ senf::log::Target::RoutingEntry::RoutingEntry(detail::StreamBase const * stream,
53                                                       detail::AreaBase const * area,
54                                                       unsigned level, action_t action)
55     : stream_(stream), area_(area), level_(level), action_(action) 
56 {}
57
58 prefix_ senf::log::Target::RoutingEntry::RoutingEntry()
59     : stream_(0), area_(0), level_(0), action_(ACCEPT) 
60 {}
61
62 prefix_ bool senf::log::Target::RoutingEntry::operator==(RoutingEntry const & other)
63
64     return 
65         stream_ == other.stream_ && 
66         area_ == other.area_ && 
67         level_ == other.level_ &&
68         action_ == other.action_; 
69 }
70
71 prefix_ std::string senf::log::Target::RoutingEntry::stream()
72     const
73 {
74     return stream_->v_name();
75 }
76
77 prefix_ std::string senf::log::Target::RoutingEntry::area()
78     const
79 {
80     return area_->v_name();
81 }
82
83 prefix_ unsigned senf::log::Target::RoutingEntry::level()
84     const
85 {
86     return level_;
87 }
88
89 prefix_ senf::log::Target::action_t senf::log::Target::RoutingEntry::action()
90     const
91 {
92     return action_;
93 }
94
95 ///////////////////////////////////////////////////////////////////////////
96 // senf::log::TargetRegistry
97
98 prefix_ void senf::log::TargetRegistry::registerTarget(Target * target)
99 {
100     targets_.insert(target);
101 }
102
103 prefix_ void senf::log::TargetRegistry::unregisterTarget(Target * target)
104 {
105     targets_.erase(target);
106 }
107
108 /////////////////////////////cci.e///////////////////////////////////////
109 #undef prefix_
110
111 \f
112 // Local Variables:
113 // mode: c++
114 // fill-column: 100
115 // comment-column: 40
116 // c-file-style: "senf"
117 // indent-tabs-mode: nil
118 // ispell-local-dictionary: "american"
119 // compile-command: "scons -u test"
120 // End: