OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{ResultSetReductionInterpreter.cpp} Namespace Reference

Functions

std::vector< Typeget_value_types (const std::vector< const Value * > &values)
 
size_t get_element_size (const Type element_type)
 
ReductionInterpreter::EvalValue eval_constant (const Constant *constant)
 

Function Documentation

ReductionInterpreter::EvalValue anonymous_namespace{ResultSetReductionInterpreter.cpp}::eval_constant ( const Constant constant)

Definition at line 398 of file ResultSetReductionInterpreter.cpp.

References Double, logger::FATAL, Float, Int32, Int64, Int8, LOG, and Value::type().

398  {
399  switch (constant->type()) {
400  case Type::Int8:
401  case Type::Int32:
402  case Type::Int64: {
403  return {.int_val = static_cast<const ConstantInt*>(constant)->value()};
404  }
405  case Type::Float: {
406  return {.float_val =
407  static_cast<float>(static_cast<const ConstantFP*>(constant)->value())};
408  }
409  case Type::Double: {
410  return {.double_val = static_cast<const ConstantFP*>(constant)->value()};
411  }
412  default: {
413  LOG(FATAL) << "Constant type not supported: " << static_cast<int>(constant->type());
414  break;
415  }
416  }
417  return {};
418 }
#define LOG(tag)
Definition: Logger.h:185
Type type() const

+ Here is the call graph for this function:

size_t anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_element_size ( const Type  element_type)

Definition at line 36 of file ResultSetReductionInterpreter.cpp.

References logger::FATAL, Int64PtrPtr, Int8Ptr, and LOG.

Referenced by Fragmenter_Namespace::InsertOrderFragmenter::compactRows(), anonymous_namespace{TypedDataAccessors.h}::put_scalar(), ReductionInterpreterImpl::runAlloca(), ReductionInterpreterImpl::runGetElementPtr(), anonymous_namespace{TypedDataAccessors.h}::set_string_index(), Fragmenter_Namespace::InsertOrderFragmenter::updateColumn(), and Fragmenter_Namespace::InsertOrderFragmenter::vacuum_fixlen_rows().

36  {
37  switch (element_type) {
38  case Type::Int8Ptr: {
39  return sizeof(int8_t);
40  }
41  case Type::Int64PtrPtr: {
42  return sizeof(int64_t*);
43  }
44  default: {
45  LOG(FATAL) << "Base pointer type not supported: " << static_cast<int>(element_type);
46  break;
47  }
48  }
49  return 0;
50 }
#define LOG(tag)
Definition: Logger.h:185

+ Here is the caller graph for this function:

std::vector<Type> anonymous_namespace{ResultSetReductionInterpreter.cpp}::get_value_types ( const std::vector< const Value * > &  values)

Definition at line 25 of file ResultSetReductionInterpreter.cpp.

Referenced by ReductionInterpreterImpl::bindStub(), and ReductionInterpreterImpl::runExternalCall().

25  {
26  std::vector<Type> value_types;
27  value_types.reserve(value_types.size());
28  std::transform(values.begin(),
29  values.end(),
30  std::back_inserter(value_types),
31  [](const Value* value) { return value->type(); });
32  return value_types;
33 }

+ Here is the caller graph for this function: