-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathLayoutsFactory.hh
More file actions
42 lines (33 loc) · 1.18 KB
/
LayoutsFactory.hh
File metadata and controls
42 lines (33 loc) · 1.18 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/*
* Copyright 2002, LifeLine Networks BV (www.lifeline.nl). All rights reserved.
* Copyright 2002, Bastiaan Bakker. All rights reserved.
*
* See the COPYING file for the terms of usage and distribution.
*/
#if !defined(h_409ac787_0acf_47ff_ac15_3e9024d40315)
#define h_409ac787_0acf_47ff_ac15_3e9024d40315
#include <string>
#include <map>
#include <memory>
#include "Portability.hh"
#include "Layout.hh"
#include "FactoryParams.hh"
namespace log4cpp
{
class LOG4CPP_EXPORT LayoutsFactory
{
public:
typedef FactoryParams params_t;
typedef std::auto_ptr<Layout> (*create_function_t)(const params_t& params);
static LayoutsFactory& getInstance();
void registerCreator(const std::string& class_name, create_function_t create_function);
std::auto_ptr<Layout> create(const std::string& class_name, const params_t& params);
bool registed(const std::string& class_name) const;
private:
LayoutsFactory(){};
typedef std::map<std::string, create_function_t> creators_t;
typedef creators_t::const_iterator const_iterator;
creators_t creators_;
};
}
#endif // h_409ac787_0acf_47ff_ac15_3e9024d40315