OmniSciDB  06b3bd477c
 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)
 
ExtArgumentType deserialize_type (const std::string &type_name)
 
std::string drop_suffix (const std::string &str)
 

Function Documentation

ExtArgumentType anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::deserialize_type ( const std::string &  type_name)

Definition at line 360 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, CHECK(), ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, and Void.

Referenced by ExtensionFunctionsWhitelist::addCommon().

360  {
361  if (type_name == "bool" || type_name == "i1") {
362  return ExtArgumentType::Bool;
363  }
364  if (type_name == "i8") {
365  return ExtArgumentType::Int8;
366  }
367  if (type_name == "i16") {
368  return ExtArgumentType::Int16;
369  }
370  if (type_name == "i32") {
371  return ExtArgumentType::Int32;
372  }
373  if (type_name == "i64") {
374  return ExtArgumentType::Int64;
375  }
376  if (type_name == "float") {
377  return ExtArgumentType::Float;
378  }
379  if (type_name == "double") {
381  }
382  if (type_name == "void") {
383  return ExtArgumentType::Void;
384  }
385  if (type_name == "i8*") {
386  return ExtArgumentType::PInt8;
387  }
388  if (type_name == "i16*") {
390  }
391  if (type_name == "i32*") {
393  }
394  if (type_name == "i64*") {
396  }
397  if (type_name == "float*") {
399  }
400  if (type_name == "double*") {
402  }
403  if (type_name == "i1*" || type_name == "bool*") {
404  return ExtArgumentType::PBool;
405  }
406  if (type_name == "{i8*, i64, i8}*") {
408  }
409  if (type_name == "{i16*, i64, i8}*") {
411  }
412  if (type_name == "{i32*, i64, i8}*") {
414  }
415  if (type_name == "{i64*, i64, i8}*") {
417  }
418  if (type_name == "{float*, i64, i8}*") {
420  }
421  if (type_name == "{double*, i64, i8}*") {
423  }
424  if (type_name == "{i1*, i64, i8}*" || type_name == "{bool*, i64, i8}*") {
426  }
427  if (type_name == "geo_point") {
429  }
430  if (type_name == "geo_linestring") {
432  }
433  if (type_name == "geo_polygon") {
435  }
436  if (type_name == "geo_multi_polygon") {
438  }
439  if (type_name == "cursor") {
441  }
442  if (type_name == "{i8*, i64}") {
444  }
445  if (type_name == "{i16*, i64}") {
447  }
448  if (type_name == "{i32*, i64}") {
450  }
451  if (type_name == "{i64*, i64}") {
453  }
454  if (type_name == "{float*, i64}") {
456  }
457  if (type_name == "{double*, i64}") {
459  }
460  if (type_name == "{i1*, i64}" || type_name == "{bool*, i64}") {
462  }
463  CHECK(false);
464  return ExtArgumentType::Int16;
465 }
CHECK(cgen_state)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::drop_suffix ( const std::string &  str)

Definition at line 467 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

Referenced by ExtensionFunctionsWhitelist::addCommon().

467  {
468  const auto idx = str.find("__");
469  if (idx == std::string::npos) {
470  return str;
471  }
472  CHECK_GT(idx, std::string::size_type(0));
473  return str.substr(0, idx);
474 }
#define CHECK_GT(x, y)
Definition: Logger.h:209

+ Here is the caller graph for this function:

std::string anonymous_namespace{ExtensionFunctionsWhitelist.cpp}::serialize_type ( const ExtArgumentType  type)

Definition at line 118 of file ExtensionFunctionsWhitelist.cpp.

References ArrayBool, ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, CHECK(), ColumnBool, ColumnDouble, ColumnFloat, ColumnInt16, ColumnInt32, ColumnInt64, ColumnInt8, Cursor, Double, Float, GeoLineString, GeoMultiPolygon, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PBool, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, and Void.

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

118  {
119  switch (type) {
121  return "i8"; // clang converts bool to i8
123  return "i8";
125  return "i16";
127  return "i32";
129  return "i64";
131  return "float";
133  return "double";
135  return "void";
137  return "i8*";
139  return "i16*";
141  return "i32*";
143  return "i64*";
145  return "float*";
147  return "double*";
149  return "i1*";
151  return "{i8*, i64, i8}*";
153  return "{i16*, i64, i8}*";
155  return "{i32*, i64, i8}*";
157  return "{i64*, i64, i8}*";
159  return "{float*, i64, i8}*";
161  return "{double*, i64, i8}*";
163  return "{i1*, i64, i8}*";
165  return "geo_point";
167  return "geo_linestring";
169  return "geo_polygon";
171  return "geo_multi_polygon";
173  return "cursor";
175  return "{i8*, i64}";
177  return "{i16*, i64}";
179  return "{i32*, i64}";
181  return "{i64*, i64}";
183  return "{float*, i64}";
185  return "{double*, i64}";
187  return "{i1*, i64}";
188  default:
189  CHECK(false);
190  }
191  CHECK(false);
192  return "";
193 }
CHECK(cgen_state)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: