OmniSciDB  dfae7c3b14
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< TargetValueConverteroperator() (ConverterCreateParameter param)
 

Detailed Description

template<typename TARGET_TYPE>
struct DictionaryConverterFactory< TARGET_TYPE >

Definition at line 100 of file TargetValueConvertersFactories.cpp.

Member Typedef Documentation

◆ ConverterType

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

Definition at line 101 of file TargetValueConvertersFactories.cpp.

Member Function Documentation

◆ create()

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

Definition at line 103 of file TargetValueConvertersFactories.cpp.

References ConverterCreateParameter::can_be_null, ConverterCreateParameter::cat, CHECK, SQLTypeInfo::get_comp_param(), SQLTypeInfo::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 TextConverterFactory::operator()().

103  {
104  TARGET_TYPE target_null_value =
105  static_cast<TARGET_TYPE>(inline_int_null_value<TARGET_TYPE>());
106 
107  switch (param.type.get_size()) {
108  case 4:
109  target_null_value = static_cast<TARGET_TYPE>(inline_int_null_value<int32_t>());
110  break;
111  case 2:
112  target_null_value = static_cast<TARGET_TYPE>(inline_int_null_value<uint16_t>());
113  break;
114  case 1:
115  target_null_value = static_cast<TARGET_TYPE>(inline_int_null_value<uint8_t>());
116  break;
117  default:
118  CHECK(false);
119  }
120 
121  return std::make_unique<DictionaryValueConverter<TARGET_TYPE>>(
122  param.cat,
124  param.target,
125  param.num_rows,
126  target_null_value,
127  NULL_INT,
128  param.can_be_null,
129  param.literals_dictionary,
131  }
const Catalog_Namespace::Catalog & cat
StringDictionaryProxy * literals_dictionary
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:268
HOST DEVICE int get_size() const
Definition: sqltypes.h:269
#define NULL_INT
Definition: sqltypes.h:183
#define CHECK(condition)
Definition: Logger.h:197
const SQLTypeInfo & get_type_info() const
StringDictionaryProxy * source_dictionary_proxy
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ operator()()

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

Definition at line 133 of file TargetValueConvertersFactories.cpp.

References NumericConverterFactory< SOURCE_TYPE, TARGET_TYPE >::create().

133  {
134  return create(param);
135  }
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: