OmniSciDB  1dac507f6e
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DictionaryConverterFactory< TARGET_TYPE > Struct Template Reference

Public Types

using ConverterType = DictionaryValueConverter< TARGET_TYPE >
 

Public Member Functions

std::unique_ptr< ConverterTypecreate (ConverterCreateParameter param)
 
std::unique_ptr
< TargetValueConverter
operator() (ConverterCreateParameter param)
 

Detailed Description

template<typename TARGET_TYPE>
struct DictionaryConverterFactory< TARGET_TYPE >

Definition at line 78 of file TargetValueConvertersFactories.cpp.

Member Typedef Documentation

template<typename TARGET_TYPE>
using DictionaryConverterFactory< TARGET_TYPE >::ConverterType = DictionaryValueConverter<TARGET_TYPE>

Definition at line 79 of file TargetValueConvertersFactories.cpp.

Member Function Documentation

template<typename TARGET_TYPE>
std::unique_ptr<ConverterType> DictionaryConverterFactory< TARGET_TYPE >::create ( ConverterCreateParameter  param)
inline

Definition at line 81 of file TargetValueConvertersFactories.cpp.

References ConverterCreateParameter::can_be_null, ConverterCreateParameter::cat, CHECK(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_comp_param(), SQLTypeInfoCore< TYPE_FACET_PACK >::get_size(), TargetMetaInfo::get_type_info(), ConverterCreateParameter::literals_dictionary, NULL_INT, ConverterCreateParameter::num_rows, ConverterCreateParameter::source, ConverterCreateParameter::source_dictionary_proxy, ConverterCreateParameter::target, and ConverterCreateParameter::type.

Referenced by DictionaryConverterFactory< TARGET_TYPE >::operator()(), and TextConverterFactory::operator()().

81  {
82  TARGET_TYPE target_null_value =
83  static_cast<TARGET_TYPE>(inline_int_null_value<TARGET_TYPE>());
84 
85  switch (param.type.get_size()) {
86  case 4:
87  target_null_value = static_cast<TARGET_TYPE>(inline_int_null_value<int32_t>());
88  break;
89  case 2:
90  target_null_value = static_cast<TARGET_TYPE>(inline_int_null_value<uint16_t>());
91  break;
92  case 1:
93  target_null_value = static_cast<TARGET_TYPE>(inline_int_null_value<uint8_t>());
94  break;
95  default:
96  CHECK(false);
97  }
98 
99  return std::make_unique<DictionaryValueConverter<TARGET_TYPE>>(
100  param.cat,
102  param.target,
103  param.num_rows,
104  target_null_value,
105  NULL_INT,
106  param.can_be_null,
107  param.literals_dictionary,
109  }
const Catalog_Namespace::Catalog & cat
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:335
StringDictionaryProxy * literals_dictionary
HOST DEVICE int get_size() const
Definition: sqltypes.h:336
const SQLTypeInfo & get_type_info() const
CHECK(cgen_state)
#define NULL_INT
Definition: sqltypes.h:176
StringDictionaryProxy * source_dictionary_proxy

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

template<typename TARGET_TYPE>
std::unique_ptr<TargetValueConverter> DictionaryConverterFactory< TARGET_TYPE >::operator() ( ConverterCreateParameter  param)
inline

Definition at line 111 of file TargetValueConvertersFactories.cpp.

References DictionaryConverterFactory< TARGET_TYPE >::create().

111  {
112  return create(param);
113  }
std::unique_ptr< ConverterType > create(ConverterCreateParameter param)

+ Here is the call graph for this function:


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