OmniSciDB  c07336695a
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

◆ build()

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, anonymous_namespace{TypedDataAccessors.h}::is_null(), run-benchmark-import::optional, UNREACHABLE, and ResultSet::WktString.

1022  {
1023  auto ad_arr = GeoTargetFetcher::fetch(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  switch (return_type) {
1029  if (ad_arr[0]->is_null) {
1030  return ArrayTargetValue(boost::optional<std::vector<ScalarTargetValue>>{});
1031  }
1033  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1034  ad_arr);
1035  }
1038  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1039  ad_arr);
1040  }
1043  if (ad_arr[0]->is_null) {
1044  return GeoTargetValuePtr();
1045  }
1047  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1048  ad_arr);
1049  }
1050  default: {
1051  UNREACHABLE();
1052  return TargetValue(nullptr);
1053  }
1054  }
1055  }
#define UNREACHABLE()
Definition: Logger.h:231
boost::optional< std::vector< ScalarTargetValue > > ArrayTargetValue
Definition: TargetValue.h:157
bool is_null(const T &v, const SQLTypeInfo &t)
boost::variant< ScalarTargetValue, ArrayTargetValue, GeoTargetValue, GeoTargetValuePtr > TargetValue
Definition: TargetValue.h:167
boost::variant< GeoPointTargetValuePtr, GeoLineStringTargetValuePtr, GeoPolyTargetValuePtr, GeoMultiPolyTargetValuePtr > GeoTargetValuePtr
Definition: TargetValue.h:165
+ Here is the call graph for this function:

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