OmniSciDB  e465130ba1
 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 1075 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 1077 of file ResultSetIteration.cpp.

References ResultSet::GeoTargetValue, ResultSet::GeoTargetValueGpuPtr, ResultSet::GeoTargetValuePtr, SQLTypeInfoCore< TYPE_FACET_PACK >::get_notnull(), UNREACHABLE, and ResultSet::WktString.

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

+ Here is the call graph for this function:


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