OmniSciDB  addbbd5075
 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 289 of file ExtensionFunctionsWhitelist.cpp.

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

Referenced by ExtensionFunctionsWhitelist::addCommon().

289  {
290  if (type_name == "bool" || type_name == "i1") {
291  return ExtArgumentType::Int8; // need to handle the possibility of nulls
292  }
293  if (type_name == "i8") {
294  return ExtArgumentType::Int8;
295  }
296  if (type_name == "i16") {
297  return ExtArgumentType::Int16;
298  }
299  if (type_name == "i32") {
300  return ExtArgumentType::Int32;
301  }
302  if (type_name == "i64") {
303  return ExtArgumentType::Int64;
304  }
305  if (type_name == "float") {
306  return ExtArgumentType::Float;
307  }
308  if (type_name == "double") {
310  }
311  if (type_name == "void") {
312  return ExtArgumentType::Void;
313  }
314  if (type_name == "i8*") {
315  return ExtArgumentType::PInt8;
316  }
317  if (type_name == "i16*") {
319  }
320  if (type_name == "i32*") {
322  }
323  if (type_name == "i64*") {
325  }
326  if (type_name == "float*") {
328  }
329  if (type_name == "double*") {
331  }
332  if (type_name == "array_i8") {
334  }
335  if (type_name == "array_i16") {
337  }
338  if (type_name == "array_i32") {
340  }
341  if (type_name == "array_i64") {
343  }
344  if (type_name == "array_float") {
346  }
347  if (type_name == "array_double") {
349  }
350  if (type_name == "geo_point") {
352  }
353  if (type_name == "geo_linestring") {
355  }
356  if (type_name == "geo_polygon") {
358  }
359  if (type_name == "geo_multi_polygon") {
361  }
362  if (type_name == "cursor") {
364  }
365 
366  CHECK(false);
367  return ExtArgumentType::Int16;
368 }
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 370 of file ExtensionFunctionsWhitelist.cpp.

References CHECK_GT.

Referenced by ExtensionFunctionsWhitelist::addCommon().

370  {
371  const auto idx = str.find("__");
372  if (idx == std::string::npos) {
373  return str;
374  }
375  CHECK_GT(idx, std::string::size_type(0));
376  return str.substr(0, idx);
377 }
#define CHECK_GT(x, y)
Definition: Logger.h:205

+ 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, GeoMultiPolygon, 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 "geo_multi_polygon";
168  return "cursor";
169  default:
170  CHECK(false);
171  }
172  CHECK(false);
173  return "";
174 }
CHECK(cgen_state)

+ Here is the call graph for this function:

+ Here is the caller graph for this function: