mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Translated few comments [#METR-2944].
This commit is contained in:
parent
fbc7c1f40a
commit
3a6208c6d0
@ -10,23 +10,23 @@ namespace DB
|
|||||||
class Context;
|
class Context;
|
||||||
|
|
||||||
|
|
||||||
/** Позволяет получить функцию по имени.
|
/** Creates function by name.
|
||||||
* Функция при создании также может использовать для инициализации (например, захватить shared_ptr)
|
* Function could use for initialization (take ownership of shared_ptr, for example)
|
||||||
* какие-нибудь справочники, находящиеся в Context-е.
|
* some dictionaries from Context.
|
||||||
*/
|
*/
|
||||||
class FunctionFactory : public Singleton<FunctionFactory>
|
class FunctionFactory : public Singleton<FunctionFactory>
|
||||||
{
|
{
|
||||||
friend class StorageSystemFunctions;
|
friend class StorageSystemFunctions;
|
||||||
|
|
||||||
private:
|
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;
|
std::unordered_map<String, Creator> functions;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FunctionFactory();
|
FunctionFactory();
|
||||||
|
|
||||||
FunctionPtr get(const String & name, const Context & context) const; /// Кидает исключение, если не нашлось.
|
FunctionPtr get(const String & name, const Context & context) const; /// Throws an exception if not found.
|
||||||
FunctionPtr tryGet(const String & name, const Context & context) const; /// Возвращает nullptr, если не нашлось.
|
FunctionPtr tryGet(const String & name, const Context & context) const; /// Returns nullptr if not found.
|
||||||
|
|
||||||
template <typename F> void registerFunction()
|
template <typename F> void registerFunction()
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user