OmniSciDB  085a039ca4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 231 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 238 of file ResultSetReductionOps.h.

References arg_types_, arguments_, and g_value_id.

242  : name_(name)
246  g_value_id = 0;
247  for (const auto& named_arg : arg_types_) {
248  arguments_.emplace_back(new Argument(named_arg.type, named_arg.name));
249  }
250  }
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 267 of file ResultSetReductionOps.h.

References run_benchmark_import::args, and body_.

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

Definition at line 273 of file ResultSetReductionOps.h.

References run_benchmark_import::args, and constants_.

273  {
274  constants_.emplace_back(new Tp(std::forward<Args>(args)...));
275  return constants_.back().get();
276  }
std::vector< std::unique_ptr< Constant > > constants_
bool Function::always_inline ( ) const
inline

Definition at line 264 of file ResultSetReductionOps.h.

References always_inline_.

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

Definition at line 256 of file ResultSetReductionOps.h.

References arguments_.

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

Definition at line 254 of file ResultSetReductionOps.h.

References arg_types_.

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

Definition at line 260 of file ResultSetReductionOps.h.

References body_.

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

Definition at line 262 of file ResultSetReductionOps.h.

References constants_.

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

Definition at line 252 of file ResultSetReductionOps.h.

References name_.

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

Definition at line 258 of file ResultSetReductionOps.h.

References ret_type_.

258 { return ret_type_; }
const Type ret_type_

Member Data Documentation

const bool Function::always_inline_
private

Definition at line 283 of file ResultSetReductionOps.h.

Referenced by always_inline().

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

Definition at line 280 of file ResultSetReductionOps.h.

Referenced by arg_types(), and Function().

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

Definition at line 284 of file ResultSetReductionOps.h.

Referenced by arg(), and Function().

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

Definition at line 282 of file ResultSetReductionOps.h.

Referenced by add(), and body().

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

Definition at line 285 of file ResultSetReductionOps.h.

Referenced by addConstant(), and constants().

const std::string Function::name_
private

Definition at line 279 of file ResultSetReductionOps.h.

Referenced by name().

const Type Function::ret_type_
private

Definition at line 281 of file ResultSetReductionOps.h.

Referenced by ret_type().


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