OmniSciDB  8a228a1076
table_functions::TableFunctionsFactory Class Reference

#include <TableFunctionsFactory.h>

Static Public Member Functions

static void add (const std::string &name, const TableFunctionOutputRowSizer sizer, const std::vector< ExtArgumentType > &input_args, const std::vector< ExtArgumentType > &output_args, bool is_runtime=false)
 
static const TableFunctionget (const std::string &name)
 
static void init ()
 

Static Private Attributes

static std::unordered_map< std::string, TableFunctionfunctions_
 

Friends

class ::ExtensionFunctionsWhitelist
 

Detailed Description

Definition at line 90 of file TableFunctionsFactory.h.

Member Function Documentation

◆ add()

void table_functions::TableFunctionsFactory::add ( const std::string &  name,
const TableFunctionOutputRowSizer  sizer,
const std::vector< ExtArgumentType > &  input_args,
const std::vector< ExtArgumentType > &  output_args,
bool  is_runtime = false 
)
static

Definition at line 86 of file TableFunctionsFactory.cpp.

References table_functions::TableFunction::TableFunction().

Referenced by init(), and DBHandler::register_runtime_extension_functions().

90  {
91  functions_.insert(std::make_pair(
92  name, TableFunction(name, sizer, input_args, output_args, is_runtime)));
93 }
static std::unordered_map< std::string, TableFunction > functions_
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ get()

const TableFunction & table_functions::TableFunctionsFactory::get ( const std::string &  name)
static

Definition at line 111 of file TableFunctionsFactory.cpp.

References functions_, and to_lower().

Referenced by RelAlgExecutor::createTableFunctionWorkUnit().

111  {
112  auto func_name = name;
113  boost::algorithm::to_lower(func_name);
114  auto itr = functions_.find(func_name);
115  if (itr == functions_.end()) {
116  throw std::runtime_error("Failed to find registered table function with name " +
117  name);
118  }
119  return itr->second;
120 }
std::string to_lower(const std::string &str)
static std::unordered_map< std::string, TableFunction > functions_
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ init()

void table_functions::TableFunctionsFactory::init ( )
static

Definition at line 97 of file TableFunctionsFactory.cpp.

References add(), ColumnDouble, g_enable_table_functions, Int32, and table_functions::kUserSpecifiedRowMultiplier.

Referenced by DBHandler::DBHandler(), and QueryRunner::QueryRunner::QueryRunner().

97  {
99  return;
100  }
101  std::call_once(init_flag, []() {
103  "row_copier",
104  TableFunctionOutputRowSizer{OutputBufferSizeType::kUserSpecifiedRowMultiplier, 2},
105  std::vector<ExtArgumentType>{ExtArgumentType::ColumnDouble,
107  std::vector<ExtArgumentType>{ExtArgumentType::ColumnDouble});
108  });
109 }
std::once_flag init_flag
static void add(const std::string &name, const TableFunctionOutputRowSizer sizer, const std::vector< ExtArgumentType > &input_args, const std::vector< ExtArgumentType > &output_args, bool is_runtime=false)
bool g_enable_table_functions
Definition: Execute.cpp:99
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Friends And Related Function Documentation

◆ ::ExtensionFunctionsWhitelist

friend class ::ExtensionFunctionsWhitelist
friend

Definition at line 105 of file TableFunctionsFactory.h.

Member Data Documentation

◆ functions_

std::unordered_map< std::string, TableFunction > table_functions::TableFunctionsFactory::functions_
staticprivate

The documentation for this class was generated from the following files: