OmniSciDB  f03820bf22
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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, TableFunction
functions_
 

Friends

class ::ExtensionFunctionsWhitelist
 

Detailed Description

Definition at line 79 of file TableFunctionsFactory.h.

Member Function Documentation

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 57 of file TableFunctionsFactory.cpp.

References functions_.

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

61  {
62  functions_.insert(std::make_pair(
63  name, TableFunction(name, sizer, input_args, output_args, is_runtime)));
64 }
static std::unordered_map< std::string, TableFunction > functions_

+ Here is the caller graph for this function:

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

Definition at line 84 of file TableFunctionsFactory.cpp.

References functions_.

Referenced by RelAlgExecutor::createTableFunctionWorkUnit().

84  {
85  auto func_name = name;
86  boost::algorithm::to_lower(func_name);
87  auto itr = functions_.find(func_name);
88  if (itr == functions_.end()) {
89  throw std::runtime_error("Failed to find registered table function with name " +
90  name);
91  }
92  return itr->second;
93 }
static std::unordered_map< std::string, TableFunction > functions_

+ Here is the caller graph for this function:

void table_functions::TableFunctionsFactory::init ( )
static

Definition at line 68 of file TableFunctionsFactory.cpp.

References add(), g_enable_table_functions, table_functions::init_flag, table_functions::kUserSpecifiedRowMultiplier, PDouble, PInt32, and PInt64.

Referenced by QueryRunner::QueryRunner::QueryRunner().

68  {
70  return;
71  }
72  std::call_once(init_flag, []() {
74  "row_copier",
75  TableFunctionOutputRowSizer{OutputBufferSizeType::kUserSpecifiedRowMultiplier, 2},
76  std::vector<ExtArgumentType>{ExtArgumentType::PDouble,
79  ExtArgumentType::PInt64},
80  std::vector<ExtArgumentType>{ExtArgumentType::PDouble});
81  });
82 }
std::once_flag init_flag
bool g_enable_table_functions
Definition: Execute.cpp:94
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)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Friends And Related Function Documentation

friend class ::ExtensionFunctionsWhitelist
friend

Definition at line 94 of file TableFunctionsFactory.h.

Member Data Documentation

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

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