OmniSciDB  a5dc49c757
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
heavydbColumnOps.cpp File Reference
#include "heavydbTypes.h"
+ Include dependency graph for heavydbColumnOps.cpp:

Go to the source code of this file.

Macros

#define EXPOSE_isNull(RowType)
 
#define EXPOSE_setNull(RowType)
 
#define EXPOSE_getItem(RowType, TypeName)
 
#define EXPOSE_setItem(RowType, TypeName)
 
#define EXPOSE_getNofValues(RowType)
 
#define EXPOSE(RowType, TypeName)
 
#define EXPOSE_Geo_isNull(BaseType)
 
#define EXPOSE_Geo_size(BaseType)
 
#define EXPOSE_Geo_fromCoords_vec2(BaseType)
 
#define EXPOSE_Geo_fromCoords_vec(BaseType)
 
#define EXPOSE_Geo_toCoords_vec(BaseType)
 
#define EXPOSE_Geo_toCoords_vec2(BaseType)
 
#define EXPOSE_Geo_getItem_Point2D(BaseType, ItemType)
 
#define EXPOSE_Geo_getItem(BaseType, ItemType)
 
#define EXPOSE_Geo_Point2D(BaseType, ItemType)
 
#define EXPOSE_Geo(BaseType, ItemType)
 
#define LIST_FUNCTION_W_SUFFIX(RowType, Suffix)   avoid_opt_address_geo(reinterpret_cast<void*>(Column##RowType##_##Suffix))
 
#define LIST_GEO_fromCoords(RowType)   avoid_opt_address_geo(reinterpret_cast<void*>(RowType##_fromCoords))
 
#define LIST_Geo_toCoords_vec(RowType)   avoid_opt_address_geo(reinterpret_cast<void*>(RowType##_toCoords_get_value))
 
#define LIST_Geo_toCoords_vec2(RowType)   avoid_opt_address_geo(reinterpret_cast<void*>(RowType##_toCoords_get_value))
 
#define LIST_FUNCTIONS(RowType)
 

Functions

DEVICE RUNTIME_EXPORT void ColumnGeoPoint_getItem (const Column< GeoPoint > &col, int64_t index, int32_t output_srid, Geo::Point2D &result)
 
DEVICE RUNTIME_EXPORT bool ColumnGeoPoint_isNull (const Column< GeoPoint > &col, int64_t index)
 
DEVICE RUNTIME_EXPORT void ColumnGeoPoint_setNull (Column< GeoPoint > &col, int64_t index)
 
DEVICE RUNTIME_EXPORT void ColumnGeoPoint_setItem (Column< GeoPoint > &col, int64_t index, const Geo::Point2D &other)
 
 EXPOSE (GeoLineString, Geo::LineString)
 
 EXPOSE (GeoMultiPoint, Geo::MultiPoint)
 
 EXPOSE (GeoPolygon, Geo::Polygon)
 
 EXPOSE (GeoMultiLineString, Geo::MultiLineString)
 
 EXPOSE (GeoMultiPolygon, Geo::MultiPolygon)
 
 EXPOSE (TextEncodingNone, flatbuffer::TextEncodingNone)
 
DEVICE RUNTIME_EXPORT void GeoMultiPolygon_fromCoords (Geo::MultiPolygon &base, double *data, int64_t *dim_x, int64_t *dim_y, int64_t size_dim_x, int64_t size_dim_y)
 
 EXPOSE_Geo_Point2D (LineString, Point2D)
 
 EXPOSE_Geo_Point2D (MultiPoint, Point2D)
 
 EXPOSE_Geo (MultiLineString, LineString)
 
 EXPOSE_Geo (Polygon, LineString)
 
 EXPOSE_Geo (MultiPolygon, Polygon)
 
 EXPOSE_Geo_fromCoords_vec (LineString)
 
 EXPOSE_Geo_fromCoords_vec (MultiPoint)
 
 EXPOSE_Geo_fromCoords_vec2 (Polygon)
 
 EXPOSE_Geo_fromCoords_vec2 (MultiLineString)
 
 EXPOSE_Geo_toCoords_vec (MultiPoint)
 
 EXPOSE_Geo_toCoords_vec (LineString)
 
 EXPOSE_Geo_toCoords_vec2 (Polygon)
 
 EXPOSE_Geo_toCoords_vec2 (MultiLineString)
 
DEVICE RUNTIME_EXPORT void ColumnTextEncodingNone_setItem_fromBuffer (Column< TextEncodingNone > &col, int64_t index, int8_t *rhs)
 
DEVICE RUNTIME_EXPORT void ColumnTextEncodingNone_concatItem_fromBuffer (Column< TextEncodingNone > &col, int64_t index, int8_t *rhs)
 
DEVICE RUNTIME_EXPORT void ColumnTextEncodingNone_concatItem (Column< TextEncodingNone > &col, int64_t index, int8_t *rhs)
 
volatile bool avoid_opt_address_geo (void *address)
 
bool functions_exist_geo_column ()
 

Macro Definition Documentation

#define EXPOSE (   RowType,
  TypeName 
)
Value:
EXPOSE_isNull(RowType); \
EXPOSE_setNull(RowType); \
EXPOSE_getItem(RowType, TypeName); \
EXPOSE_setItem(RowType, TypeName);
#define EXPOSE_setNull(RowType)
#define EXPOSE_setItem(RowType, TypeName)
#define EXPOSE_getItem(RowType, TypeName)
#define EXPOSE_isNull(RowType)
#define EXPOSE_getNofValues(RowType)

Definition at line 83 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo (   BaseType,
  ItemType 
)
Value:
EXPOSE_Geo_isNull(BaseType); \
EXPOSE_Geo_size(BaseType); \
EXPOSE_Geo_getItem(BaseType, ItemType);
#define EXPOSE_Geo_isNull(BaseType)
#define EXPOSE_Geo_size(BaseType)
#define EXPOSE_Geo_getItem(BaseType, ItemType)

Definition at line 189 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_fromCoords_vec (   BaseType)
Value:
extern "C" DEVICE RUNTIME_EXPORT void Geo##BaseType##_fromCoords( \
Geo::BaseType& base, double* lst, int64_t size) { \
std::vector<double> coords(lst, lst + size); \
base.fromCoords(coords); \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 145 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_fromCoords_vec2 (   BaseType)
Value:
extern "C" DEVICE RUNTIME_EXPORT void Geo##BaseType##_fromCoords( \
Geo::BaseType& base, double* data, int64_t* indices, int64_t nrows) { \
std::vector<std::vector<double>> coords; \
int64_t offset = 0; \
for (int64_t i = 0; i < nrows; i++) { \
int64_t size = indices[i]; \
std::vector<double> row(data + offset, data + offset + size); \
coords.push_back(row); \
offset += size; \
} \
base.fromCoords(coords); \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 130 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_getItem (   BaseType,
  ItemType 
)
Value:
extern "C" DEVICE RUNTIME_EXPORT void Geo##BaseType##_getItem( \
Geo::BaseType& base, int64_t index, Geo::ItemType& result) { \
Geo::ItemType out = base.getItem(index); \
result.flatbuffer_ = out.flatbuffer_; \
result.n_ = out.n_; \
for (int i = 0; i < NESTED_ARRAY_NDIM; i++) \
result.index_[i] = out.index_[i]; \
}
#define DEVICE
#define RUNTIME_EXPORT
#define NESTED_ARRAY_NDIM
Definition: heavydbTypes.h:452

Definition at line 174 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_getItem_Point2D (   BaseType,
  ItemType 
)
Value:
extern "C" DEVICE RUNTIME_EXPORT void Geo##BaseType##_getItem( \
Geo::BaseType& base, int64_t index, Geo::ItemType& result) { \
Geo::ItemType out = base.getItem(index); \
result.x = out.x; \
result.y = out.y; \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 166 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_isNull (   BaseType)
Value:
extern "C" DEVICE RUNTIME_EXPORT bool Geo##BaseType##_isNull(Geo::BaseType& base) { \
return base.isNull(); \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 100 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_Point2D (   BaseType,
  ItemType 
)
Value:
EXPOSE_Geo_isNull(BaseType); \
EXPOSE_Geo_size(BaseType); \
EXPOSE_Geo_getItem_Point2D(BaseType, ItemType);
#define EXPOSE_Geo_getItem_Point2D(BaseType, ItemType)
#define EXPOSE_Geo_isNull(BaseType)
#define EXPOSE_Geo_size(BaseType)

Definition at line 184 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_size (   BaseType)
Value:
extern "C" DEVICE RUNTIME_EXPORT size_t Geo##BaseType##_size(Geo::BaseType& base) { \
return base.size(); \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 105 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_toCoords_vec (   BaseType)
Value:
extern "C" DEVICE RUNTIME_EXPORT double Geo##BaseType##_toCoords_get_value( \
Geo::BaseType& base, int64_t index) { \
Geo::Point2D p = base[index / 2]; \
return (index % 2 == 0) ? p.x : p.y; \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 152 of file heavydbColumnOps.cpp.

#define EXPOSE_Geo_toCoords_vec2 (   BaseType)
Value:
extern "C" DEVICE RUNTIME_EXPORT double Geo##BaseType##_toCoords_get_value( \
const Geo::BaseType& base, int64_t ring_index, int64_t coord_index) { \
Geo::Point2D p = base[ring_index][coord_index / 2]; \
return (coord_index % 2 == 0) ? p.x : p.y; \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 159 of file heavydbColumnOps.cpp.

#define EXPOSE_getItem (   RowType,
  TypeName 
)
Value:
extern "C" DEVICE RUNTIME_EXPORT void Column##RowType##_getItem( \
Column<RowType>& col, int64_t index, TypeName& rhs) { \
TypeName out = col.getItem(index); \
rhs.flatbuffer_ = out.flatbuffer_; \
rhs.n_ = out.n_; \
for (int i = 0; i < NESTED_ARRAY_NDIM; i++) \
rhs.index_[i] = out.index_[i]; \
}
#define DEVICE
#define RUNTIME_EXPORT
#define NESTED_ARRAY_NDIM
Definition: heavydbTypes.h:452

Definition at line 61 of file heavydbColumnOps.cpp.

#define EXPOSE_getNofValues (   RowType)
Value:
extern "C" DEVICE RUNTIME_EXPORT int64_t Column##RowType##_getNofValues( \
Column<RowType>& col) { \
return col.getNofValues(); \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 77 of file heavydbColumnOps.cpp.

#define EXPOSE_isNull (   RowType)
Value:
extern "C" DEVICE RUNTIME_EXPORT bool Column##RowType##_isNull(Column<RowType>& col, \
int64_t index) { \
return col.isNull(index); \
}
#define DEVICE
#define RUNTIME_EXPORT
DEVICE bool isNull(int64_t index) const

Definition at line 48 of file heavydbColumnOps.cpp.

#define EXPOSE_setItem (   RowType,
  TypeName 
)
Value:
extern "C" DEVICE RUNTIME_EXPORT void Column##RowType##_setItem( \
Column<RowType>& col, int64_t index, TypeName& rhs) { \
col.setItem(index, rhs); \
}
#define DEVICE
#define RUNTIME_EXPORT

Definition at line 71 of file heavydbColumnOps.cpp.

#define EXPOSE_setNull (   RowType)
Value:
extern "C" DEVICE RUNTIME_EXPORT void Column##RowType##_setNull(Column<RowType>& col, \
int64_t index) { \
col.setNull(index); \
}
#define DEVICE
#define RUNTIME_EXPORT
DEVICE void setNull(int64_t index)

Definition at line 54 of file heavydbColumnOps.cpp.

#define LIST_FUNCTION_W_SUFFIX (   RowType,
  Suffix 
)    avoid_opt_address_geo(reinterpret_cast<void*>(Column##RowType##_##Suffix))

Definition at line 242 of file heavydbColumnOps.cpp.

#define LIST_FUNCTIONS (   RowType)
Value:
LIST_FUNCTION_W_SUFFIX(RowType, getItem) && \
LIST_FUNCTION_W_SUFFIX(RowType, setItem) && \
LIST_FUNCTION_W_SUFFIX(RowType, isNull) && \
LIST_FUNCTION_W_SUFFIX(RowType, setNull) && \
LIST_FUNCTION_W_SUFFIX(RowType, getNofValues)
#define LIST_FUNCTION_W_SUFFIX(RowType, Suffix)

Definition at line 254 of file heavydbColumnOps.cpp.

Referenced by functions_exist_geo_column().

#define LIST_GEO_fromCoords (   RowType)    avoid_opt_address_geo(reinterpret_cast<void*>(RowType##_fromCoords))

Definition at line 245 of file heavydbColumnOps.cpp.

Referenced by functions_exist_geo_column().

#define LIST_Geo_toCoords_vec (   RowType)    avoid_opt_address_geo(reinterpret_cast<void*>(RowType##_toCoords_get_value))

Definition at line 248 of file heavydbColumnOps.cpp.

Referenced by functions_exist_geo_column().

#define LIST_Geo_toCoords_vec2 (   RowType)    avoid_opt_address_geo(reinterpret_cast<void*>(RowType##_toCoords_get_value))

Definition at line 251 of file heavydbColumnOps.cpp.

Referenced by functions_exist_geo_column().

Function Documentation

volatile bool avoid_opt_address_geo ( void *  address)

Definition at line 238 of file heavydbColumnOps.cpp.

Referenced by functions_exist_geo_column().

238  {
239  return address != nullptr;
240 }

+ Here is the caller graph for this function:

DEVICE RUNTIME_EXPORT void ColumnGeoPoint_getItem ( const Column< GeoPoint > &  col,
int64_t  index,
int32_t  output_srid,
Geo::Point2D result 
)

Definition at line 22 of file heavydbColumnOps.cpp.

References Column< GeoPoint >::getItem().

Referenced by functions_exist_geo_column().

25  {
26  result = col.getItem(index, output_srid);
27 }
DEVICE Geo::Point2D getItem(const int64_t index, const int32_t output_srid=0) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE RUNTIME_EXPORT bool ColumnGeoPoint_isNull ( const Column< GeoPoint > &  col,
int64_t  index 
)

Definition at line 29 of file heavydbColumnOps.cpp.

References Column< GeoPoint >::isNull().

Referenced by functions_exist_geo_column().

30  {
31  return col.isNull(index);
32 }
DEVICE bool isNull(int64_t index) const

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE RUNTIME_EXPORT void ColumnGeoPoint_setItem ( Column< GeoPoint > &  col,
int64_t  index,
const Geo::Point2D other 
)

Definition at line 39 of file heavydbColumnOps.cpp.

References Column< GeoPoint >::setItem().

Referenced by functions_exist_geo_column().

41  {
42  col.setItem(index, other);
43 }
DEVICE void setItem(int64_t index, const Geo::Point2D &other)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE RUNTIME_EXPORT void ColumnGeoPoint_setNull ( Column< GeoPoint > &  col,
int64_t  index 
)

Definition at line 34 of file heavydbColumnOps.cpp.

References Column< GeoPoint >::setNull().

Referenced by functions_exist_geo_column().

35  {
36  col.setNull(index);
37 }
DEVICE void setNull(int64_t index)

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

DEVICE RUNTIME_EXPORT void ColumnTextEncodingNone_concatItem ( Column< TextEncodingNone > &  col,
int64_t  index,
int8_t *  rhs 
)

Definition at line 229 of file heavydbColumnOps.cpp.

232  {
233  col[index] += *(reinterpret_cast<flatbuffer::TextEncodingNone*>(rhs));
234 }
DEVICE RUNTIME_EXPORT void ColumnTextEncodingNone_concatItem_fromBuffer ( Column< TextEncodingNone > &  col,
int64_t  index,
int8_t *  rhs 
)

Definition at line 222 of file heavydbColumnOps.cpp.

225  {
226  col[index] += *(reinterpret_cast<TextEncodingNone*>(rhs));
227 }
DEVICE RUNTIME_EXPORT void ColumnTextEncodingNone_setItem_fromBuffer ( Column< TextEncodingNone > &  col,
int64_t  index,
int8_t *  rhs 
)

Definition at line 215 of file heavydbColumnOps.cpp.

References flatbuffer::Column< RowType, RowStruct >::setItem().

218  {
219  col.setItem(index, *(reinterpret_cast<TextEncodingNone*>(rhs)));
220 }
DEVICE void setItem(int64_t index, const RowType &item)

+ Here is the call graph for this function:

EXPOSE ( GeoLineString  ,
Geo::LineString   
)
EXPOSE ( GeoMultiPoint  ,
Geo::MultiPoint   
)
EXPOSE ( GeoPolygon  ,
Geo::Polygon   
)
EXPOSE ( GeoMultiPolygon  ,
Geo::MultiPolygon   
)
EXPOSE_Geo ( MultiLineString  ,
LineString   
)
EXPOSE_Geo ( Polygon  ,
LineString   
)
EXPOSE_Geo ( MultiPolygon  ,
Polygon   
)
EXPOSE_Geo_fromCoords_vec ( LineString  )
EXPOSE_Geo_fromCoords_vec ( MultiPoint  )
EXPOSE_Geo_fromCoords_vec2 ( Polygon  )
EXPOSE_Geo_fromCoords_vec2 ( MultiLineString  )
EXPOSE_Geo_Point2D ( LineString  ,
Point2D   
)
EXPOSE_Geo_Point2D ( MultiPoint  ,
Point2D   
)
EXPOSE_Geo_toCoords_vec ( MultiPoint  )
EXPOSE_Geo_toCoords_vec ( LineString  )
EXPOSE_Geo_toCoords_vec2 ( Polygon  )
EXPOSE_Geo_toCoords_vec2 ( MultiLineString  )
bool functions_exist_geo_column ( )

Definition at line 261 of file heavydbColumnOps.cpp.

References avoid_opt_address_geo(), ColumnGeoPoint_getItem(), ColumnGeoPoint_isNull(), ColumnGeoPoint_setItem(), ColumnGeoPoint_setNull(), LIST_FUNCTIONS, LIST_GEO_fromCoords, LIST_Geo_toCoords_vec, and LIST_Geo_toCoords_vec2.

261  {
262  bool ret = true;
263  ret &=
264  (avoid_opt_address_geo(reinterpret_cast<void*>(ColumnGeoPoint_getItem)) &&
265  avoid_opt_address_geo(reinterpret_cast<void*>(ColumnGeoPoint_isNull)) &&
266  avoid_opt_address_geo(reinterpret_cast<void*>(ColumnGeoPoint_setItem)) &&
267  avoid_opt_address_geo(reinterpret_cast<void*>(ColumnGeoPoint_setNull)) &&
268  avoid_opt_address_geo(reinterpret_cast<void*>(GeoLineString_toCoords_get_value)) &&
269  avoid_opt_address_geo(reinterpret_cast<void*>(ColumnGeoPoint_setNull)));
271  ret &= LIST_FUNCTIONS(GeoPolygon);
274 
275  // Geo fromCoords
281 
282  // Geo toCoords
287 
288  return ret;
289 }
DEVICE RUNTIME_EXPORT bool ColumnGeoPoint_isNull(const Column< GeoPoint > &col, int64_t index)
Simplified core of GeoJSON Polygon coordinates definition.
#define LIST_Geo_toCoords_vec(RowType)
#define LIST_GEO_fromCoords(RowType)
Simplified core of GeoJSON MultiPolygon coordinates definition.
#define LIST_Geo_toCoords_vec2(RowType)
#define LIST_FUNCTIONS(RowType)
DEVICE RUNTIME_EXPORT void ColumnGeoPoint_setItem(Column< GeoPoint > &col, int64_t index, const Geo::Point2D &other)
DEVICE RUNTIME_EXPORT void ColumnGeoPoint_setNull(Column< GeoPoint > &col, int64_t index)
DEVICE RUNTIME_EXPORT void ColumnGeoPoint_getItem(const Column< GeoPoint > &col, int64_t index, int32_t output_srid, Geo::Point2D &result)
volatile bool avoid_opt_address_geo(void *address)

+ Here is the call graph for this function:

DEVICE RUNTIME_EXPORT void GeoMultiPolygon_fromCoords ( Geo::MultiPolygon base,
double *  data,
int64_t *  dim_x,
int64_t *  dim_y,
int64_t  size_dim_x,
int64_t  size_dim_y 
)

Definition at line 110 of file heavydbColumnOps.cpp.

References Geo::GeoNestedArray< ItemType >::fromCoords().

115  {
116  std::vector<std::vector<std::vector<double>>> coords(size_dim_x);
117  int l = 0;
118  for (int i = 0; i < size_dim_x; i++) {
119  coords[i].resize(size_dim_y);
120  for (int j = 0; j < size_dim_y; j++) {
121  coords[i][j].resize(dim_y[j]);
122  for (int k = 0; k < dim_y[j]; k++) {
123  coords[i][j][k] = data[l++];
124  }
125  }
126  }
127  base.fromCoords(coords);
128 }
FlatBufferManager::Status fromCoords(const std::vector< CT > &coords)

+ Here is the call graph for this function: