log4shib 2.0.0

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 _LOG4SHIB_HIERARCHYMAINTAINER_HH
11#define _LOG4SHIB_HIERARCHYMAINTAINER_HH
12
13#include <log4shib/Portability.hh>
14#include <string>
15#include <map>
16#include <vector>
17#include <log4shib/Category.hh>
18#include <log4shib/threading/Threading.hh>
19
20 namespace log4shib {
21
27 class HierarchyMaintainer {
28 friend class Log4cppCleanup;
29
30 public:
31 typedef std::map<std::string, Category*> CategoryMap;
32
33 static HierarchyMaintainer& getDefaultMaintainer();
34
35 HierarchyMaintainer();
36 virtual ~HierarchyMaintainer();
37 virtual Category* getExistingInstance(const std::string& name);
38 virtual Category& getInstance(const std::string& name);
39 virtual std::vector<Category*>* getCurrentCategories() const;
40 virtual void shutdown();
41 virtual void deleteAllCategories();
42
43 protected:
44 virtual Category* _getExistingInstance(const std::string& name);
45 virtual Category& _getInstance(const std::string& name);
46 CategoryMap _categoryMap;
47 mutable threading::Mutex _categoryMutex;
48
49 private:
50 static HierarchyMaintainer* _defaultMaintainer;
51 };
52}
53
54#endif // _LOG4SHIB_HIERARCHYMAINTAINER_HH
Category.hh
Portability.hh
Threading.hh
log4shib::Category
This is the central class in the log4j package.
Definition: Category.hh:32
log4shib::HierarchyMaintainer
HierarchyMaintainer is an internal log4shib class.
Definition: HierarchyMaintainer.hh:27
log4shib::HierarchyMaintainer::getCurrentCategories
virtual std::vector< Category * > * getCurrentCategories() const
Definition: HierarchyMaintainer.cpp:84
log4shib::HierarchyMaintainer::shutdown
virtual void shutdown()
Definition: HierarchyMaintainer.cpp:97
log4shib::HierarchyMaintainer::HierarchyMaintainer
HierarchyMaintainer()
Definition: HierarchyMaintainer.cpp:31
log4shib::HierarchyMaintainer::getDefaultMaintainer
static HierarchyMaintainer & getDefaultMaintainer()
Definition: HierarchyMaintainer.cpp:25
log4shib::HierarchyMaintainer::_getExistingInstance
virtual Category * _getExistingInstance(const std::string &name)
Definition: HierarchyMaintainer.cpp:44
log4shib::HierarchyMaintainer::Log4cppCleanup
friend class Log4cppCleanup
Definition: HierarchyMaintainer.hh:28
log4shib::HierarchyMaintainer::getExistingInstance
virtual Category * getExistingInstance(const std::string &name)
Definition: HierarchyMaintainer.cpp:39
log4shib::HierarchyMaintainer::_getInstance
virtual Category & _getInstance(const std::string &name)
Definition: HierarchyMaintainer.cpp:61
log4shib::HierarchyMaintainer::deleteAllCategories
virtual void deleteAllCategories()
Definition: HierarchyMaintainer.cpp:106
log4shib::HierarchyMaintainer::_categoryMutex
threading::Mutex _categoryMutex
Definition: HierarchyMaintainer.hh:47
log4shib::HierarchyMaintainer::getInstance
virtual Category & getInstance(const std::string &name)
Definition: HierarchyMaintainer.cpp:55
log4shib::HierarchyMaintainer::_categoryMap
CategoryMap _categoryMap
Definition: HierarchyMaintainer.hh:46
log4shib::HierarchyMaintainer::CategoryMap
std::map< std::string, Category * > CategoryMap
Definition: HierarchyMaintainer.hh:31
log4shib::HierarchyMaintainer::~HierarchyMaintainer
virtual ~HierarchyMaintainer()
Definition: HierarchyMaintainer.cpp:34
log4shib::threading::Mutex
Definition: PThreads.hh:29
log4shib
The top level namespace for all 'Log for C++' types and classes.
Definition: AbortAppender.hh:16