00001 /* 00002 * HierarchyMaintainer.hh 00003 * 00004 * Copyright 2000, LifeLine Networks BV (www.lifeline.nl). All rights reserved. 00005 * Copyright 2000, Bastiaan Bakker. All rights reserved. 00006 * 00007 * See the COPYING file for the terms of usage and distribution. 00008 */ 00009 00010 #ifndef _LOG4CPP_HIERARCHYMAINTAINER_HH 00011 #define _LOG4CPP_HIERARCHYMAINTAINER_HH 00012 00013 #include <string> 00014 #include "log4cpp/Category.hh" 00015 #include "log4cpp/Log4cppCleanup.hh" 00016 00017 namespace log4cpp { 00018 00024 class HierarchyMaintainer { 00025 friend class Log4cppCleanup; 00026 00027 public: 00028 typedef std::map<std::string, Category*> CategoryMap; 00029 00030 static HierarchyMaintainer& getDefaultMaintainer(); 00031 00032 HierarchyMaintainer(); 00033 virtual ~HierarchyMaintainer(); 00034 virtual Category* getExistingInstance(const std::string& name); 00035 virtual Category& getInstance(const std::string& name); 00036 virtual std::set<Category*>* getCurrentCategories() const; 00037 virtual void shutdown(); 00038 virtual void deleteAllCategories(); 00039 00040 protected: 00041 CategoryMap _categoryMap; 00042 00043 private: 00044 static HierarchyMaintainer* _defaultMaintainer; 00045 00046 #ifdef LOG4CPP_USE_CLEANUP 00047 static Log4cppCleanup& _fuckinDummy; 00048 #endif 00049 }; 00050 } 00051 00052 #endif // _LOG4CPP_HIERARCHYMAINTAINER_HH