OmniSciDB  bf83d84833
 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, bool byval=true)
 
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 494 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, TextEncodingDict16, TextEncodingDict32, TextEncodingDict8, TextEncodingNone, and Void.

Referenced by ExtensionFunctionsWhitelist::addCommon().

494  {
495  if (type_name == "bool" || type_name == "i1") {
496  return ExtArgumentType::Bool;
497  }
498  if (type_name == "i8") {
499  return ExtArgumentType::Int8;
500  }
501  if (type_name == "i16") {
502  return ExtArgumentType::Int16;
503  }
504  if (type_name == "i32") {
505  return ExtArgumentType::Int32;
506  }
507  if (type_name == "i64") {
508  return ExtArgumentType::Int64;
509  }
510  if (type_name == "float") {
511  return ExtArgumentType::Float;
512  }
513  if (type_name == "double") {
515  }
516  if (type_name == "void") {
517  return ExtArgumentType::Void;
518  }
519  if (type_name == "i8*") {
520  return ExtArgumentType::PInt8;
521  }
522  if (type_name == "i16*") {
524  }
525  if (type_name == "i32*") {
527  }
528  if (type_name == "i64*") {
530  }
531  if (type_name == "float*") {
533  }
534  if (type_name == "double*") {
536  }
537  if (type_name == "i1*" || type_name == "bool*") {
538  return ExtArgumentType::PBool;
539  }
540  if (type_name == "{i8*, i64, i8}*") {
542  }
543  if (type_name == "{i16*, i64, i8}*") {
545  }
546  if (type_name == "{i32*, i64, i8}*") {
548  }
549  if (type_name == "{i64*, i64, i8}*") {
551  }
552  if (type_name == "{float*, i64, i8}*") {
554  }
555  if (type_name == "{double*, i64, i8}*") {
557  }
558  if (type_name == "{i1*, i64, i8}*" || type_name == "{bool*, i64, i8}*") {
560  }
561  if (type_name == "geo_point") {
563  }
564  if (type_name == "geo_linestring") {
566  }
567  if (type_name == "geo_polygon") {
569  }
570  if (type_name == "geo_multi_polygon") {
572  }
573  if (type_name == "cursor") {
575  }
576  if (type_name == "{i8*, i64}") {
578  }
579  if (type_name == "{i16*, i64}") {
581  }
582  if (type_name == "{i32*, i64}") {
584  }
585  if (type_name == "{i64*, i64}") {
587  }
588  if (type_name == "{float*, i64}") {
590  }
591  if (type_name == "{double*, i64}") {
593  }
594  if (type_name == "{i1*, i64}" || type_name == "{bool*, i64}") {
596  }
597  if (type_name == "text_encoding_none") {
599  }
600  if (type_name == "text_encoding_dict8") {
602  }
603  if (type_name == "text_encoding_dict16") {
605  }
606  if (type_name == "text_encoding_dict32") {
608  }
609  CHECK(false);
610  return ExtArgumentType::Int16;
611 }
#define CHECK(condition)
Definition: Logger.h:197
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 207 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

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

207  {
208  const auto idx = str.find("__");
209  if (idx == std::string::npos) {
210  return str;
211  }
212  CHECK_GT(idx, std::string::size_type(0));
213  return str.substr(0, idx);
214 }
#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,
bool  byval = true 
)

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

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

122  {
123  switch (type) {
125  return "i8"; // clang converts bool to i8
127  return "i8";
129  return "i16";
131  return "i32";
133  return "i64";
135  return "float";
137  return "double";
139  return "void";
141  return "i8*";
143  return "i16*";
145  return "i32*";
147  return "i64*";
149  return "float*";
151  return "double*";
153  return "i1*";
155  return "{i8*, i64, i8}*";
157  return "{i16*, i64, i8}*";
159  return "{i32*, i64, i8}*";
161  return "{i64*, i64, i8}*";
163  return "{float*, i64, i8}*";
165  return "{double*, i64, i8}*";
167  return "{i1*, i64, i8}*";
169  return "geo_point";
171  return "geo_linestring";
173  return "geo_polygon";
175  return "geo_multi_polygon";
177  return "cursor";
179  return (byval ? "{i8*, i64}" : "i8*");
181  return (byval ? "{i16*, i64}" : "i8*");
183  return (byval ? "{i32*, i64}" : "i8*");
185  return (byval ? "{i64*, i64}" : "i8*");
187  return (byval ? "{float*, i64}" : "i8*");
189  return (byval ? "{double*, i64}" : "i8*");
191  return (byval ? "{i1*, i64}" : "i8*");
193  return "text_encoding_node";
195  return "text_encoding_dict8";
197  return "text_encoding_dict16";
199  return "text_encoding_dict32";
200  default:
201  CHECK(false);
202  }
203  CHECK(false);
204  return "";
205 }
#define CHECK(condition)
Definition: Logger.h:197

+ Here is the caller graph for this function: