OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TargetValueConverterFactory Struct Reference

#include <TargetValueConvertersFactories.h>

Public Member Functions

std::unique_ptr
< TargetValueConverter
create (ConverterCreateParameter param)
 

Detailed Description

Definition at line 35 of file TargetValueConvertersFactories.h.

Member Function Documentation

std::unique_ptr< TargetValueConverter > TargetValueConverterFactory::create ( ConverterCreateParameter  param)

Definition at line 261 of file TargetValueConvertersFactories.cpp.

References ColumnDescriptor::columnType, SQLTypeInfo::get_type(), SQLTypeInfo::get_type_name(), kARRAY, kBIGINT, kBOOLEAN, kCHAR, kDATE, kDECIMAL, kDOUBLE, kFLOAT, kINT, kLINESTRING, kMULTILINESTRING, kMULTIPOINT, kMULTIPOLYGON, kNUMERIC, kPOINT, kPOLYGON, kSMALLINT, kTEXT, kTIME, kTIMESTAMP, kTINYINT, kVARCHAR, and ConverterCreateParameter::target.

Referenced by Parser::InsertIntoTableAsSelectStmt::populateData(), and Fragmenter_Namespace::InsertOrderFragmenter::updateColumns().

262  {
263  static const std::map<SQLTypes,
264  std::function<std::unique_ptr<TargetValueConverter>(
265  ConverterCreateParameter param)>>
266  factories{
289 
290  auto factory = factories.find(param.target->columnType.get_type());
291 
292  if (factory != factories.end()) {
293  return factory->second(param);
294  } else {
295  throw std::runtime_error("Unsupported column type: " +
296  param.target->columnType.get_type_name());
297  }
298 }
Definition: sqltypes.h:76
SQLTypes
Definition: sqltypes.h:65
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:391
Definition: sqltypes.h:79
Definition: sqltypes.h:80
std::string get_type_name() const
Definition: sqltypes.h:484
Definition: sqltypes.h:68
Definition: sqltypes.h:72
SQLTypeInfo columnType

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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