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 
16  _chainedFilter(NULL) {
17  }
18 
20  if (_chainedFilter)
21  delete _chainedFilter;
22  }
23 
25  if (filter != _chainedFilter) {
26  if (_chainedFilter)
27  delete _chainedFilter;
28 
29  _chainedFilter = filter;
30  }
31  }
32 
34  return _chainedFilter;
35  }
36 
38  Filter* end = this;
39  while(end->getChainedFilter()) {
40  end = end->getChainedFilter();
41  }
42  return end;
43  }
44 
46  Filter* end = getEndOfChain();
47  end->setChainedFilter(filter);
48  }
49 
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 }
virtual Decision _decide(const LoggingEvent &event)=0
virtual Decision decide(const LoggingEvent &event)
Definition: Filter.cpp:50
virtual void setChainedFilter(Filter *filter)
Definition: Filter.cpp:24
virtual void appendChainedFilter(Filter *filter)
Definition: Filter.cpp:45
virtual ~Filter()
Definition: Filter.cpp:19
virtual Filter * getEndOfChain()
Definition: Filter.cpp:37
virtual Filter * getChainedFilter()
Definition: Filter.cpp:33
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