Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
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
"
11
#include <
log4cpp/StringQueueAppender.hh
>
12
13
namespace
log4cpp
{
14
15
StringQueueAppender::StringQueueAppender
(
const
std::string& name) :
16
LayoutAppender
(name) {
17
}
18
19
StringQueueAppender::~StringQueueAppender
() {
20
close
();
21
}
22
23
void
StringQueueAppender::close
() {
24
// empty
25
}
26
27
void
StringQueueAppender::_append
(
const
LoggingEvent
& event) {
28
_queue
.push(
_getLayout
().format(event));
29
}
30
31
bool
StringQueueAppender::reopen
() {
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
43
size_t
StringQueueAppender::queueSize
()
const
{
44
return
getQueue
().size();
45
}
46
47
std::string
StringQueueAppender::popMessage
() {
48
std::string message;
49
50
if
(!
_queue
.empty()) {
51
message =
_queue
.front();
52
_queue
.pop();
53
}
54
55
return
message;
56
}
57
}
log4cpp::StringQueueAppender::popMessage
virtual std::string popMessage()
Definition:
StringQueueAppender.cpp:47
PortabilityImpl.hh
log4cpp::StringQueueAppender::reopen
virtual bool reopen()
Definition:
StringQueueAppender.cpp:31
log4cpp::StringQueueAppender::StringQueueAppender
StringQueueAppender(const std::string &name)
Definition:
StringQueueAppender.cpp:15
log4cpp::StringQueueAppender::~StringQueueAppender
virtual ~StringQueueAppender()
Definition:
StringQueueAppender.cpp:19
log4cpp::StringQueueAppender::close
virtual void close()
Definition:
StringQueueAppender.cpp:23
log4cpp::StringQueueAppender::getQueue
virtual std::queue< std::string > & getQueue()
Definition:
StringQueueAppender.cpp:35
log4cpp::LayoutAppender::_getLayout
Layout & _getLayout()
Definition:
LayoutAppender.cpp:36
log4cpp
Definition:
AbortAppender.hh:16
log4cpp::StringQueueAppender::_append
virtual void _append(const LoggingEvent &event)
Definition:
StringQueueAppender.cpp:27
log4cpp::LoggingEvent
Definition:
LoggingEvent.hh:32
log4cpp::StringQueueAppender::_queue
std::queue< std::string > _queue
Definition:
StringQueueAppender.hh:68
log4cpp::StringQueueAppender::queueSize
virtual size_t queueSize() const
Definition:
StringQueueAppender.cpp:43
StringQueueAppender.hh
log4cpp::LayoutAppender
Definition:
LayoutAppender.hh:24
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:10:00