StringQueueAppender.cpp
Go to the documentation of this file.
1 /*
2  * StringQueueAppender.cpp
3  *
4  * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5  * Copyright 2000, Bastiaan Bakker. All rights reserved.
6  *
7  * See the COPYING file for the terms of usage and distribution.
8  */
9 
10 #include "PortabilityImpl.hh"
12 
13 namespace log4cpp {
14 
15  StringQueueAppender::StringQueueAppender(const std::string& name) :
16  LayoutAppender(name) {
17  }
18 
20  close();
21  }
22 
24  // empty
25  }
26 
28  _queue.push(_getLayout().format(event));
29  }
30 
32  return true;
33  }
34 
35  std::queue<std::string>& StringQueueAppender::getQueue() {
36  return _queue;
37  }
38 
39  const std::queue<std::string>& StringQueueAppender::getQueue() const {
40  return _queue;
41  }
42 
44  return getQueue().size();
45  }
46 
48  std::string message;
49 
50  if (!_queue.empty()) {
51  message = _queue.front();
52  _queue.pop();
53  }
54 
55  return message;
56  }
57 }
virtual std::string popMessage()
StringQueueAppender(const std::string &name)
virtual std::queue< std::string > & getQueue()
virtual void _append(const LoggingEvent &event)
std::queue< std::string > _queue
virtual size_t queueSize() const


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