Fix renaming ContextPtr -> ContextConstPtr from previous commit

This commit is contained in:
ANDREI STAROVEROV 2021-07-15 00:20:13 +03:00
parent ed162094aa
commit 71b3e771b1
2 changed files with 11 additions and 11 deletions

View File

@ -58,7 +58,7 @@ void FunctionFactory::registerFunction(
FunctionOverloadResolverPtr FunctionFactory::getImpl(
const std::string & name,
ContextConstPtr context) const
ContextPtr context) const
{
auto res = tryGetImpl(name, context);
if (!res)
@ -89,14 +89,14 @@ std::vector<std::string> FunctionFactory::getAllNames() const
FunctionOverloadResolverPtr FunctionFactory::get(
const std::string & name,
ContextConstPtr context) const
ContextPtr context) const
{
return getImpl(name, context);
}
FunctionOverloadResolverPtr FunctionFactory::tryGetImpl(
const std::string & name_param,
ContextConstPtr context) const
ContextPtr context) const
{
std::lock_guard<std::mutex> guard(mutex);
String name = getAliasToOrName(name_param);
@ -127,8 +127,8 @@ FunctionOverloadResolverPtr FunctionFactory::tryGetImpl(
}
FunctionOverloadResolverPtr FunctionFactory::tryGet(
const std::string & name,
ContextConstPtr context) const
const std::string & name,
ContextPtr context) const
{
auto impl = tryGetImpl(name, context);
return impl ? std::move(impl) : nullptr;

View File

@ -21,7 +21,7 @@ namespace DB
* some dictionaries from Context.
*/
class FunctionFactory : private boost::noncopyable,
public IFactoryWithAliases<std::function<FunctionOverloadResolverPtr(ContextConstPtr)>>
public IFactoryWithAliases<std::function<FunctionOverloadResolverPtr(ContextPtr)>>
{
public:
static FunctionFactory & instance();
@ -50,14 +50,14 @@ public:
std::vector<std::string> getAllNames() const;
/// Throws an exception if not found.
FunctionOverloadResolverPtr get(const std::string & name, ContextConstPtr context) const;
FunctionOverloadResolverPtr get(const std::string & name, ContextPtr context) const;
/// Returns nullptr if not found.
FunctionOverloadResolverPtr tryGet(const std::string & name, ContextConstPtr context) const;
FunctionOverloadResolverPtr tryGet(const std::string & name, ContextPtr context) const;
/// The same methods to get developer interface implementation.
FunctionOverloadResolverPtr getImpl(const std::string & name, ContextConstPtr context) const;
FunctionOverloadResolverPtr tryGetImpl(const std::string & name, ContextConstPtr context) const;
FunctionOverloadResolverPtr getImpl(const std::string & name, ContextPtr context) const;
FunctionOverloadResolverPtr tryGetImpl(const std::string & name, ContextPtr context) const;
/// Register a function by its name.
/// No locking, you must register all functions before usage of get.
@ -75,7 +75,7 @@ private:
mutable std::mutex mutex;
template <typename Function>
static FunctionOverloadResolverPtr adaptFunctionToOverloadResolver(ContextConstPtr context)
static FunctionOverloadResolverPtr adaptFunctionToOverloadResolver(ContextPtr context)
{
return std::make_unique<FunctionToOverloadResolverAdaptor>(Function::create(context));
}