log4cpp
1.1
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
include
log4cpp
HierarchyMaintainer.hh
Go to the documentation of this file.
1
/*
2
* HierarchyMaintainer.hh
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
#ifndef _LOG4CPP_HIERARCHYMAINTAINER_HH
11
#define _LOG4CPP_HIERARCHYMAINTAINER_HH
12
13
#include <
log4cpp/Portability.hh
>
14
#include <string>
15
#include <map>
16
#include <vector>
17
#include <
log4cpp/Category.hh
>
18
#include <
log4cpp/threading/Threading.hh
>
19
20
namespace
log4cpp {
21
27
class
HierarchyMaintainer
{
28
friend
class
Log4cppCleanup
;
29
30
public
:
31
typedef
std::map<std::string, Category*>
CategoryMap
;
32
typedef
void (*
shutdown_fun_ptr
)();
33
34
static
HierarchyMaintainer
&
getDefaultMaintainer
();
35
36
HierarchyMaintainer
();
37
virtual
~HierarchyMaintainer
();
38
virtual
Category
*
getExistingInstance
(
const
std::string& name);
39
virtual
Category
&
getInstance
(
const
std::string& name);
40
virtual
std::vector<Category*>*
getCurrentCategories
()
const
;
41
virtual
void
shutdown
();
42
void
register_shutdown_handler
(
shutdown_fun_ptr
handler);
43
virtual
void
deleteAllCategories
();
44
45
protected
:
46
virtual
Category
*
_getExistingInstance
(
const
std::string& name);
47
virtual
Category
&
_getInstance
(
const
std::string& name);
48
CategoryMap
_categoryMap
;
49
mutable
threading::Mutex
_categoryMutex
;
50
51
private
:
52
typedef
std::vector<shutdown_fun_ptr> handlers_t;
53
54
static
HierarchyMaintainer
* _defaultMaintainer;
55
handlers_t handlers_;
56
};
57
}
58
59
#endif // _LOG4CPP_HIERARCHYMAINTAINER_HH
Generated by
1.8.2