OmniSciDB  a5dc49c757
 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 127 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 129 of file ExtensionFunctionsWhitelist.h.

134  : name_(name)
135  , args_(args)
136  , ret_(ret)
137  , annotations_(annotations)
138  , 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 144 of file ExtensionFunctionsWhitelist.h.

References annotations_.

Referenced by ThriftSerializers::to_thrift().

144  {
145  return annotations_;
146  }
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 142 of file ExtensionFunctionsWhitelist.h.

References args_.

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

142 { 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 688 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().

688  {
689  return (keep_suffix ? name_ : drop_suffix(name_));
690 }

+ 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 143 of file ExtensionFunctionsWhitelist.h.

References ret_.

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

143 { return ret_; }
const ExtArgumentType ret_

+ Here is the caller graph for this function:

bool ExtensionFunction::isCPU ( ) const
inline

Definition at line 157 of file ExtensionFunctionsWhitelist.h.

References name_.

157  {
158  return (name_.find("_gpu_", name_.find("__")) == std::string::npos);
159  }
bool ExtensionFunction::isGPU ( ) const
inline

Definition at line 153 of file ExtensionFunctionsWhitelist.h.

References name_.

153  {
154  return (name_.find("_cpu_", name_.find("__")) == std::string::npos);
155  }
bool ExtensionFunction::isRuntime ( ) const
inline

Definition at line 161 of file ExtensionFunctionsWhitelist.h.

References is_runtime_.

Referenced by ExtensionFunctionsWhitelist::get_udfs_name().

161 { return is_runtime_; }

+ Here is the caller graph for this function:

std::string ExtensionFunction::toSignature ( ) const

Definition at line 703 of file ExtensionFunctionsWhitelist.cpp.

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

703  {
704  return "(" + ExtensionFunctionsWhitelist::toString(args_) + ") -> " +
706 }
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 692 of file ExtensionFunctionsWhitelist.cpp.

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

692  {
693  return getName() + "(" + ExtensionFunctionsWhitelist::toString(args_) + ") -> " +
695 }
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 697 of file ExtensionFunctionsWhitelist.cpp.

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

697  {
698  return getName(/* keep_suffix = */ false) + "(" +
701 }
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 674 of file ExtensionFunctionsWhitelist.cpp.

References annotations_.

Referenced by CodeGenerator::codegenFunctionOper().

674  {
675  // if-else exists to keep compatibility with older versions of RBC
676  if (annotations_.empty()) {
677  return false;
678  } else {
679  auto func_annotations = annotations_.back();
680  auto mgr_annotation = func_annotations.find("uses_manager");
681  if (mgr_annotation != func_annotations.end()) {
682  return boost::algorithm::to_lower_copy(mgr_annotation->second) == "true";
683  }
684  return false;
685  }
686 }
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 167 of file ExtensionFunctionsWhitelist.h.

Referenced by getAnnotations(), and usesManager().

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

Definition at line 165 of file ExtensionFunctionsWhitelist.h.

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

const bool ExtensionFunction::is_runtime_
private

Definition at line 168 of file ExtensionFunctionsWhitelist.h.

Referenced by isRuntime().

const std::string ExtensionFunction::name_
private

Definition at line 164 of file ExtensionFunctionsWhitelist.h.

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

const ExtArgumentType ExtensionFunction::ret_
private

Definition at line 166 of file ExtensionFunctionsWhitelist.h.

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


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