log4cpp  1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BufferingAppender.hh
Go to the documentation of this file.
1 #if !defined(h_ebd0ee89_622d_4af1_9a9d_d0e057debe86)
2 #define h_ebd0ee89_622d_4af1_9a9d_d0e057debe86
3 
6 #include <list>
7 #include <memory>
8 
9 namespace log4cpp
10 {
12  {
13  public:
14  BufferingAppender(const std::string name, unsigned long max_size, std::auto_ptr<Appender> sink,
15  std::auto_ptr<TriggeringEventEvaluator> evaluator);
16 
17  virtual void close() { sink_->close(); }
18 
19  bool getLossy() const { return lossy_; }
20  void setLossy(bool lossy) { lossy_ = lossy; }
21 
22  protected:
23  virtual void _append(const LoggingEvent& event);
24 
25  private:
26  typedef std::list<LoggingEvent> queue_t;
27 
28  queue_t queue_;
29  unsigned long max_size_;
30  std::auto_ptr<Appender> sink_;
31  std::auto_ptr<TriggeringEventEvaluator> evaluator_;
32  bool lossy_;
33 
34  void dump();
35  };
36 }
37 
38 #endif // h_ebd0ee89_622d_4af1_9a9d_d0e057debe86
bool getLossy() const
Definition: BufferingAppender.hh:19
#define LOG4CPP_EXPORT
Definition: Export.hh:19
The internal representation of logging events.
Definition: LoggingEvent.hh:32
Definition: BufferingAppender.hh:11
LayoutAppender is a common superclass for all Appenders that require a Layout.
Definition: LayoutAppender.hh:24
virtual void close()
Release any resources allocated within the appender such as file handles, network connections...
Definition: BufferingAppender.hh:17
void setLossy(bool lossy)
Definition: BufferingAppender.hh:20