Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
Filter.cpp
Go to the documentation of this file.
1
/*
2
* Filter.cpp
3
*
4
* Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5
* Copyright 2001, Bastiaan Bakker. All rights reserved.
6
*
7
* See the COPYING file for the terms of usage and distribution.
8
*/
9
10
#include "
PortabilityImpl.hh
"
11
#include <
log4cpp/Filter.hh
>
12
13
namespace
log4cpp
{
14
15
Filter::Filter
() :
16
_chainedFilter(NULL) {
17
}
18
19
Filter::~Filter
() {
20
if
(
_chainedFilter
)
21
delete
_chainedFilter
;
22
}
23
24
void
Filter::setChainedFilter
(
Filter
* filter) {
25
if
(filter !=
_chainedFilter
) {
26
if
(
_chainedFilter
)
27
delete
_chainedFilter
;
28
29
_chainedFilter
= filter;
30
}
31
}
32
33
Filter
*
Filter::getChainedFilter
() {
34
return
_chainedFilter
;
35
}
36
37
Filter
*
Filter::getEndOfChain
() {
38
Filter
* end =
this
;
39
while
(end->
getChainedFilter
()) {
40
end = end->
getChainedFilter
();
41
}
42
return
end;
43
}
44
45
void
Filter::appendChainedFilter
(
Filter
* filter) {
46
Filter
* end =
getEndOfChain
();
47
end->
setChainedFilter
(filter);
48
}
49
50
Filter::Decision
Filter::decide
(
const
LoggingEvent
& event) {
51
Filter::Decision
decision =
_decide
(event);
52
53
if
((
Filter::NEUTRAL
== decision) &&
getChainedFilter
()) {
54
decision =
getChainedFilter
()->
decide
(event);
55
}
56
57
return
decision;
58
}
59
60
}
Filter.hh
log4cpp::Filter::_decide
virtual Decision _decide(const LoggingEvent &event)=0
log4cpp::Filter::decide
virtual Decision decide(const LoggingEvent &event)
Definition:
Filter.cpp:50
log4cpp::Filter::setChainedFilter
virtual void setChainedFilter(Filter *filter)
Definition:
Filter.cpp:24
PortabilityImpl.hh
log4cpp::Filter
Definition:
Filter.hh:49
log4cpp::Filter::Filter
Filter()
Definition:
Filter.cpp:15
log4cpp::Filter::Decision
Decision
Definition:
Filter.hh:52
log4cpp::Filter::appendChainedFilter
virtual void appendChainedFilter(Filter *filter)
Definition:
Filter.cpp:45
log4cpp::Filter::~Filter
virtual ~Filter()
Definition:
Filter.cpp:19
log4cpp::Filter::NEUTRAL
Definition:
Filter.hh:53
log4cpp::Filter::getEndOfChain
virtual Filter * getEndOfChain()
Definition:
Filter.cpp:37
log4cpp
Definition:
AbortAppender.hh:16
log4cpp::LoggingEvent
Definition:
LoggingEvent.hh:32
log4cpp::Filter::getChainedFilter
virtual Filter * getChainedFilter()
Definition:
Filter.cpp:33
log4cpp::Filter::_chainedFilter
Filter * _chainedFilter
Definition:
Filter.hh:113
log4cpp
Author(s): Stephen Roderick, Bastiaan Bakker, Cedric Le Goater, Steve Ostlind, Marcel Harkema, Walter Stroebel, Glenn Scott and Tony Cheung
autogenerated on Sun Jun 23 2019 19:14:17