提交 3a6208c6 编写于 作者: A Alexey Milovidov

Translated few comments [#METR-2944].

上级 fbc7c1f4
......@@ -10,23 +10,23 @@ namespace DB
class Context;
/** Позволяет получить функцию по имени.
* Функция при создании также может использовать для инициализации (например, захватить shared_ptr)
* какие-нибудь справочники, находящиеся в Context-е.
/** Creates function by name.
* Function could use for initialization (take ownership of shared_ptr, for example)
* some dictionaries from Context.
*/
class FunctionFactory : public Singleton<FunctionFactory>
{
friend class StorageSystemFunctions;
private:
typedef FunctionPtr (*Creator)(const Context & context); /// Не std::function, так как меньше indirection и размер объекта.
typedef FunctionPtr (*Creator)(const Context & context); /// Not std::function, for lower object size and less indirection.
std::unordered_map<String, Creator> functions;
public:
FunctionFactory();
FunctionPtr get(const String & name, const Context & context) const; /// Кидает исключение, если не нашлось.
FunctionPtr tryGet(const String & name, const Context & context) const; /// Возвращает nullptr, если не нашлось.
FunctionPtr get(const String & name, const Context & context) const; /// Throws an exception if not found.
FunctionPtr tryGet(const String & name, const Context & context) const; /// Returns nullptr if not found.
template <typename F> void registerFunction()
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册