00001 /* 00002 * Filter.hh 00003 * 00004 * Copyright 2001, LifeLine Networks BV (www.lifeline.nl). All rights reserved. 00005 * Copyright 2001, Bastiaan Bakker. All rights reserved. 00006 * 00007 * See the COPYING file for the terms of usage and distribution. 00008 */ 00009 00010 #ifndef _LOG4CPP_FILTER_HH 00011 #define _LOG4CPP_FILTER_HH 00012 00013 #include <log4cpp/Portability.hh> 00014 #include <log4cpp/LoggingEvent.hh> 00015 00016 LOG4CPP_NS_BEGIN 00017 00049 class LOG4CPP_EXPORT Filter { 00050 public: 00051 00052 typedef enum { 00053 DENY = -1, 00054 NEUTRAL = 0, 00055 ACCEPT = 1 00056 } Decision; 00057 00061 Filter(); 00062 00066 virtual ~Filter(); 00067 00072 virtual void setChainedFilter(Filter* filter); 00073 00079 virtual Filter* getChainedFilter(); 00080 00085 virtual Filter* getEndOfChain(); 00086 00092 virtual void appendChainedFilter(Filter* filter); 00093 00101 virtual Decision decide(const LoggingEvent& event); 00102 00103 protected: 00111 virtual Decision _decide(const LoggingEvent& event) = 0; 00112 00113 private: 00114 Filter* _chainedFilter; 00115 00116 }; 00117 00118 LOG4CPP_NS_END 00119 00120 #endif // _LOG4CPP_FILTER_HH