OmniSciDB  c1a53651b2
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ExtensionFunction Class Reference

#include <ExtensionFunctionsWhitelist.h>

Public Member Functions

 ExtensionFunction (const std::string &name, const std::vector< ExtArgumentType > &args, const ExtArgumentType ret, const std::vector< std::map< std::string, std::string >> &annotations, const bool is_runtime)
 
const std::string getName (bool keep_suffix=true) const
 
const std::vector
< ExtArgumentType > & 
getInputArgs () const
 
const ExtArgumentType getRet () const
 
const std::vector< std::map
< std::string, std::string > > & 
getAnnotations () const
 
bool usesManager () const
 
std::string toString () const
 
std::string toStringSQL () const
 
std::string toSignature () const
 
bool isGPU () const
 
bool isCPU () const
 
bool isRuntime () const
 

Private Attributes

const std::string name_
 
const std::vector
< ExtArgumentType
args_
 
const ExtArgumentType ret_
 
const std::vector< std::map
< std::string, std::string > > 
annotations_
 
const bool is_runtime_
 

Detailed Description

Definition at line 115 of file ExtensionFunctionsWhitelist.h.

Constructor & Destructor Documentation

ExtensionFunction::ExtensionFunction ( const std::string &  name,
const std::vector< ExtArgumentType > &  args,
const ExtArgumentType  ret,
const std::vector< std::map< std::string, std::string >> &  annotations,
const bool  is_runtime 
)
inline

Definition at line 117 of file ExtensionFunctionsWhitelist.h.

122  : name_(name)
123  , args_(args)
124  , ret_(ret)
125  , annotations_(annotations)
126  , is_runtime_(is_runtime) {}
const std::vector< ExtArgumentType > args_
const std::vector< std::map< std::string, std::string > > annotations_
const ExtArgumentType ret_
string name
Definition: setup.in.py:72

Member Function Documentation

const std::vector<std::map<std::string, std::string> >& ExtensionFunction::getAnnotations ( ) const
inline

Definition at line 132 of file ExtensionFunctionsWhitelist.h.

References annotations_.

Referenced by ThriftSerializers::to_thrift().

132  {
133  return annotations_;
134  }
const std::vector< std::map< std::string, std::string > > annotations_

+ Here is the caller graph for this function:

const std::vector<ExtArgumentType>& ExtensionFunction::getInputArgs ( ) const
inline

Definition at line 130 of file ExtensionFunctionsWhitelist.h.

References args_.

Referenced by CodeGenerator::codegenFunctionOperCastArgs(), and ThriftSerializers::to_thrift().

130 { return args_; }
const std::vector< ExtArgumentType > args_

+ Here is the caller graph for this function:

const std::string ExtensionFunction::getName ( bool  keep_suffix = true) const

Definition at line 600 of file ExtensionFunctionsWhitelist.cpp.

References anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::drop_suffix(), and name_.

Referenced by CodeGenerator::codegenFunctionOper(), CodeGenerator::codegenFunctionOperCastArgs(), ExtensionFunctionsWhitelist::get_udfs_name(), ThriftSerializers::to_thrift(), toString(), and toStringSQL().

600  {
601  return (keep_suffix ? name_ : drop_suffix(name_));
602 }

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

const ExtArgumentType ExtensionFunction::getRet ( ) const
inline

Definition at line 131 of file ExtensionFunctionsWhitelist.h.

References ret_.

Referenced by CodeGenerator::codegenFunctionOper(), and ThriftSerializers::to_thrift().

131 { return ret_; }
const ExtArgumentType ret_

+ Here is the caller graph for this function:

bool ExtensionFunction::isCPU ( ) const
inline

Definition at line 145 of file ExtensionFunctionsWhitelist.h.

References name_.

145  {
146  return (name_.find("_gpu_", name_.find("__")) == std::string::npos);
147  }
bool ExtensionFunction::isGPU ( ) const
inline

Definition at line 141 of file ExtensionFunctionsWhitelist.h.

References name_.

141  {
142  return (name_.find("_cpu_", name_.find("__")) == std::string::npos);
143  }
bool ExtensionFunction::isRuntime ( ) const
inline

Definition at line 149 of file ExtensionFunctionsWhitelist.h.

References is_runtime_.

Referenced by ExtensionFunctionsWhitelist::get_udfs_name().

149 { return is_runtime_; }

+ Here is the caller graph for this function:

std::string ExtensionFunction::toSignature ( ) const

Definition at line 615 of file ExtensionFunctionsWhitelist.cpp.

References args_, ret_, and ExtensionFunctionsWhitelist::toString().

615  {
616  return "(" + ExtensionFunctionsWhitelist::toString(args_) + ") -> " +
618 }
const std::vector< ExtArgumentType > args_
const ExtArgumentType ret_
static std::string toString(const std::vector< ExtensionFunction > &ext_funcs, std::string tab="")

+ Here is the call graph for this function:

std::string ExtensionFunction::toString ( ) const

Definition at line 604 of file ExtensionFunctionsWhitelist.cpp.

References args_, getName(), ret_, and ExtensionFunctionsWhitelist::toString().

604  {
605  return getName() + "(" + ExtensionFunctionsWhitelist::toString(args_) + ") -> " +
607 }
const std::vector< ExtArgumentType > args_
const std::string getName(bool keep_suffix=true) const
const ExtArgumentType ret_
static std::string toString(const std::vector< ExtensionFunction > &ext_funcs, std::string tab="")

+ Here is the call graph for this function:

std::string ExtensionFunction::toStringSQL ( ) const

Definition at line 609 of file ExtensionFunctionsWhitelist.cpp.

References args_, getName(), ret_, and ExtensionFunctionsWhitelist::toStringSQL().

609  {
610  return getName(/* keep_suffix = */ false) + "(" +
613 }
const std::vector< ExtArgumentType > args_
const std::string getName(bool keep_suffix=true) const
const ExtArgumentType ret_
static std::string toStringSQL(const std::vector< ExtArgumentType > &sig_types)

+ Here is the call graph for this function:

bool ExtensionFunction::usesManager ( ) const

Definition at line 586 of file ExtensionFunctionsWhitelist.cpp.

References annotations_.

Referenced by CodeGenerator::codegenFunctionOper().

586  {
587  // if-else exists to keep compatibility with older versions of RBC
588  if (annotations_.empty()) {
589  return false;
590  } else {
591  auto func_annotations = annotations_.back();
592  auto mgr_annotation = func_annotations.find("uses_manager");
593  if (mgr_annotation != func_annotations.end()) {
594  return boost::algorithm::to_lower_copy(mgr_annotation->second) == "true";
595  }
596  return false;
597  }
598 }
const std::vector< std::map< std::string, std::string > > annotations_

+ Here is the caller graph for this function:

Member Data Documentation

const std::vector<std::map<std::string, std::string> > ExtensionFunction::annotations_
private

Definition at line 155 of file ExtensionFunctionsWhitelist.h.

Referenced by getAnnotations(), and usesManager().

const std::vector<ExtArgumentType> ExtensionFunction::args_
private

Definition at line 153 of file ExtensionFunctionsWhitelist.h.

Referenced by getInputArgs(), toSignature(), toString(), and toStringSQL().

const bool ExtensionFunction::is_runtime_
private

Definition at line 156 of file ExtensionFunctionsWhitelist.h.

Referenced by isRuntime().

const std::string ExtensionFunction::name_
private

Definition at line 152 of file ExtensionFunctionsWhitelist.h.

Referenced by getName(), isCPU(), and isGPU().

const ExtArgumentType ExtensionFunction::ret_
private

Definition at line 154 of file ExtensionFunctionsWhitelist.h.

Referenced by getRet(), toSignature(), toString(), and toStringSQL().


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