00001
00002
00003
00004
00005
00006
00007
00008
00009 #if !defined(h_738a42b1_1502_4483_948a_a69e7bbbee6a)
00010 #define h_738a42b1_1502_4483_948a_a69e7bbbee6a
00011
00012 #include <string>
00013 #include <map>
00014 #include <memory>
00015 #include "Portability.hh"
00016 #include "Appender.hh"
00017 #include "FactoryParams.hh"
00018
00019 namespace log4cpp
00020 {
00021 class LOG4CPP_EXPORT AppendersFactory
00022 {
00023 public:
00024 typedef FactoryParams params_t;
00025 typedef std::auto_ptr<Appender> (*create_function_t)(const params_t& params);
00026
00027 static AppendersFactory& getInstance();
00028 void registerCreator(const std::string& class_name, create_function_t create_function);
00029 std::auto_ptr<Appender> create(const std::string& class_name, const params_t& params);
00030 bool registered(const std::string& class_name) const;
00031
00032 private:
00033 AppendersFactory(){};
00034
00035 typedef std::map<std::string, create_function_t> creators_t;
00036 typedef creators_t::const_iterator const_iterator;
00037
00038 creators_t creators_;
00039 };
00040 }
00041
00042 #endif // h_738a42b1_1502_4483_948a_a69e7bbbee6a