ClickHouse/dbms/include/DB/DataTypes/DataTypeFactory.h

34 lines
747 B
C
Raw Normal View History

2011-08-15 00:55:43 +00:00
#pragma once
#include <map>
#include <Yandex/singleton.h>
2011-08-15 00:55:43 +00:00
#include <Poco/RegularExpression.h>
2011-08-18 20:33:20 +00:00
#include <DB/DataTypes/IDataType.h>
2011-08-15 00:55:43 +00:00
namespace DB
{
/** Позволяет создать тип данных по его имени.
2011-08-15 00:55:43 +00:00
*/
class DataTypeFactory : public Singleton<DataTypeFactory>
2011-08-15 00:55:43 +00:00
{
public:
DataTypeFactory();
2011-09-19 01:42:16 +00:00
DataTypePtr get(const String & name) const;
2011-08-15 00:55:43 +00:00
private:
typedef std::map<String, DataTypePtr> NonParametricDataTypes;
NonParametricDataTypes non_parametric_data_types;
2014-07-01 01:03:16 +00:00
Poco::RegularExpression fixed_string_regexp {R"--(^FixedString\s*\(\s*(\d+)\s*\)$)--"};
Poco::RegularExpression nested_regexp {R"--(^(\w+)\s*\(\s*(.+)\s*\)$)--",
Poco::RegularExpression::RE_MULTILINE | Poco::RegularExpression::RE_DOTALL};
2011-08-15 00:55:43 +00:00
};
}