OmniSciDB  bf83d84833
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
anonymous_namespace{ResultSetIteration.cpp}::GeoTargetValueBuilder< GEO_SOURCE_TYPE, GeoTargetFetcher > Struct Template Reference

Static Public Member Functions

template<typename... T>
static TargetValue build (const SQLTypeInfo &geo_ti, const ResultSet::GeoReturnType return_type, T &&...vals)
 

Detailed Description

template<SQLTypes GEO_SOURCE_TYPE, typename GeoTargetFetcher>
struct anonymous_namespace{ResultSetIteration.cpp}::GeoTargetValueBuilder< GEO_SOURCE_TYPE, GeoTargetFetcher >

Definition at line 1016 of file ResultSetIteration.cpp.

Member Function Documentation

template<SQLTypes GEO_SOURCE_TYPE, typename GeoTargetFetcher >
template<typename... T>
static TargetValue anonymous_namespace{ResultSetIteration.cpp}::GeoTargetValueBuilder< GEO_SOURCE_TYPE, GeoTargetFetcher >::build ( const SQLTypeInfo geo_ti,
const ResultSet::GeoReturnType  return_type,
T &&...  vals 
)
inlinestatic

Definition at line 1018 of file ResultSetIteration.cpp.

References ResultSet::GeoTargetValue, ResultSet::GeoTargetValueGpuPtr, ResultSet::GeoTargetValuePtr, SQLTypeInfo::get_notnull(), UNREACHABLE, and ResultSet::WktString.

1020  {
1021  auto ad_arr = GeoTargetFetcher::fetch(geo_ti, return_type, std::forward<T>(vals)...);
1022  static_assert(std::tuple_size<decltype(ad_arr)>::value > 0,
1023  "ArrayDatum array for Geo Target must contain at least one value.");
1024 
1025  // Fetcher sets the geo nullness based on geo typeinfo's notnull, type and
1026  // compression. Serializers will generate appropriate NULL geo where necessary.
1027  switch (return_type) {
1029  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1030  return GeoTargetValue();
1031  }
1033  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1034  ad_arr);
1035  }
1037  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1038  // Generating NULL wkt string to represent NULL geo
1039  return NullableString(nullptr);
1040  }
1042  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1043  ad_arr);
1044  }
1047  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1048  // NULL geo
1049  // Pass along null datum, instead of an empty/null GeoTargetValuePtr
1050  // return GeoTargetValuePtr();
1051  }
1053  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1054  ad_arr);
1055  }
1056  default: {
1057  UNREACHABLE();
1058  return TargetValue(nullptr);
1059  }
1060  }
1061  }
#define UNREACHABLE()
Definition: Logger.h:241
boost::optional< boost::variant< GeoPointTargetValue, GeoLineStringTargetValue, GeoPolyTargetValue, GeoMultiPolyTargetValue >> GeoTargetValue
Definition: TargetValue.h:161
boost::variant< std::string, void * > NullableString
Definition: TargetValue.h:155
boost::variant< ScalarTargetValue, ArrayTargetValue, GeoTargetValue, GeoTargetValuePtr > TargetValue
Definition: TargetValue.h:167
HOST DEVICE bool get_notnull() const
Definition: sqltypes.h:318

+ Here is the call graph for this function:


The documentation for this struct was generated from the following file: