OFFIS DCMTK  Version 3.6.0
filter.h
Go to the documentation of this file.
1 // Module: Log4CPLUS
2 // File: filter.h
3 // Created: 5/2003
4 // Author: Tad E. Smith
5 //
6 //
7 // Copyright 1999-2009 Tad E. Smith
8 //
9 // Licensed under the Apache License, Version 2.0 (the "License");
10 // you may not use this file except in compliance with the License.
11 // You may obtain a copy of the License at
12 //
13 // http://www.apache.org/licenses/LICENSE-2.0
14 //
15 // Unless required by applicable law or agreed to in writing, software
16 // distributed under the License is distributed on an "AS IS" BASIS,
17 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 // See the License for the specific language governing permissions and
19 // limitations under the License.
20 
24 #ifndef LOG4CPLUS_SPI_FILTER_HEADER_
25 #define LOG4CPLUS_SPI_FILTER_HEADER_
26 
27 #include "dcmtk/oflog/config.h"
31 
32 
33 namespace log4cplus {
34  namespace spi {
35 
36 
37  enum FilterResult { DENY,
40  NEUTRAL,
44  ACCEPT
47  };
48 
49  // Forward Declarations
50  class Filter;
51 
52 
58  LOG4CPLUS_EXPORT FilterResult checkFilter(const Filter* filter,
59  const InternalLoggingEvent& event);
60 
61  typedef helpers::SharedObjectPtr<Filter> FilterPtr;
62 
63 
91  class LOG4CPLUS_EXPORT Filter
92  : public virtual log4cplus::helpers::SharedObject
93  {
94  public:
95  // ctor and dtor
96  Filter();
97  virtual ~Filter();
98 
99  // Methods
103  void appendFilter(FilterPtr filter);
104 
115  virtual FilterResult decide(const InternalLoggingEvent& event) const = 0;
116 
117  // Data
122  };
123 
124 
125 
134  class LOG4CPLUS_EXPORT DenyAllFilter : public Filter {
135  public:
136  DenyAllFilter ();
138 
143  virtual FilterResult decide(const InternalLoggingEvent& event) const;
144  };
145 
146 
158  class LOG4CPLUS_EXPORT LogLevelMatchFilter : public Filter {
159  public:
162 
173  virtual FilterResult decide(const InternalLoggingEvent& event) const;
174 
175  private:
176  // Methods
177  void init();
178 
179  // Data
182  LogLevel logLevelToMatch;
183  };
184 
185 
186 
212  class LOG4CPLUS_EXPORT LogLevelRangeFilter : public Filter {
213  public:
214  // ctors
217 
221  virtual FilterResult decide(const InternalLoggingEvent& event) const;
222 
223  private:
224  // Methods
225  void init();
226 
227  // Data
230  LogLevel logLevelMin;
231  LogLevel logLevelMax;
232  };
233 
234 
235 
247  class LOG4CPLUS_EXPORT StringMatchFilter : public Filter {
248  public:
249  // ctors
252 
256  virtual FilterResult decide(const InternalLoggingEvent& event) const;
257 
258  private:
259  // Methods
260  void init();
261 
262  // Data
265  log4cplus::tstring stringToMatch;
266  };
267 
268  } // end namespace spi
269 } // end namespace log4cplus
270 
271 #endif /* LOG4CPLUS_SPI_FILTER_HEADER_ */
272 
273 


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2