log4cpp  1.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
LayoutsFactory.hh
Go to the documentation of this file.
1 #if !defined(h_409ac787_0acf_47ff_ac15_3e9024d40315)
2 #define h_409ac787_0acf_47ff_ac15_3e9024d40315
3 
4 #include <string>
5 #include <map>
6 #include <memory>
7 #include "Portability.hh"
8 #include "Layout.hh"
9 #include "FactoryParams.hh"
10 
11 namespace log4cpp
12 {
14  {
15  public:
17  typedef std::auto_ptr<Layout> (*create_function_t)(const params_t& params);
18 
19  static LayoutsFactory& getInstance();
20  void registerCreator(const std::string& class_name, create_function_t create_function);
21  std::auto_ptr<Layout> create(const std::string& class_name, const params_t& params);
22  bool registed(const std::string& class_name) const;
23 
24  private:
25  LayoutsFactory(){};
26 
27  typedef std::map<std::string, create_function_t> creators_t;
28  typedef creators_t::const_iterator const_iterator;
29 
30  creators_t creators_;
31  };
32 }
33 
34 
35 #endif // h_409ac787_0acf_47ff_ac15_3e9024d40315
#define LOG4CPP_EXPORT
Definition: Export.hh:19
Definition: FactoryParams.hh:54
Definition: LayoutsFactory.hh:13
FactoryParams params_t
Definition: LayoutsFactory.hh:16