log4cpp
1.1.6
Toggle main menu visibility
Loading...
Searching...
No Matches
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
();
20
25
typedef
int
Mutex
;
26
30
typedef
int
ScopedLock
;
31
32
template
<
typename
T>
class
ThreadLocalDataHolder
{
33
public
:
34
typedef
T
data_type
;
35
36
inline
ThreadLocalDataHolder
() {};
37
inline
~ThreadLocalDataHolder
() {
38
if
(_data)
39
delete
_data;
40
};
41
42
inline
T*
get
()
const
{
43
return
_data;
44
};
45
46
inline
T*
operator->
()
const
{
47
return
get
();
48
};
49
inline
T&
operator*
()
const
{
50
return
*
get
();
51
};
52
53
inline
T*
release
() {
54
T* result = _data;
55
_data = NULL;
56
57
return
result;
58
};
59
60
inline
void
reset
(T* p = NULL) {
61
if
(_data)
62
delete
_data;
63
_data = p;
64
};
65
66
private
:
67
T* _data;
68
};
69
}
// namespace threading
70
}
// namespace log4cpp
71
#endif
Portability.hh
log4cpp::threading::Mutex
Definition
PThreads.hh:28
log4cpp::threading::ScopedLock
definition of ScopedLock;
Definition
PThreads.hh:57
log4cpp::threading::ThreadLocalDataHolder
This class holds Thread local data of type T, i.e.
Definition
BoostThreads.hh:32
log4cpp::threading::ThreadLocalDataHolder::~ThreadLocalDataHolder
~ThreadLocalDataHolder()
Definition
DummyThreads.hh:37
log4cpp::threading::ThreadLocalDataHolder::data_type
T data_type
Definition
DummyThreads.hh:34
log4cpp::threading::ThreadLocalDataHolder::ThreadLocalDataHolder
ThreadLocalDataHolder()
Definition
DummyThreads.hh:36
log4cpp::threading::ThreadLocalDataHolder::operator->
T * operator->() const
Definition
DummyThreads.hh:46
log4cpp::threading::ThreadLocalDataHolder::operator*
T & operator*() const
Definition
DummyThreads.hh:49
log4cpp::threading::ThreadLocalDataHolder::get
T * get() const
Definition
DummyThreads.hh:42
log4cpp::threading::ThreadLocalDataHolder::reset
void reset(T *p=NULL)
Definition
DummyThreads.hh:60
log4cpp::threading::ThreadLocalDataHolder::release
T * release()
Definition
DummyThreads.hh:53
log4cpp::threading
Definition
BoostThreads.hh:21
log4cpp::threading::getThreadId
static std::string getThreadId()
Return an identifier for the current thread.
Definition
BoostThreads.hh:22
log4cpp
The top level namespace for all 'Log for C++' types and classes.
Definition
AbortAppender.hh:16
include
log4cpp
threading
DummyThreads.hh
Generated by
1.17.0