OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 100 of file TargetValueConvertersFactories.cpp.

Member Typedef Documentation

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

Definition at line 101 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 103 of file TargetValueConvertersFactories.cpp.

References ConverterCreateParameter::can_be_null, CHECK, SQLTypeInfo::get_size(), TargetMetaInfo::get_type_info(), SQLTypeInfo::getStringDictKey(), ConverterCreateParameter::literals_dictionary, NULL_INT, ConverterCreateParameter::num_rows, ConverterCreateParameter::source, ConverterCreateParameter::source_dictionary_proxy, ConverterCreateParameter::target, ConverterCreateParameter::target_cat, and ConverterCreateParameter::type.

Referenced by DictionaryConverterFactory< TARGET_TYPE >::operator()(), and 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>>(
123  param.target,
124  param.target_cat,
125  param.num_rows,
126  target_null_value,
127  NULL_INT,
128  param.can_be_null,
129  param.literals_dictionary,
131  }
HOST DEVICE int get_size() const
Definition: sqltypes.h:403
StringDictionaryProxy * literals_dictionary
const SQLTypeInfo & get_type_info() const
#define NULL_INT
const Catalog_Namespace::Catalog & target_cat
#define CHECK(condition)
Definition: Logger.h:291
StringDictionaryProxy * source_dictionary_proxy
const shared::StringDictKey & getStringDictKey() const
Definition: sqltypes.h:1057

+ 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 133 of file TargetValueConvertersFactories.cpp.

References DictionaryConverterFactory< 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: