OmniSciDB  fe05a0c208
 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 529 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().

529  {
530  if (type_name == "bool" || type_name == "i1") {
531  return ExtArgumentType::Bool;
532  }
533  if (type_name == "i8") {
534  return ExtArgumentType::Int8;
535  }
536  if (type_name == "i16") {
537  return ExtArgumentType::Int16;
538  }
539  if (type_name == "i32") {
540  return ExtArgumentType::Int32;
541  }
542  if (type_name == "i64") {
543  return ExtArgumentType::Int64;
544  }
545  if (type_name == "float") {
546  return ExtArgumentType::Float;
547  }
548  if (type_name == "double") {
550  }
551  if (type_name == "void") {
552  return ExtArgumentType::Void;
553  }
554  if (type_name == "i8*") {
555  return ExtArgumentType::PInt8;
556  }
557  if (type_name == "i16*") {
559  }
560  if (type_name == "i32*") {
562  }
563  if (type_name == "i64*") {
565  }
566  if (type_name == "float*") {
568  }
569  if (type_name == "double*") {
571  }
572  if (type_name == "i1*" || type_name == "bool*") {
573  return ExtArgumentType::PBool;
574  }
575  if (type_name == "{i8*, i64, i8}*") {
577  }
578  if (type_name == "{i16*, i64, i8}*") {
580  }
581  if (type_name == "{i32*, i64, i8}*") {
583  }
584  if (type_name == "{i64*, i64, i8}*") {
586  }
587  if (type_name == "{float*, i64, i8}*") {
589  }
590  if (type_name == "{double*, i64, i8}*") {
592  }
593  if (type_name == "{i1*, i64, i8}*" || type_name == "{bool*, i64, i8}*") {
595  }
596  if (type_name == "geo_point") {
598  }
599  if (type_name == "geo_linestring") {
601  }
602  if (type_name == "geo_polygon") {
604  }
605  if (type_name == "geo_multi_polygon") {
607  }
608  if (type_name == "cursor") {
610  }
611  if (type_name == "{i8*, i64}") {
613  }
614  if (type_name == "{i16*, i64}") {
616  }
617  if (type_name == "{i32*, i64}") {
619  }
620  if (type_name == "{i64*, i64}") {
622  }
623  if (type_name == "{float*, i64}") {
625  }
626  if (type_name == "{double*, i64}") {
628  }
629  if (type_name == "{i1*, i64}" || type_name == "{bool*, i64}") {
631  }
632  if (type_name == "text_encoding_none") {
634  }
635  if (type_name == "text_encoding_dict8") {
637  }
638  if (type_name == "text_encoding_dict16") {
640  }
641  if (type_name == "text_encoding_dict32") {
643  }
644  if (type_name == "column_list_int8") {
646  }
647  if (type_name == "column_list_int16") {
649  }
650  if (type_name == "column_list_int32") {
652  }
653  if (type_name == "column_list_int64") {
655  }
656  if (type_name == "column_list_float") {
658  }
659  if (type_name == "column_list_double") {
661  }
662  if (type_name == "column_list_bool") {
664  }
665  CHECK(false);
666  return ExtArgumentType::Int16;
667 }
#define CHECK(condition)
Definition: Logger.h:203
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(), 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:215

+ 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:203

+ Here is the caller graph for this function: