OmniSciDB  471d68cefb
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 1018 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 1020 of file ResultSetIteration.cpp.

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

1022  {
1023  auto ad_arr = GeoTargetFetcher::fetch(geo_ti, return_type, std::forward<T>(vals)...);
1024  static_assert(std::tuple_size<decltype(ad_arr)>::value > 0,
1025  "ArrayDatum array for Geo Target must contain at least one value.");
1026 
1027  // Fetcher sets the geo nullness based on geo typeinfo's notnull, type and
1028  // compression. Serializers will generate appropriate NULL geo where necessary.
1029  switch (return_type) {
1031  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1032  return GeoTargetValue();
1033  }
1035  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1036  ad_arr);
1037  }
1039  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1040  // Generating NULL wkt string to represent NULL geo
1041  return NullableString(nullptr);
1042  }
1044  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1045  ad_arr);
1046  }
1049  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1050  // NULL geo
1051  // Pass along null datum, instead of an empty/null GeoTargetValuePtr
1052  // return GeoTargetValuePtr();
1053  }
1055  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1056  ad_arr);
1057  }
1058  default: {
1059  UNREACHABLE();
1060  return TargetValue(nullptr);
1061  }
1062  }
1063  }
#define UNREACHABLE()
Definition: Logger.h:253
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:336

+ Here is the call graph for this function:


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