OFFIS DCMTK
Version 3.6.0
Main Page
Related Pages
Classes
Files
File List
File Members
oflog
include
dcmtk
oflog
spi
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"
28
#include "
dcmtk/oflog/helpers/pointer.h
"
29
#include "
dcmtk/oflog/helpers/property.h
"
30
#include "
dcmtk/oflog/spi/logevent.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
121
FilterPtr
next
;
122
};
123
124
125
134
class
LOG4CPLUS_EXPORT
DenyAllFilter
:
public
Filter
{
135
public
:
136
DenyAllFilter
();
137
DenyAllFilter
(
const
log4cplus::helpers::Properties
&,
log4cplus::tstring
& error);
138
143
virtual
FilterResult decide(
const
InternalLoggingEvent
& event)
const
;
144
};
145
146
158
class
LOG4CPLUS_EXPORT
LogLevelMatchFilter
:
public
Filter
{
159
public
:
160
LogLevelMatchFilter
();
161
LogLevelMatchFilter
(
const
log4cplus::helpers::Properties
& p,
log4cplus::tstring
&);
162
173
virtual
FilterResult decide(
const
InternalLoggingEvent
& event)
const
;
174
175
private
:
176
// Methods
177
void
init();
178
179
// Data
181
bool
acceptOnMatch
;
182
LogLevel logLevelToMatch;
183
};
184
185
186
212
class
LOG4CPLUS_EXPORT
LogLevelRangeFilter
:
public
Filter
{
213
public
:
214
// ctors
215
LogLevelRangeFilter
();
216
LogLevelRangeFilter
(
const
log4cplus::helpers::Properties
& p,
log4cplus::tstring
& error);
217
221
virtual
FilterResult decide(
const
InternalLoggingEvent
& event)
const
;
222
223
private
:
224
// Methods
225
void
init();
226
227
// Data
229
bool
acceptOnMatch
;
230
LogLevel logLevelMin;
231
LogLevel logLevelMax;
232
};
233
234
235
247
class
LOG4CPLUS_EXPORT
StringMatchFilter
:
public
Filter
{
248
public
:
249
// ctors
250
StringMatchFilter
();
251
StringMatchFilter
(
const
log4cplus::helpers::Properties
& p,
log4cplus::tstring
& error);
252
256
virtual
FilterResult decide(
const
InternalLoggingEvent
& event)
const
;
257
258
private
:
259
// Methods
260
void
init();
261
262
// Data
264
bool
acceptOnMatch
;
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