Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
include
log4cpp
threading
DummyThreads.hh
Go to the documentation of this file.
1
/*
2
* DummyThreads.hh
3
*
4
* Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
5
* Copyright 2002, Bastiaan Bakker. All rights reserved.
6
*
7
* See the COPYING file for the terms of usage and distribution.
8
*/
9
10
#ifndef _LOG4CPP_THREADING_DUMMYTHREADS_HH
11
#define _LOG4CPP_THREADING_DUMMYTHREADS_HH
12
13
#include <
log4cpp/Portability.hh
>
14
#include <stdio.h>
15
#include <string>
16
17
namespace
log4cpp
{
18
namespace
threading {
19
std::string
getThreadId
();
28
char
*
getThreadId
(
char
* buffer);
29
34
typedef
int
Mutex
;
35
39
typedef
int
ScopedLock
;
40
41
template
<
typename
T>
class
ThreadLocalDataHolder {
42
public
:
43
typedef
T
data_type
;
44
45
inline
ThreadLocalDataHolder
() {};
46
inline
~ThreadLocalDataHolder
() {
47
if
(
_data
)
48
delete
_data
;
49
};
50
51
inline
T*
get
()
const
{
52
return
_data
;
53
};
54
55
inline
T*
operator->
()
const
{
return
get
(); };
56
inline
T&
operator*
()
const
{
return
*
get
(); };
57
58
inline
T*
release
() {
59
T* result =
_data
;
60
_data
= NULL;
61
62
return
result;
63
};
64
65
inline
void
reset
(T* p = NULL) {
66
if
(
_data
)
67
delete
_data
;
68
_data
= p;
69
};
70
71
private
:
72
T*
_data
;
73
};
74
}
75
}
76
#endif
log4cpp::threading::ThreadLocalDataHolder::operator*
T & operator*() const
Definition:
DummyThreads.hh:56
log4cpp::threading::ThreadLocalDataHolder::~ThreadLocalDataHolder
~ThreadLocalDataHolder()
Definition:
DummyThreads.hh:46
log4cpp::threading::ThreadLocalDataHolder::data_type
T data_type
Definition:
DummyThreads.hh:43
log4cpp::threading::getThreadId
static std::string getThreadId()
Definition:
BoostThreads.hh:22
log4cpp::threading::ThreadLocalDataHolder::_data
T * _data
Definition:
DummyThreads.hh:69
Portability.hh
log4cpp::threading::ThreadLocalDataHolder::operator->
T * operator->() const
Definition:
DummyThreads.hh:55
log4cpp::threading::ThreadLocalDataHolder::ThreadLocalDataHolder
ThreadLocalDataHolder()
Definition:
DummyThreads.hh:45
log4cpp::threading::ThreadLocalDataHolder::release
T * release()
Definition:
DummyThreads.hh:58
log4cpp
Definition:
AbortAppender.hh:16
log4cpp::threading::Mutex
boost::mutex Mutex
Definition:
BoostThreads.hh:37
log4cpp::threading::ThreadLocalDataHolder::reset
void reset(T *p=NULL)
Definition:
DummyThreads.hh:65
log4cpp::threading::ScopedLock
boost::mutex::scoped_lock ScopedLock
Definition:
BoostThreads.hh:40
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