OmniSciDB  a5dc49c757
 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 777 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, ArrayTextEncodingDict, ArrayTextEncodingNone, Bool, CHECK, ColumnArrayBool, ColumnArrayDouble, ColumnArrayFloat, ColumnArrayInt16, ColumnArrayInt32, ColumnArrayInt64, ColumnArrayInt8, ColumnArrayTextEncodingDict, ColumnBool, ColumnDouble, ColumnFloat, ColumnGeoLineString, ColumnGeoMultiLineString, ColumnGeoMultiPoint, ColumnGeoMultiPolygon, ColumnGeoPoint, ColumnGeoPolygon, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListArrayBool, ColumnListArrayDouble, ColumnListArrayFloat, ColumnListArrayInt16, ColumnListArrayInt32, ColumnListArrayInt64, ColumnListArrayInt8, ColumnListArrayTextEncodingDict, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListGeoLineString, ColumnListGeoMultiLineString, ColumnListGeoMultiPoint, ColumnListGeoMultiPolygon, ColumnListGeoPoint, ColumnListGeoPolygon, 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().

777  {
778  if (type_name == "bool" || type_name == "i1") {
779  return ExtArgumentType::Bool;
780  }
781  if (type_name == "i8") {
782  return ExtArgumentType::Int8;
783  }
784  if (type_name == "i16") {
785  return ExtArgumentType::Int16;
786  }
787  if (type_name == "i32") {
788  return ExtArgumentType::Int32;
789  }
790  if (type_name == "i64") {
791  return ExtArgumentType::Int64;
792  }
793  if (type_name == "float") {
794  return ExtArgumentType::Float;
795  }
796  if (type_name == "double") {
798  }
799  if (type_name == "void") {
800  return ExtArgumentType::Void;
801  }
802  if (type_name == "i8*") {
803  return ExtArgumentType::PInt8;
804  }
805  if (type_name == "i16*") {
807  }
808  if (type_name == "i32*") {
810  }
811  if (type_name == "i64*") {
813  }
814  if (type_name == "float*") {
816  }
817  if (type_name == "double*") {
819  }
820  if (type_name == "i1*" || type_name == "bool*") {
821  return ExtArgumentType::PBool;
822  }
823  if (type_name == "Array<i8>") {
825  }
826  if (type_name == "Array<i16>") {
828  }
829  if (type_name == "Array<i32>") {
831  }
832  if (type_name == "Array<i64>") {
834  }
835  if (type_name == "Array<float>") {
837  }
838  if (type_name == "Array<double>") {
840  }
841  if (type_name == "Array<bool>" || type_name == "Array<i1>") {
843  }
844  if (type_name == "Array<TextEncodingDict>") {
846  }
847  if (type_name == "Array<TextEncodingNone>") {
849  }
850  if (type_name == "GeoPoint") {
852  }
853  if (type_name == "GeoMultiPoint") {
855  }
856  if (type_name == "GeoLineString") {
858  }
859  if (type_name == "GeoMultiLineString") {
861  }
862  if (type_name == "GeoPolygon") {
864  }
865  if (type_name == "GeoMultiPolygon") {
867  }
868  if (type_name == "cursor") {
870  }
871  if (type_name == "Column<i8>") {
873  }
874  if (type_name == "Column<i16>") {
876  }
877  if (type_name == "Column<i32>") {
879  }
880  if (type_name == "Column<i64>") {
882  }
883  if (type_name == "Column<float>") {
885  }
886  if (type_name == "Column<double>") {
888  }
889  if (type_name == "Column<bool>") {
891  }
892  if (type_name == "Column<TextEncodingDict>") {
894  }
895  if (type_name == "Column<Timestamp>") {
897  }
898  if (type_name == "TextEncodingNone") {
900  }
901  if (type_name == "TextEncodingDict") {
903  }
904  if (type_name == "timestamp") {
906  }
907  if (type_name == "ColumnList<i8>") {
909  }
910  if (type_name == "ColumnList<i16>") {
912  }
913  if (type_name == "ColumnList<i32>") {
915  }
916  if (type_name == "ColumnList<i64>") {
918  }
919  if (type_name == "ColumnList<float>") {
921  }
922  if (type_name == "ColumnList<double>") {
924  }
925  if (type_name == "ColumnList<bool>") {
927  }
928  if (type_name == "ColumnList<TextEncodingDict>") {
930  }
931  if (type_name == "Column<Array<i8>>") {
933  }
934  if (type_name == "Column<Array<i16>>") {
936  }
937  if (type_name == "Column<Array<i32>>") {
939  }
940  if (type_name == "Column<Array<i64>>") {
942  }
943  if (type_name == "Column<Array<float>>") {
945  }
946  if (type_name == "Column<Array<double>>") {
948  }
949  if (type_name == "Column<Array<bool>>") {
951  }
952  if (type_name == "Column<Array<TextEncodingDict>>") {
954  }
955  if (type_name == "ColumnList<Array<i8>>") {
957  }
958  if (type_name == "ColumnList<Array<i16>>") {
960  }
961  if (type_name == "ColumnList<Array<i32>>") {
963  }
964  if (type_name == "ColumnList<Array<i64>>") {
966  }
967  if (type_name == "ColumnList<Array<float>>") {
969  }
970  if (type_name == "ColumnList<Array<double>>") {
972  }
973  if (type_name == "ColumnList<Array<bool>>") {
975  }
976  if (type_name == "ColumnList<Array<TextEncodingDict>>") {
978  }
979  if (type_name == "DayTimeInterval") {
981  }
982  if (type_name == "YearMonthTimeInterval") {
984  }
985  if (type_name == "Column<GeoPoint>") {
987  }
988  if (type_name == "Column<GeoLineString>") {
990  }
991  if (type_name == "Column<GeoPolygon>") {
993  }
994  if (type_name == "Column<GeoMultiPoint>") {
996  }
997  if (type_name == "Column<GeoMultiLineString>") {
999  }
1000  if (type_name == "Column<GeoMultiPolygon>") {
1002  }
1003  if (type_name == "ColumnList<GeoPoint>") {
1005  }
1006  if (type_name == "ColumnList<GeoLineString>") {
1008  }
1009  if (type_name == "ColumnList<GeoPolygon>") {
1011  }
1012  if (type_name == "ColumnList<GeoMultiPoint>") {
1014  }
1015  if (type_name == "ColumnList<GeoMultiLineString>") {
1017  }
1018  if (type_name == "ColumnList<GeoMultiPolygon>") {
1020  }
1021  CHECK(false);
1022  return ExtArgumentType::Int16;
1023 }
#define CHECK(condition)
Definition: Logger.h:291
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 335 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

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

335  {
336  const auto idx = str.find("__");
337  if (idx == std::string::npos) {
338  return str;
339  }
340  CHECK_GT(idx, std::string::size_type(0));
341  return str.substr(0, idx);
342 }
#define CHECK_GT(x, y)
Definition: Logger.h:305

+ 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, ColumnArrayTextEncodingNone, ColumnBool, ColumnDouble, ColumnFloat, ColumnGeoLineString, ColumnGeoMultiLineString, ColumnGeoMultiPoint, ColumnGeoMultiPolygon, ColumnGeoPoint, ColumnGeoPolygon, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, ColumnListArrayBool, ColumnListArrayDouble, ColumnListArrayFloat, ColumnListArrayInt16, ColumnListArrayInt32, ColumnListArrayInt64, ColumnListArrayInt8, ColumnListArrayTextEncodingDict, ColumnListArrayTextEncodingNone, ColumnListBool, ColumnListDouble, ColumnListFloat, ColumnListGeoLineString, ColumnListGeoMultiLineString, ColumnListGeoMultiPoint, ColumnListGeoMultiPolygon, ColumnListGeoPoint, ColumnListGeoPolygon, ColumnListInt16, ColumnListInt32, ColumnListInt64, ColumnListInt8, ColumnListTextEncodingDict, ColumnListTextEncodingNone, ColumnTextEncodingDict, ColumnTextEncodingNone, 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 (declare ? "{i8*, i32, i32, i32, i32}*" : "GeoPoint");
208  return (declare ? "{i8*, i32, i32, i32, i32}*" : "GeoMultiPoint");
210  return (declare ? "{i8*, i32, i32, i32, i32}*" : "GeoLineString");
212  return (declare ? "{i8*, i32, i8*, i32, i32, i32, i32}*" : "GeoMultiLineSting");
214  return (declare ? "{i8*, i32, i8*, i32, i32, i32, i32}*" : "GeoPolygon");
216  return (declare ? "{i8*, i32, i8*, i32, i8*, i32, i32, i32, i32}*"
217  : "GeoMultiPolygon");
219  return "cursor";
221  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "Column<i8>");
223  return (declare ? (byval ? "{i16*, i64}" : "i8*") : "Column<i16>");
225  return (declare ? (byval ? "{i32*, i64}" : "i8*") : "Column<i32>");
227  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<i64>");
229  return (declare ? (byval ? "{float*, i64}" : "i8*") : "Column<float>");
231  return (declare ? (byval ? "{double*, i64}" : "i8*") : "Column<double>");
233  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "Column<bool>");
235  return (declare ? (byval ? "{i32*, i64}" : "i8*") : "Column<TextEncodingDict>");
237  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<Timestamp>");
239  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "TextEncodingNone");
241  return (declare ? "{ i32 }" : "TextEncodingDict");
243  return (declare ? "{ i64 }" : "Timestamp");
245  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i8>");
247  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i16>");
249  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i32>");
251  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i64>");
253  return (declare ? "{i8**, i64, i64}*" : "ColumnList<float>");
255  return (declare ? "{i8**, i64, i64}*" : "ColumnList<double>");
257  return (declare ? "{i8**, i64, i64}*" : "ColumnList<bool>");
259  return (declare ? "{i8**, i64, i64}*" : "ColumnList<TextEncodingDict>");
261  return (declare ? "{i8*, i64}*" : "Column<Array<i8>>");
263  return (declare ? "{i8*, i64}*" : "Column<Array<i16>>");
265  return (declare ? "{i8*, i64}*" : "Column<Array<i32>>");
267  return (declare ? "{i8*, i64}*" : "Column<Array<i64>>");
269  return (declare ? "{i8*, i64}*" : "Column<Array<float>>");
271  return (declare ? "{i8*, i64}*" : "Column<Array<double>>");
273  return (declare ? "{i8*, i64}*" : "Column<Array<bool>>");
275  return (declare ? "{i8*, i64}" : "Column<Array<TextEncodingDict>>");
277  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i8>");
279  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i16>");
281  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i32>");
283  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<i64>");
285  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<float>");
287  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<double>");
289  return (declare ? "{i8**, i64, i64}*" : "ColumnListArray<bool>");
291  return (declare ? "{i8**, i64, i64}" : "ColumnList<Array<TextEncodingDict>>");
293  return (declare ? "{ i64 }" : "DayTimeInterval");
295  return (declare ? "{ i64 }" : "YearMonthTimeInterval");
297  return (declare ? "{i8*, i64}*" : "Column<GeoPoint>");
299  return (declare ? "{i8*, i64}*" : "Column<GeoLineString>");
301  return (declare ? "{i8*, i64}*" : "Column<GeoPolygon>");
303  return (declare ? "{i8*, i64}*" : "Column<GeoMultiPoint>");
305  return (declare ? "{i8*, i64}*" : "Column<GeoMultiLineString>");
307  return (declare ? "{i8*, i64}*" : "Column<GeoMultiPolygon>");
309  return (declare ? "{i8*, i64, i64}*" : "ColumnList<GeoPoint>");
311  return (declare ? "{i8*, i64, i64}*" : "ColumnList<GeoLineString>");
313  return (declare ? "{i8*, i64, i64}*" : "ColumnList<GeoPolygon>");
315  return (declare ? "{i8*, i64, i64}*" : "ColumnList<GeoMultiPoint>");
317  return (declare ? "{i8*, i64, i64}*" : "ColumnList<GeoMultiLineString>");
319  return (declare ? "{i8*, i64, i64}*" : "ColumnList<GeoMultiPolygon>");
321  return (declare ? "{i8*, i64}*" : "Column<TextEncodingNone>");
323  return (declare ? "{i8*, i64}*" : "Column<Array<TextEncodingNone>>");
325  return (declare ? "{i8*, i64, i64}*" : "ColumnList<TextEncodingNone>");
327  return (declare ? "{i8*, i64, i64}*" : "ColumnList<Array<TextEncodingNone>>");
328  default:
329  CHECK(false);
330  }
331  CHECK(false);
332  return "";
333 }
#define CHECK(condition)
Definition: Logger.h:291

+ Here is the caller graph for this function: