OmniSciDB  b28c0d5765
 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 675 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, ArrayTextEncodingDict, Bool, CHECK, ColumnArrayBool, ColumnArrayDouble, ColumnArrayFloat, ColumnArrayInt16, ColumnArrayInt32, ColumnArrayInt64, ColumnArrayInt8, ColumnArrayTextEncodingDict, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListArrayBool, ColumnListArrayDouble, ColumnListArrayFloat, ColumnListArrayInt16, ColumnListArrayInt32, ColumnListArrayInt64, ColumnListArrayInt8, ColumnListArrayTextEncodingDict, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, ColumnListTextEncodingDict, ColumnTextEncodingDict, ColumnTimestamp, Cursor, DayTimeInterval, Double, Float, GeoLineString, GeoMultiLineString, GeoMultiPoint, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, Timestamp, Void, and YearMonthTimeInterval.

Referenced by ExtensionFunctionsWhitelist::addCommon().

675  {
676  if (type_name == "bool" || type_name == "i1") {
677  return ExtArgumentType::Bool;
678  }
679  if (type_name == "i8") {
680  return ExtArgumentType::Int8;
681  }
682  if (type_name == "i16") {
683  return ExtArgumentType::Int16;
684  }
685  if (type_name == "i32") {
686  return ExtArgumentType::Int32;
687  }
688  if (type_name == "i64") {
689  return ExtArgumentType::Int64;
690  }
691  if (type_name == "float") {
692  return ExtArgumentType::Float;
693  }
694  if (type_name == "double") {
696  }
697  if (type_name == "void") {
698  return ExtArgumentType::Void;
699  }
700  if (type_name == "i8*") {
701  return ExtArgumentType::PInt8;
702  }
703  if (type_name == "i16*") {
705  }
706  if (type_name == "i32*") {
708  }
709  if (type_name == "i64*") {
711  }
712  if (type_name == "float*") {
714  }
715  if (type_name == "double*") {
717  }
718  if (type_name == "i1*" || type_name == "bool*") {
719  return ExtArgumentType::PBool;
720  }
721  if (type_name == "Array<i8>") {
723  }
724  if (type_name == "Array<i16>") {
726  }
727  if (type_name == "Array<i32>") {
729  }
730  if (type_name == "Array<i64>") {
732  }
733  if (type_name == "Array<float>") {
735  }
736  if (type_name == "Array<double>") {
738  }
739  if (type_name == "Array<bool>" || type_name == "Array<i1>") {
741  }
742  if (type_name == "Array<TextEncodingDict>") {
744  }
745  if (type_name == "geo_point") {
747  }
748  if (type_name == "geo_multi_point") {
750  }
751  if (type_name == "geo_linestring") {
753  }
754  if (type_name == "geo_multi_linestring") {
756  }
757  if (type_name == "geo_polygon") {
759  }
760  if (type_name == "geo_multi_polygon") {
762  }
763  if (type_name == "cursor") {
765  }
766  if (type_name == "Column<i8>") {
768  }
769  if (type_name == "Column<i16>") {
771  }
772  if (type_name == "Column<i32>") {
774  }
775  if (type_name == "Column<i64>") {
777  }
778  if (type_name == "Column<float>") {
780  }
781  if (type_name == "Column<double>") {
783  }
784  if (type_name == "Column<bool>") {
786  }
787  if (type_name == "Column<TextEncodingDict>") {
789  }
790  if (type_name == "Column<Timestamp>") {
792  }
793  if (type_name == "TextEncodingNone") {
795  }
796  if (type_name == "TextEncodingDict") {
798  }
799  if (type_name == "timestamp") {
801  }
802  if (type_name == "ColumnList<i8>") {
804  }
805  if (type_name == "ColumnList<i16>") {
807  }
808  if (type_name == "ColumnList<i32>") {
810  }
811  if (type_name == "ColumnList<i64>") {
813  }
814  if (type_name == "ColumnList<float>") {
816  }
817  if (type_name == "ColumnList<double>") {
819  }
820  if (type_name == "ColumnList<bool>") {
822  }
823  if (type_name == "ColumnList<TextEncodingDict>") {
825  }
826  if (type_name == "Column<Array<i8>>") {
828  }
829  if (type_name == "Column<Array<i16>>") {
831  }
832  if (type_name == "Column<Array<i32>>") {
834  }
835  if (type_name == "Column<Array<i64>>") {
837  }
838  if (type_name == "Column<Array<float>>") {
840  }
841  if (type_name == "Column<Array<double>>") {
843  }
844  if (type_name == "Column<Array<bool>>") {
846  }
847  if (type_name == "Column<Array<TextEncodingDict>>") {
849  }
850  if (type_name == "ColumnList<Array<i8>>") {
852  }
853  if (type_name == "ColumnList<Array<i16>>") {
855  }
856  if (type_name == "ColumnList<Array<i32>>") {
858  }
859  if (type_name == "ColumnList<Array<i64>>") {
861  }
862  if (type_name == "ColumnList<Array<float>>") {
864  }
865  if (type_name == "ColumnList<Array<double>>") {
867  }
868  if (type_name == "ColumnList<Array<bool>>") {
870  }
871  if (type_name == "ColumnList<Array<TextEncodingDict>>") {
873  }
874  if (type_name == "DayTimeInterval") {
876  }
877  if (type_name == "YearMonthTimeInterval") {
879  }
880  CHECK(false);
881  return ExtArgumentType::Int16;
882 }
#define CHECK(condition)
Definition: Logger.h:222
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 302 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

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

302  {
303  const auto idx = str.find("__");
304  if (idx == std::string::npos) {
305  return str;
306  }
307  CHECK_GT(idx, std::string::size_type(0));
308  return str.substr(0, idx);
309 }
#define CHECK_GT(x, y)
Definition: Logger.h:234

+ 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 155 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, ArrayTextEncodingDict, Bool, CHECK, ColumnArrayBool, ColumnArrayDouble, ColumnArrayFloat, ColumnArrayInt16, ColumnArrayInt32, ColumnArrayInt64, ColumnArrayInt8, ColumnArrayTextEncodingDict, ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListArrayBool, ColumnListArrayDouble, ColumnListArrayFloat, ColumnListArrayInt16, ColumnListArrayInt32, ColumnListArrayInt64, ColumnListArrayInt8, ColumnListArrayTextEncodingDict, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, ColumnListTextEncodingDict, ColumnTextEncodingDict, ColumnTimestamp, Cursor, DayTimeInterval, Double, Float, GeoLineString, GeoMultiLineString, GeoMultiPoint, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, Timestamp, Void, and YearMonthTimeInterval.

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

157  {
158  switch (type) {
160  return "i8"; // clang converts bool to i8
162  return "i8";
164  return "i16";
166  return "i32";
168  return "i64";
170  return "float";
172  return "double";
174  return "void";
176  return "i8*";
178  return "i16*";
180  return "i32*";
182  return "i64*";
184  return "float*";
186  return "double*";
188  return "i1*";
190  return (declare ? "{i8*, i64, i8}*" : "Array<i8>");
192  return (declare ? "{i16*, i64, i8}*" : "Array<i16>");
194  return (declare ? "{i32*, i64, i8}*" : "Array<i32>");
196  return (declare ? "{i64*, i64, i8}*" : "Array<i64>");
198  return (declare ? "{float*, i64, i8}*" : "Array<float>");
200  return (declare ? "{double*, i64, i8}*" : "Array<double>");
202  return (declare ? "{i1*, i64, i8}*" : "Array<i1>");
204  return (declare ? "{i32*, i64, i8}*" : "Array<TextEncodingDict>");
206  return "geo_point";
208  return "geo_multi_point";
210  return "geo_linestring";
212  return "geo_multi_linestring";
214  return "geo_polygon";
216  return "geo_multi_polygon";
218  return "cursor";
220  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "Column<i8>");
222  return (declare ? (byval ? "{i16*, i64}" : "i8*") : "Column<i16>");
224  return (declare ? (byval ? "{i32*, i64}" : "i8*") : "Column<i32>");
226  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<i64>");
228  return (declare ? (byval ? "{float*, i64}" : "i8*") : "Column<float>");
230  return (declare ? (byval ? "{double*, i64}" : "i8*") : "Column<double>");
232  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "Column<bool>");
234  return (declare ? (byval ? "{i32*, i64}" : "i8*") : "Column<TextEncodingDict>");
236  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<Timestamp>");
238  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "TextEncodingNone");
240  return (declare ? "{ i32 }" : "TextEncodingDict");
242  return (declare ? "{ i64 }" : "Timestamp");
244  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i8>");
246  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i16>");
248  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i32>");
250  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i64>");
252  return (declare ? "{i8**, i64, i64}*" : "ColumnList<float>");
254  return (declare ? "{i8**, i64, i64}*" : "ColumnList<double>");
256  return (declare ? "{i8**, i64, i64}*" : "ColumnList<bool>");
258  return (declare ? "{i8**, i64, i64}*" : "ColumnList<TextEncodingDict>");
260  return (declare ? "{i8*, i64}*" : "Column<Array<i8>>");
262  return (declare ? "{i8*, i64}*" : "Column<Array<i16>>");
264  return (declare ? "{i8*, i64}*" : "Column<Array<i32>>");
266  return (declare ? "{i8*, i64}*" : "Column<Array<i64>>");
268  return (declare ? "{i8*, i64}*" : "Column<Array<float>>");
270  return (declare ? "{i8*, i64}*" : "Column<Array<double>>");
272  return (declare ? "{i8*, i64}*" : "Column<Array<bool>>");
274  return (declare ? "{i8*, i64}" : "Column<Array<TextEncodingDict>>");
276  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i8>");
278  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i16>");
280  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i32>");
282  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i64>");
284  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<float>");
286  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<double>");
288  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<bool>");
290  return (declare ? "{i8**, i64, i64}" : "ColumnList<Array<TextEncodingDict>>");
292  return (declare ? "{ i64 }" : "DayTimeInterval");
294  return (declare ? "{ i64 }" : "YearMonthTimeInterval");
295  default:
296  CHECK(false);
297  }
298  CHECK(false);
299  return "";
300 }
#define CHECK(condition)
Definition: Logger.h:222

+ Here is the caller graph for this function: