OmniSciDB  c07336695a
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 78 of file TargetValueConvertersFactories.cpp.

Member Typedef Documentation

◆ ConverterType

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

Definition at line 79 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 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::target, and ConverterCreateParameter::type.

Referenced by 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);
108  }
const Catalog_Namespace::Catalog & cat
HOST DEVICE int get_size() const
Definition: sqltypes.h:329
StringDictionaryProxy * literals_dictionary
#define NULL_INT
Definition: sqltypes.h:174
HOST DEVICE int get_comp_param() const
Definition: sqltypes.h:328
#define CHECK(condition)
Definition: Logger.h:187
const SQLTypeInfo & get_type_info() const
+ 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 110 of file TargetValueConvertersFactories.cpp.

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

110  {
111  return create(param);
112  }
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: