OmniSciDB  085a039ca4
 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 1022 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 1024 of file ResultSetIteration.cpp.

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

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