OmniSciDB  1dac507f6e
 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 287 of file ExtensionFunctionsWhitelist.cpp.

References ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, CHECK(), Cursor, Double, Float, GeoLineString, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, and Void.

Referenced by ExtensionFunctionsWhitelist::addCommon().

287  {
288  if (type_name == "bool" || type_name == "i1") {
289  return ExtArgumentType::Int8; // need to handle the possibility of nulls
290  }
291  if (type_name == "i8") {
292  return ExtArgumentType::Int8;
293  }
294  if (type_name == "i16") {
295  return ExtArgumentType::Int16;
296  }
297  if (type_name == "i32") {
298  return ExtArgumentType::Int32;
299  }
300  if (type_name == "i64") {
301  return ExtArgumentType::Int64;
302  }
303  if (type_name == "float") {
304  return ExtArgumentType::Float;
305  }
306  if (type_name == "double") {
308  }
309  if (type_name == "void") {
310  return ExtArgumentType::Void;
311  }
312  if (type_name == "i8*") {
313  return ExtArgumentType::PInt8;
314  }
315  if (type_name == "i16*") {
317  }
318  if (type_name == "i32*") {
320  }
321  if (type_name == "i64*") {
323  }
324  if (type_name == "float*") {
326  }
327  if (type_name == "double*") {
329  }
330  if (type_name == "array_i8") {
332  }
333  if (type_name == "array_i16") {
335  }
336  if (type_name == "array_i32") {
338  }
339  if (type_name == "array_i64") {
341  }
342  if (type_name == "array_float") {
344  }
345  if (type_name == "array_double") {
347  }
348  if (type_name == "geo_point") {
350  }
351  if (type_name == "geo_linestring") {
353  }
354  if (type_name == "geo_polygon") {
356  }
357  if (type_name == "cursor") {
359  }
360 
361  CHECK(false);
362  return ExtArgumentType::Int16;
363 }
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 365 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

Referenced by ExtensionFunctionsWhitelist::addCommon().

365  {
366  const auto idx = str.find("__");
367  if (idx == std::string::npos) {
368  return str;
369  }
370  CHECK_GT(idx, std::string::size_type(0));
371  return str.substr(0, idx);
372 }
#define CHECK_GT(x, y)
Definition: Logger.h:202

+ Here is the caller graph for this function:

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

Definition at line 117 of file ExtensionFunctionsWhitelist.cpp.

References ArrayDouble, ArrayFloat, ArrayInt16, ArrayInt32, ArrayInt64, ArrayInt8, Bool, CHECK(), Cursor, Double, Float, GeoLineString, GeoPoint, GeoPolygon, Int16, Int32, Int64, Int8, PDouble, PFloat, PInt16, PInt32, PInt64, PInt8, and Void.

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

117  {
118  switch (type) {
120  return "i1";
122  return "i8";
124  return "i16";
126  return "i32";
128  return "i64";
130  return "float";
132  return "double";
134  return "void";
136  return "i8*";
138  return "i16*";
140  return "i32*";
142  return "i64*";
144  return "float*";
146  return "double*";
148  return "array_i8";
150  return "array_i16";
152  return "array_i32";
154  return "array_i64";
156  return "array_float";
158  return "array_double";
160  return "geo_point";
162  return "geo_linestring";
164  return "geo_polygon";
166  return "cursor";
167  default:
168  CHECK(false);
169  }
170  CHECK(false);
171  return "";
172 }
CHECK(cgen_state)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: