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

Referenced by ExtensionFunctionsWhitelist::addCommon().

551  {
552  if (type_name == "bool" || type_name == "i1") {
553  return ExtArgumentType::Bool;
554  }
555  if (type_name == "i8") {
556  return ExtArgumentType::Int8;
557  }
558  if (type_name == "i16") {
559  return ExtArgumentType::Int16;
560  }
561  if (type_name == "i32") {
562  return ExtArgumentType::Int32;
563  }
564  if (type_name == "i64") {
565  return ExtArgumentType::Int64;
566  }
567  if (type_name == "float") {
568  return ExtArgumentType::Float;
569  }
570  if (type_name == "double") {
572  }
573  if (type_name == "void") {
574  return ExtArgumentType::Void;
575  }
576  if (type_name == "i8*") {
577  return ExtArgumentType::PInt8;
578  }
579  if (type_name == "i16*") {
581  }
582  if (type_name == "i32*") {
584  }
585  if (type_name == "i64*") {
587  }
588  if (type_name == "float*") {
590  }
591  if (type_name == "double*") {
593  }
594  if (type_name == "i1*" || type_name == "bool*") {
595  return ExtArgumentType::PBool;
596  }
597  if (type_name == "Array<i8>") {
599  }
600  if (type_name == "Array<i16>") {
602  }
603  if (type_name == "Array<i32>") {
605  }
606  if (type_name == "Array<i64>") {
608  }
609  if (type_name == "Array<float>") {
611  }
612  if (type_name == "Array<double>") {
614  }
615  if (type_name == "Array<bool>" || type_name == "Array<i1>") {
617  }
618  if (type_name == "geo_point") {
620  }
621  if (type_name == "geo_linestring") {
623  }
624  if (type_name == "geo_polygon") {
626  }
627  if (type_name == "geo_multi_polygon") {
629  }
630  if (type_name == "cursor") {
632  }
633  if (type_name == "Column<i8>") {
635  }
636  if (type_name == "Column<i16>") {
638  }
639  if (type_name == "Column<i32>") {
641  }
642  if (type_name == "Column<i64>") {
644  }
645  if (type_name == "Column<float>") {
647  }
648  if (type_name == "Column<double>") {
650  }
651  if (type_name == "Column<bool>") {
653  }
654  if (type_name == "Column<TextEncodingDict>") {
656  }
657  if (type_name == "Column<timestamp>") {
659  }
660  if (type_name == "TextEncodingNone") {
662  }
663  if (type_name == "TextEncodingDict") {
665  }
666  if (type_name == "timestamp") {
668  }
669  if (type_name == "ColumnList<i8>") {
671  }
672  if (type_name == "ColumnList<i16>") {
674  }
675  if (type_name == "ColumnList<i32>") {
677  }
678  if (type_name == "ColumnList<i64>") {
680  }
681  if (type_name == "ColumnList<float>") {
683  }
684  if (type_name == "ColumnList<double>") {
686  }
687  if (type_name == "ColumnList<bool>") {
689  }
690  if (type_name == "ColumnList<TextEncodingDict>") {
692  }
693  CHECK(false);
694  return ExtArgumentType::Int16;
695 }
#define CHECK(condition)
Definition: Logger.h:223
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 227 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

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

227  {
228  const auto idx = str.find("__");
229  if (idx == std::string::npos) {
230  return str;
231  }
232  CHECK_GT(idx, std::string::size_type(0));
233  return str.substr(0, idx);
234 }
#define CHECK_GT(x, y)
Definition: Logger.h:235

+ 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, ColumnTimestamp, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, TextEncodingDict, TextEncodingNone, Timestamp, 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 (declare ? "{i8*, i64, i8}*" : "Array<i8>");
159  return (declare ? "{i16*, i64, i8}*" : "Array<i16>");
161  return (declare ? "{i32*, i64, i8}*" : "Array<i32>");
163  return (declare ? "{i64*, i64, i8}*" : "Array<i64>");
165  return (declare ? "{float*, i64, i8}*" : "Array<float>");
167  return (declare ? "{double*, i64, i8}*" : "Array<double>");
169  return (declare ? "{i1*, i64, i8}*" : "Array<i1>");
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<i8>");
183  return (declare ? (byval ? "{i16*, i64}" : "i8*") : "Column<i16>");
185  return (declare ? (byval ? "{i32*, i64}" : "i8*") : "Column<i32>");
187  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<i64>");
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<TextEncodingDict>");
197  return (declare ? (byval ? "{i64*, i64}" : "i8*") : "Column<timestamp>");
199  return (declare ? (byval ? "{i8*, i64}" : "i8*") : "TextEncodingNone");
201  return (declare ? "{i8*, i32}*" : "TextEncodingDict");
203  return (declare ? "{ i64 }" : "timestamp");
205  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i8>");
207  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i16>");
209  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i32>");
211  return (declare ? "{i8**, i64, i64}*" : "ColumnList<i64>");
213  return (declare ? "{i8**, i64, i64}*" : "ColumnList<float>");
215  return (declare ? "{i8**, i64, i64}*" : "ColumnList<double>");
217  return (declare ? "{i8**, i64, i64}*" : "ColumnList<bool>");
219  return (declare ? "{i8**, i64, i64}*" : "ColumnList<TextEncodingDict>");
220  default:
221  CHECK(false);
222  }
223  CHECK(false);
224  return "";
225 }
#define CHECK(condition)
Definition: Logger.h:223

+ Here is the caller graph for this function: