OmniSciDB  b24e664e58
 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 1032 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 1034 of file ResultSetIteration.cpp.

References ResultSet::GeoTargetValue, ResultSet::GeoTargetValueGpuPtr, ResultSet::GeoTargetValuePtr, UNREACHABLE, and ResultSet::WktString.

1036  {
1037  auto ad_arr = GeoTargetFetcher::fetch(return_type, std::forward<T>(vals)...);
1038  static_assert(std::tuple_size<decltype(ad_arr)>::value > 0,
1039  "ArrayDatum array for Geo Target must contain at least one value.");
1040 
1041  switch (return_type) {
1043  // Removing errant NULL check: default ChunkIter accessor may mistake POINT coords
1044  // fixlen array for a NULL, plus it is not needed currently - there is no NULL geo
1045  // in existing tables, all NULL/empty geo is currently discarded on import.
1046  // TODO: add custom ChunkIter accessor able to properly recognize NULL coords
1047  // TODO: once NULL geo support is in, resurrect coords NULL check under !notnull
1048  // if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1049  // return GeoTargetValue();
1050  // }
1052  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1053  ad_arr);
1054  }
1057  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1058  ad_arr);
1059  }
1062  // See the comment above.
1063  // if (!geo_ti.get_notnull() && ad_arr[0]->is_null) {
1064  // return GeoTargetValuePtr();
1065  // }
1067  GEO_SOURCE_TYPE>::GeoSerializerType::serialize(geo_ti,
1068  ad_arr);
1069  }
1070  default: {
1071  UNREACHABLE();
1072  return TargetValue(nullptr);
1073  }
1074  }
1075  }
#define UNREACHABLE()
Definition: Logger.h:234
boost::variant< ScalarTargetValue, ArrayTargetValue, GeoTargetValue, GeoTargetValuePtr > TargetValue
Definition: TargetValue.h:167

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