OmniSciDB  95562058bd
 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 1077 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 1079 of file ResultSetIteration.cpp.

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

1081  {
1082  auto ad_arr = GeoTargetFetcher::fetch(geo_ti, return_type, std::forward<T>(vals)...);
1083  static_assert(std::tuple_size<decltype(ad_arr)>::value > 0,
1084  "ArrayDatum array for Geo Target must contain at least one value.");
1085 
1086  // Fetcher sets the geo nullness based on geo typeinfo's notnull, type and
1087  // compression. Serializers will generate appropriate NULL geo where necessary.
1088  switch (return_type) {
1090  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1091  return GeoTargetValue();
1092  }
1094  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1095  ad_arr);
1096  }
1098  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1099  // May need to generate EMPTY wkt instead of NULL
1100  return NullableString("NULL");
1101  }
1103  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1104  ad_arr);
1105  }
1108  if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1109  // NULL geo
1110  // Pass along null datum, instead of an empty/null GeoTargetValuePtr
1111  // return GeoTargetValuePtr();
1112  }
1114  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1115  ad_arr);
1116  }
1117  default: {
1118  UNREACHABLE();
1119  return TargetValue(nullptr);
1120  }
1121  }
1122  }
#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:266

+ Here is the call graph for this function:


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