OmniSciDB  72c90bc290
 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 1020 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 1022 of file ResultSetIteration.cpp.

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

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

+ Here is the call graph for this function:


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