2015-01-21 11:39:48 +00:00
|
|
|
#pragma once
|
|
|
|
|
2018-11-28 11:37:12 +00:00
|
|
|
#include "IDictionary.h"
|
2017-01-21 04:24:28 +00:00
|
|
|
|
2019-03-15 00:29:53 +00:00
|
|
|
|
2018-11-28 11:37:12 +00:00
|
|
|
namespace Poco
|
|
|
|
{
|
2019-03-15 00:29:53 +00:00
|
|
|
|
2018-11-28 11:37:12 +00:00
|
|
|
namespace Util
|
|
|
|
{
|
|
|
|
class AbstractConfiguration;
|
|
|
|
}
|
|
|
|
|
|
|
|
class Logger;
|
2019-03-15 00:29:53 +00:00
|
|
|
|
2018-11-28 11:37:12 +00:00
|
|
|
}
|
2015-01-21 11:39:48 +00:00
|
|
|
|
2019-03-15 00:29:53 +00:00
|
|
|
|
2015-01-21 11:39:48 +00:00
|
|
|
namespace DB
|
|
|
|
{
|
2019-03-15 00:29:53 +00:00
|
|
|
|
2015-02-03 17:03:35 +00:00
|
|
|
class Context;
|
|
|
|
|
2019-08-22 03:24:05 +00:00
|
|
|
class DictionaryFactory : private boost::noncopyable
|
2015-01-21 11:39:48 +00:00
|
|
|
{
|
|
|
|
public:
|
2019-08-22 03:24:05 +00:00
|
|
|
|
|
|
|
static DictionaryFactory & instance();
|
|
|
|
|
2019-03-15 00:29:53 +00:00
|
|
|
DictionaryPtr create(const std::string & name, const Poco::Util::AbstractConfiguration & config, const std::string & config_prefix, Context & context) const;
|
2018-11-28 11:37:12 +00:00
|
|
|
|
|
|
|
using Creator = std::function<DictionaryPtr(
|
|
|
|
const std::string & name,
|
|
|
|
const DictionaryStructure & dict_struct,
|
|
|
|
const Poco::Util::AbstractConfiguration & config,
|
|
|
|
const std::string & config_prefix,
|
|
|
|
DictionarySourcePtr source_ptr)>;
|
|
|
|
|
|
|
|
void registerLayout(const std::string & layout_type, Creator create_layout);
|
|
|
|
|
|
|
|
private:
|
|
|
|
using LayoutRegistry = std::unordered_map<std::string, Creator>;
|
|
|
|
LayoutRegistry registered_layouts;
|
2015-01-21 11:39:48 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|