OmniSciDB  a667adc9c8
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{ExtensionFunctionsWhitelist.cpp} Namespace Reference

Functions

std::string serialize_type (const ExtArgumentType type, bool byval=true)
 
std::string drop_suffix (const std::string &str)
 
ExtArgumentType deserialize_type (const std::string &type_name)
 

Function Documentation

ExtArgumentType anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::deserialize_type ( const std::string &  type_name)

Definition at line 528 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, CHECK, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict16, TextEncodingDict32, TextEncodingDict8, TextEncodingNone, and Void.

Referenced by ExtensionFunctionsWhitelist::addCommon().

528  {
529  if (type_name == "bool" || type_name == "i1") {
530  return ExtArgumentType::Bool;
531  }
532  if (type_name == "i8") {
533  return ExtArgumentType::Int8;
534  }
535  if (type_name == "i16") {
536  return ExtArgumentType::Int16;
537  }
538  if (type_name == "i32") {
539  return ExtArgumentType::Int32;
540  }
541  if (type_name == "i64") {
542  return ExtArgumentType::Int64;
543  }
544  if (type_name == "float") {
545  return ExtArgumentType::Float;
546  }
547  if (type_name == "double") {
549  }
550  if (type_name == "void") {
551  return ExtArgumentType::Void;
552  }
553  if (type_name == "i8*") {
554  return ExtArgumentType::PInt8;
555  }
556  if (type_name == "i16*") {
558  }
559  if (type_name == "i32*") {
561  }
562  if (type_name == "i64*") {
564  }
565  if (type_name == "float*") {
567  }
568  if (type_name == "double*") {
570  }
571  if (type_name == "i1*" || type_name == "bool*") {
572  return ExtArgumentType::PBool;
573  }
574  if (type_name == "{i8*, i64, i8}*") {
576  }
577  if (type_name == "{i16*, i64, i8}*") {
579  }
580  if (type_name == "{i32*, i64, i8}*") {
582  }
583  if (type_name == "{i64*, i64, i8}*") {
585  }
586  if (type_name == "{float*, i64, i8}*") {
588  }
589  if (type_name == "{double*, i64, i8}*") {
591  }
592  if (type_name == "{i1*, i64, i8}*" || type_name == "{bool*, i64, i8}*") {
594  }
595  if (type_name == "geo_point") {
597  }
598  if (type_name == "geo_linestring") {
600  }
601  if (type_name == "geo_polygon") {
603  }
604  if (type_name == "geo_multi_polygon") {
606  }
607  if (type_name == "cursor") {
609  }
610  if (type_name == "{i8*, i64}") {
612  }
613  if (type_name == "{i16*, i64}") {
615  }
616  if (type_name == "{i32*, i64}") {
618  }
619  if (type_name == "{i64*, i64}") {
621  }
622  if (type_name == "{float*, i64}") {
624  }
625  if (type_name == "{double*, i64}") {
627  }
628  if (type_name == "{i1*, i64}" || type_name == "{bool*, i64}") {
630  }
631  if (type_name == "text_encoding_none") {
633  }
634  if (type_name == "text_encoding_dict8") {
636  }
637  if (type_name == "text_encoding_dict16") {
639  }
640  if (type_name == "text_encoding_dict32") {
642  }
643  if (type_name == "column_list_int8") {
645  }
646  if (type_name == "column_list_int16") {
648  }
649  if (type_name == "column_list_int32") {
651  }
652  if (type_name == "column_list_int64") {
654  }
655  if (type_name == "column_list_float") {
657  }
658  if (type_name == "column_list_double") {
660  }
661  if (type_name == "column_list_bool") {
663  }
664  CHECK(false);
665  return ExtArgumentType::Int16;
666 }
#define CHECK(condition)
Definition: Logger.h:197
constexpr auto type_name() noexcept

+ Here is the caller graph for this function:

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::drop_suffix ( const std::string &  str)

Definition at line 221 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

Referenced by ExtensionFunctionsWhitelist::addCommon(), table_functions::TableFunctionsFactory::get_table_funcs(), and ExtensionFunction::getName().

221  {
222  const auto idx = str.find("__");
223  if (idx == std::string::npos) {
224  return str;
225  }
226  CHECK_GT(idx, std::string::size_type(0));
227  return str.substr(0, idx);
228 }
#define CHECK_GT(x, y)
Definition: Logger.h:209

+ Here is the caller graph for this function:

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type ( const ExtArgumentType  type,
bool  byval = true 
)

Definition at line 122 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, CHECK, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict16, TextEncodingDict32, TextEncodingDict8, TextEncodingNone, and Void.

Referenced by ext_arg_type_to_type_info(), ExtensionFunctionsWhitelist::getLLVMDeclarations(), ExtensionFunction::toString(), and ExtensionFunctionsWhitelist::toString().

122  {
123  switch (type) {
125  return "i8"; // clang converts bool to i8
127  return "i8";
129  return "i16";
131  return "i32";
133  return "i64";
135  return "float";
137  return "double";
139  return "void";
141  return "i8*";
143  return "i16*";
145  return "i32*";
147  return "i64*";
149  return "float*";
151  return "double*";
153  return "i1*";
155  return "{i8*, i64, i8}*";
157  return "{i16*, i64, i8}*";
159  return "{i32*, i64, i8}*";
161  return "{i64*, i64, i8}*";
163  return "{float*, i64, i8}*";
165  return "{double*, i64, i8}*";
167  return "{i1*, i64, i8}*";
169  return "geo_point";
171  return "geo_linestring";
173  return "geo_polygon";
175  return "geo_multi_polygon";
177  return "cursor";
179  return (byval ? "{i8*, i64}" : "i8*");
181  return (byval ? "{i16*, i64}" : "i8*");
183  return (byval ? "{i32*, i64}" : "i8*");
185  return (byval ? "{i64*, i64}" : "i8*");
187  return (byval ? "{float*, i64}" : "i8*");
189  return (byval ? "{double*, i64}" : "i8*");
191  return (byval ? "{i1*, i64}" : "i8*");
193  return "text_encoding_node";
195  return "text_encoding_dict8";
197  return "text_encoding_dict16";
199  return "text_encoding_dict32";
201  return "column_list_int8";
203  return "column_list_int16";
205  return "column_list_int32";
207  return "column_list_int64";
209  return "column_list_float";
211  return "column_list_double";
213  return "column_list_bool";
214  default:
215  CHECK(false);
216  }
217  CHECK(false);
218  return "";
219 }
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the caller graph for this function: