OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Function Class Reference

#include <ResultSetReductionOps.h>

Classes

struct  NamedArg
 

Public Member Functions

 Function (const std::string name, const std::vector< NamedArg > &arg_types, const Type ret_type, const bool always_inline)
 
const std::string & name () const
 
const std::vector< NamedArg > & arg_types () const
 
Argumentarg (const size_t idx) const
 
Type ret_type () const
 
const std::vector
< std::unique_ptr< Instruction > > & 
body () const
 
const std::vector
< std::unique_ptr< Constant > > & 
constants () const
 
bool always_inline () const
 
template<typename Tp , typename... Args>
Valueadd (Args &&...args)
 
template<typename Tp , typename... Args>
ValueaddConstant (Args &&...args)
 

Private Attributes

const std::string name_
 
const std::vector< NamedArgarg_types_
 
const Type ret_type_
 
std::vector< std::unique_ptr
< Instruction > > 
body_
 
const bool always_inline_
 
std::vector< std::unique_ptr
< Argument > > 
arguments_
 
std::vector< std::unique_ptr
< Constant > > 
constants_
 

Detailed Description

Definition at line 160 of file ResultSetReductionOps.h.

Constructor & Destructor Documentation

Function::Function ( const std::string  name,
const std::vector< NamedArg > &  arg_types,
const Type  ret_type,
const bool  always_inline 
)
inline

Definition at line 167 of file ResultSetReductionOps.h.

References arg_types_, arguments_, and g_value_id.

171  : name_(name)
175  g_value_id = 0;
176  for (const auto& named_arg : arg_types_) {
177  arguments_.emplace_back(new Argument(named_arg.type, named_arg.name));
178  }
179  }
const std::vector< NamedArg > & arg_types() const
const std::string & name() const
bool always_inline() const
Type ret_type() const
std::vector< std::unique_ptr< Argument > > arguments_
thread_local size_t g_value_id
const std::vector< NamedArg > arg_types_
const bool always_inline_
const std::string name_
const Type ret_type_

Member Function Documentation

template<typename Tp , typename... Args>
Value* Function::add ( Args &&...  args)
inline

Definition at line 196 of file ResultSetReductionOps.h.

References run_benchmark_import::args, and body_.

196  {
197  body_.emplace_back(new Tp(std::forward<Args>(args)...));
198  return body_.back().get();
199  }
std::vector< std::unique_ptr< Instruction > > body_
template<typename Tp , typename... Args>
Value* Function::addConstant ( Args &&...  args)
inline

Definition at line 202 of file ResultSetReductionOps.h.

References run_benchmark_import::args, and constants_.

202  {
203  constants_.emplace_back(new Tp(std::forward<Args>(args)...));
204  return constants_.back().get();
205  }
std::vector< std::unique_ptr< Constant > > constants_
bool Function::always_inline ( ) const
inline

Definition at line 193 of file ResultSetReductionOps.h.

References always_inline_.

193 { return always_inline_; }
const bool always_inline_
Argument* Function::arg ( const size_t  idx) const
inline

Definition at line 185 of file ResultSetReductionOps.h.

References arguments_.

185 { return arguments_[idx].get(); }
std::vector< std::unique_ptr< Argument > > arguments_
const std::vector<NamedArg>& Function::arg_types ( ) const
inline

Definition at line 183 of file ResultSetReductionOps.h.

References arg_types_.

183 { return arg_types_; }
const std::vector< NamedArg > arg_types_
const std::vector<std::unique_ptr<Instruction> >& Function::body ( ) const
inline

Definition at line 189 of file ResultSetReductionOps.h.

References body_.

189 { return body_; }
std::vector< std::unique_ptr< Instruction > > body_
const std::vector<std::unique_ptr<Constant> >& Function::constants ( ) const
inline

Definition at line 191 of file ResultSetReductionOps.h.

References constants_.

191 { return constants_; }
std::vector< std::unique_ptr< Constant > > constants_
const std::string& Function::name ( ) const
inline

Definition at line 181 of file ResultSetReductionOps.h.

References name_.

181 { return name_; }
const std::string name_
Type Function::ret_type ( ) const
inline

Definition at line 187 of file ResultSetReductionOps.h.

References ret_type_.

187 { return ret_type_; }
const Type ret_type_

Member Data Documentation

const bool Function::always_inline_
private

Definition at line 212 of file ResultSetReductionOps.h.

Referenced by always_inline().

const std::vector<NamedArg> Function::arg_types_
private

Definition at line 209 of file ResultSetReductionOps.h.

Referenced by arg_types(), and Function().

std::vector<std::unique_ptr<Argument> > Function::arguments_
private

Definition at line 213 of file ResultSetReductionOps.h.

Referenced by arg(), and Function().

std::vector<std::unique_ptr<Instruction> > Function::body_
private

Definition at line 211 of file ResultSetReductionOps.h.

Referenced by add(), and body().

std::vector<std::unique_ptr<Constant> > Function::constants_
private

Definition at line 214 of file ResultSetReductionOps.h.

Referenced by addConstant(), and constants().

const std::string Function::name_
private

Definition at line 208 of file ResultSetReductionOps.h.

Referenced by name().

const Type Function::ret_type_
private

Definition at line 210 of file ResultSetReductionOps.h.

Referenced by ret_type().


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