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

Functions

std::string serialize_type (const ExtArgumentType type, bool byval=true, bool declare=false)
 
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 534 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, ColumnListTextEncodingDict, ColumnTextEncodingDict, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, and Void.

Referenced by ExtensionFunctionsWhitelist::addCommon().

534  {
535  if (type_name == "bool" || type_name == "i1") {
536  return ExtArgumentType::Bool;
537  }
538  if (type_name == "i8") {
539  return ExtArgumentType::Int8;
540  }
541  if (type_name == "i16") {
542  return ExtArgumentType::Int16;
543  }
544  if (type_name == "i32") {
545  return ExtArgumentType::Int32;
546  }
547  if (type_name == "i64") {
548  return ExtArgumentType::Int64;
549  }
550  if (type_name == "float") {
551  return ExtArgumentType::Float;
552  }
553  if (type_name == "double") {
555  }
556  if (type_name == "void") {
557  return ExtArgumentType::Void;
558  }
559  if (type_name == "i8*") {
560  return ExtArgumentType::PInt8;
561  }
562  if (type_name == "i16*") {
564  }
565  if (type_name == "i32*") {
567  }
568  if (type_name == "i64*") {
570  }
571  if (type_name == "float*") {
573  }
574  if (type_name == "double*") {
576  }
577  if (type_name == "i1*" || type_name == "bool*") {
578  return ExtArgumentType::PBool;
579  }
580  if (type_name == "{i8*, i64, i8}*") {
582  }
583  if (type_name == "{i16*, i64, i8}*") {
585  }
586  if (type_name == "{i32*, i64, i8}*") {
588  }
589  if (type_name == "{i64*, i64, i8}*") {
591  }
592  if (type_name == "{float*, i64, i8}*") {
594  }
595  if (type_name == "{double*, i64, i8}*") {
597  }
598  if (type_name == "{i1*, i64, i8}*" || type_name == "{bool*, i64, i8}*") {
600  }
601  if (type_name == "geo_point") {
603  }
604  if (type_name == "geo_linestring") {
606  }
607  if (type_name == "geo_polygon") {
609  }
610  if (type_name == "geo_multi_polygon") {
612  }
613  if (type_name == "cursor") {
615  }
616  if (type_name == "column_int8") {
618  }
619  if (type_name == "column_int16") {
621  }
622  if (type_name == "column_int32") {
624  }
625  if (type_name == "column_int64") {
627  }
628  if (type_name == "column_float") {
630  }
631  if (type_name == "column_double") {
633  }
634  if (type_name == "column_bool") {
636  }
637  if (type_name == "column_text_encoding_dict") {
639  }
640  if (type_name == "text_encoding_none") {
642  }
643  if (type_name == "text_encoding_dict") {
645  }
646  if (type_name == "column_list_int8") {
648  }
649  if (type_name == "column_list_int16") {
651  }
652  if (type_name == "column_list_int32") {
654  }
655  if (type_name == "column_list_int64") {
657  }
658  if (type_name == "column_list_float") {
660  }
661  if (type_name == "column_list_double") {
663  }
664  if (type_name == "column_list_bool") {
666  }
667  if (type_name == "column_list_text_encoding_dict") {
669  }
670  CHECK(false);
671  return ExtArgumentType::Int16;
672 }
#define CHECK(condition)
Definition: Logger.h:209
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 223 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

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

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

+ Here is the caller graph for this function:

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

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, ColumnListTextEncodingDict, ColumnTextEncodingDict, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, and Void.

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

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

+ Here is the caller graph for this function: