log4cpp 1.1
|
00001 /* 00002 * Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved. 00003 * Copyright 2002, Bastiaan Bakker. All rights reserved. 00004 * 00005 * See the COPYING file for the terms of usage and distribution. 00006 */ 00007 00008 #if !defined(h_409ac787_0acf_47ff_ac15_3e9024d40315) 00009 #define h_409ac787_0acf_47ff_ac15_3e9024d40315 00010 00011 #include <string> 00012 #include <map> 00013 #include <memory> 00014 #include "Portability.hh" 00015 #include "Layout.hh" 00016 #include "FactoryParams.hh" 00017 00018 namespace log4cpp 00019 { 00020 class LOG4CPP_EXPORT LayoutsFactory 00021 { 00022 public: 00023 typedef FactoryParams params_t; 00024 typedef std::auto_ptr<Layout> (*create_function_t)(const params_t& params); 00025 00026 static LayoutsFactory& getInstance(); 00027 void registerCreator(const std::string& class_name, create_function_t create_function); 00028 std::auto_ptr<Layout> create(const std::string& class_name, const params_t& params); 00029 bool registed(const std::string& class_name) const; 00030 00031 private: 00032 LayoutsFactory(){}; 00033 00034 typedef std::map<std::string, create_function_t> creators_t; 00035 typedef creators_t::const_iterator const_iterator; 00036 00037 creators_t creators_; 00038 }; 00039 } 00040 00041 00042 #endif // h_409ac787_0acf_47ff_ac15_3e9024d40315