OmniSciDB  085a039ca4
 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 40 of file TargetValueConvertersFactories.h.

Member Function Documentation

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

Definition at line 260 of file TargetValueConvertersFactories.cpp.

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

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

261  {
262  static const std::map<SQLTypes,
263  std::function<std::unique_ptr<TargetValueConverter>(
264  ConverterCreateParameter param)>>
285 
286  auto factory = factories.find(param.target->columnType.get_type());
287 
288  if (factory != factories.end()) {
289  return factory->second(param);
290  } else {
291  throw std::runtime_error("Unsupported column type: " +
292  param.target->columnType.get_type_name());
293  }
294 }
Definition: sqltypes.h:49
SQLTypes
Definition: sqltypes.h:38
HOST DEVICE SQLTypes get_type() const
Definition: sqltypes.h:329
Definition: sqltypes.h:52
Definition: sqltypes.h:53
std::string get_type_name() const
Definition: sqltypes.h:443
Definition: sqltypes.h:41
Definition: sqltypes.h:45
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: