diff --git a/flink-processor/src/main/java/org/mobilitydb/flink/meos/MeosOpsFreeH3.java b/flink-processor/src/main/java/org/mobilitydb/flink/meos/MeosOpsFreeH3.java new file mode 100644 index 0000000..df5814d --- /dev/null +++ b/flink-processor/src/main/java/org/mobilitydb/flink/meos/MeosOpsFreeH3.java @@ -0,0 +1,258 @@ +package org.mobilitydb.flink.meos; + +/* AUTO-GENERATED by tools/codegen/emit_h3_facade.py — do not edit by hand. + * H3 / th3index family facade over functions.GeneratedFunctions. + */ + +import functions.GeneratedFunctions; +import jnr.ffi.Pointer; + +public final class MeosOpsFreeH3 { + + public static final boolean MEOS_AVAILABLE = MeosOpsRuntime.MEOS_AVAILABLE; + + private MeosOpsFreeH3() { /* utility */ } + + /** MEOS {@code always_eq_h3index_th3index} — H3 / th3index family. */ + public static int always_eq_h3index_th3index(long arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "always_eq_h3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.always_eq_h3index_th3index(arg0, arg1); + } + + /** MEOS {@code always_eq_th3index_h3index} — H3 / th3index family. */ + public static int always_eq_th3index_h3index(jnr.ffi.Pointer arg0, long arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "always_eq_th3index_h3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.always_eq_th3index_h3index(arg0, arg1); + } + + /** MEOS {@code always_eq_th3index_th3index} — H3 / th3index family. */ + public static int always_eq_th3index_th3index(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "always_eq_th3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.always_eq_th3index_th3index(arg0, arg1); + } + + /** MEOS {@code always_ne_h3index_th3index} — H3 / th3index family. */ + public static int always_ne_h3index_th3index(long arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "always_ne_h3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.always_ne_h3index_th3index(arg0, arg1); + } + + /** MEOS {@code always_ne_th3index_h3index} — H3 / th3index family. */ + public static int always_ne_th3index_h3index(jnr.ffi.Pointer arg0, long arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "always_ne_th3index_h3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.always_ne_th3index_h3index(arg0, arg1); + } + + /** MEOS {@code always_ne_th3index_th3index} — H3 / th3index family. */ + public static int always_ne_th3index_th3index(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "always_ne_th3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.always_ne_th3index_th3index(arg0, arg1); + } + + /** MEOS {@code ever_eq_h3index_th3index} — H3 / th3index family. */ + public static int ever_eq_h3index_th3index(long arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "ever_eq_h3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.ever_eq_h3index_th3index(arg0, arg1); + } + + /** MEOS {@code ever_eq_h3indexset_th3index} — H3 / th3index family. */ + public static int ever_eq_h3indexset_th3index(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "ever_eq_h3indexset_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.ever_eq_h3indexset_th3index(arg0, arg1); + } + + /** MEOS {@code ever_eq_th3index_h3index} — H3 / th3index family. */ + public static int ever_eq_th3index_h3index(jnr.ffi.Pointer arg0, long arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "ever_eq_th3index_h3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.ever_eq_th3index_h3index(arg0, arg1); + } + + /** MEOS {@code ever_eq_th3index_th3index} — H3 / th3index family. */ + public static int ever_eq_th3index_th3index(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "ever_eq_th3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.ever_eq_th3index_th3index(arg0, arg1); + } + + /** MEOS {@code ever_ne_h3index_th3index} — H3 / th3index family. */ + public static int ever_ne_h3index_th3index(long arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "ever_ne_h3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.ever_ne_h3index_th3index(arg0, arg1); + } + + /** MEOS {@code ever_ne_th3index_h3index} — H3 / th3index family. */ + public static int ever_ne_th3index_h3index(jnr.ffi.Pointer arg0, long arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "ever_ne_th3index_h3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.ever_ne_th3index_h3index(arg0, arg1); + } + + /** MEOS {@code ever_ne_th3index_th3index} — H3 / th3index family. */ + public static int ever_ne_th3index_th3index(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "ever_ne_th3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.ever_ne_th3index_th3index(arg0, arg1); + } + + /** MEOS {@code geo_to_h3index_set} — H3 / th3index family. */ + public static jnr.ffi.Pointer geo_to_h3index_set(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "geo_to_h3index_set requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.geo_to_h3index_set(arg0, arg1); + } + + /** MEOS {@code h3_gs_point_to_cell} — H3 / th3index family. */ + public static long h3_gs_point_to_cell(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "h3_gs_point_to_cell requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.h3_gs_point_to_cell(arg0, arg1); + } + + /** MEOS {@code h3index_in} — H3 / th3index family. */ + public static long h3index_in(java.lang.String arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "h3index_in requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.h3index_in(arg0); + } + + /** MEOS {@code h3index_out} — H3 / th3index family. */ + public static java.lang.String h3index_out(long arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "h3index_out requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.h3index_out(arg0); + } + + /** MEOS {@code tbigint_to_th3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer tbigint_to_th3index(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "tbigint_to_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.tbigint_to_th3index(arg0); + } + + /** MEOS {@code teq_h3index_th3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer teq_h3index_th3index(long arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "teq_h3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.teq_h3index_th3index(arg0, arg1); + } + + /** MEOS {@code teq_th3index_h3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer teq_th3index_h3index(jnr.ffi.Pointer arg0, long arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "teq_th3index_h3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.teq_th3index_h3index(arg0, arg1); + } + + /** MEOS {@code teq_th3index_th3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer teq_th3index_th3index(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "teq_th3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.teq_th3index_th3index(arg0, arg1); + } + + /** MEOS {@code tgeogpoint_great_circle_distance} — H3 / th3index family. */ + public static jnr.ffi.Pointer tgeogpoint_great_circle_distance(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1, java.lang.String arg2) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "tgeogpoint_great_circle_distance requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.tgeogpoint_great_circle_distance(arg0, arg1, arg2); + } + + /** MEOS {@code tgeogpoint_to_th3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer tgeogpoint_to_th3index(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "tgeogpoint_to_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.tgeogpoint_to_th3index(arg0, arg1); + } + + /** MEOS {@code tgeompoint_to_th3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer tgeompoint_to_th3index(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "tgeompoint_to_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.tgeompoint_to_th3index(arg0, arg1); + } + + /** MEOS {@code tne_h3index_th3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer tne_h3index_th3index(long arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "tne_h3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.tne_h3index_th3index(arg0, arg1); + } + + /** MEOS {@code tne_th3index_h3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer tne_th3index_h3index(jnr.ffi.Pointer arg0, long arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "tne_th3index_h3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.tne_th3index_h3index(arg0, arg1); + } + + /** MEOS {@code tne_th3index_th3index} — H3 / th3index family. */ + public static jnr.ffi.Pointer tne_th3index_th3index(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "tne_th3index_th3index requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.tne_th3index_th3index(arg0, arg1); + } +} diff --git a/flink-processor/src/main/java/org/mobilitydb/flink/meos/MeosOpsTh3index.java b/flink-processor/src/main/java/org/mobilitydb/flink/meos/MeosOpsTh3index.java new file mode 100644 index 0000000..e458c66 --- /dev/null +++ b/flink-processor/src/main/java/org/mobilitydb/flink/meos/MeosOpsTh3index.java @@ -0,0 +1,393 @@ +package org.mobilitydb.flink.meos; + +/* AUTO-GENERATED by tools/codegen/emit_h3_facade.py — do not edit by hand. + * H3 / th3index family facade over functions.GeneratedFunctions. + */ + +import functions.GeneratedFunctions; +import jnr.ffi.Pointer; + +public final class MeosOpsTh3index { + + public static final boolean MEOS_AVAILABLE = MeosOpsRuntime.MEOS_AVAILABLE; + + private MeosOpsTh3index() { /* utility */ } + + /** MEOS {@code th3index_are_neighbor_cells} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_are_neighbor_cells(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_are_neighbor_cells requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_are_neighbor_cells(arg0, arg1); + } + + /** MEOS {@code th3index_cell_area} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_area(jnr.ffi.Pointer arg0, java.lang.String arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_area requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_area(arg0, arg1); + } + + /** MEOS {@code th3index_cell_to_boundary} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_boundary(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_boundary requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_boundary(arg0); + } + + /** MEOS {@code th3index_cell_to_center_child} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_center_child(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_center_child requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_center_child(arg0, arg1); + } + + /** MEOS {@code th3index_cell_to_center_child_next} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_center_child_next(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_center_child_next requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_center_child_next(arg0); + } + + /** MEOS {@code th3index_cell_to_child_pos} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_child_pos(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_child_pos requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_child_pos(arg0, arg1); + } + + /** MEOS {@code th3index_cell_to_local_ij} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_local_ij(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_local_ij requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_local_ij(arg0, arg1); + } + + /** MEOS {@code th3index_cell_to_parent} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_parent(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_parent requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_parent(arg0, arg1); + } + + /** MEOS {@code th3index_cell_to_parent_next} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_parent_next(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_parent_next requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_parent_next(arg0); + } + + /** MEOS {@code th3index_cell_to_vertex} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cell_to_vertex(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cell_to_vertex requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cell_to_vertex(arg0, arg1); + } + + /** MEOS {@code th3index_cells_to_directed_edge} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_cells_to_directed_edge(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_cells_to_directed_edge requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_cells_to_directed_edge(arg0, arg1); + } + + /** MEOS {@code th3index_child_pos_to_cell} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_child_pos_to_cell(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1, int arg2) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_child_pos_to_cell requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_child_pos_to_cell(arg0, arg1, arg2); + } + + /** MEOS {@code th3index_directed_edge_to_boundary} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_directed_edge_to_boundary(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_directed_edge_to_boundary requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_directed_edge_to_boundary(arg0); + } + + /** MEOS {@code th3index_edge_length} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_edge_length(jnr.ffi.Pointer arg0, java.lang.String arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_edge_length requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_edge_length(arg0, arg1); + } + + /** MEOS {@code th3index_end_value} — H3 / th3index family. */ + public static long th3index_end_value(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_end_value requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_end_value(arg0); + } + + /** MEOS {@code th3index_get_base_cell_number} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_get_base_cell_number(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_get_base_cell_number requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_get_base_cell_number(arg0); + } + + /** MEOS {@code th3index_get_directed_edge_destination} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_get_directed_edge_destination(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_get_directed_edge_destination requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_get_directed_edge_destination(arg0); + } + + /** MEOS {@code th3index_get_directed_edge_origin} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_get_directed_edge_origin(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_get_directed_edge_origin requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_get_directed_edge_origin(arg0); + } + + /** MEOS {@code th3index_get_resolution} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_get_resolution(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_get_resolution requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_get_resolution(arg0); + } + + /** MEOS {@code th3index_grid_distance} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_grid_distance(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_grid_distance requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_grid_distance(arg0, arg1); + } + + /** MEOS {@code th3index_in} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_in(java.lang.String arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_in requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_in(arg0); + } + + /** MEOS {@code th3index_is_pentagon} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_is_pentagon(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_is_pentagon requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_is_pentagon(arg0); + } + + /** MEOS {@code th3index_is_res_class_iii} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_is_res_class_iii(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_is_res_class_iii requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_is_res_class_iii(arg0); + } + + /** MEOS {@code th3index_is_valid_cell} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_is_valid_cell(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_is_valid_cell requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_is_valid_cell(arg0); + } + + /** MEOS {@code th3index_is_valid_directed_edge} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_is_valid_directed_edge(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_is_valid_directed_edge requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_is_valid_directed_edge(arg0); + } + + /** MEOS {@code th3index_is_valid_vertex} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_is_valid_vertex(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_is_valid_vertex requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_is_valid_vertex(arg0); + } + + /** MEOS {@code th3index_local_ij_to_cell} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_local_ij_to_cell(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_local_ij_to_cell requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_local_ij_to_cell(arg0, arg1); + } + + /** MEOS {@code th3index_make} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_make(long arg0, java.time.OffsetDateTime arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_make requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_make(arg0, arg1); + } + + /** MEOS {@code th3index_start_value} — H3 / th3index family. */ + public static long th3index_start_value(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_start_value requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_start_value(arg0); + } + + /** MEOS {@code th3index_to_tbigint} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_to_tbigint(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_to_tbigint requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_to_tbigint(arg0); + } + + /** MEOS {@code th3index_to_tgeogpoint} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_to_tgeogpoint(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_to_tgeogpoint requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_to_tgeogpoint(arg0); + } + + /** MEOS {@code th3index_to_tgeompoint} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_to_tgeompoint(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_to_tgeompoint requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_to_tgeompoint(arg0); + } + + /** MEOS {@code th3index_value_at_timestamptz} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_value_at_timestamptz(jnr.ffi.Pointer arg0, java.time.OffsetDateTime arg1, boolean arg2) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_value_at_timestamptz requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_value_at_timestamptz(arg0, arg1, arg2); + } + + /** MEOS {@code th3index_value_n} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_value_n(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_value_n requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_value_n(arg0, arg1); + } + + /** MEOS {@code th3index_values} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_values(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_values requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_values(arg0, arg1); + } + + /** MEOS {@code th3index_vertex_to_latlng} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3index_vertex_to_latlng(jnr.ffi.Pointer arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3index_vertex_to_latlng requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3index_vertex_to_latlng(arg0); + } + + /** MEOS {@code th3indexinst_in} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3indexinst_in(java.lang.String arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3indexinst_in requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3indexinst_in(arg0); + } + + /** MEOS {@code th3indexinst_make} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3indexinst_make(long arg0, java.time.OffsetDateTime arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3indexinst_make requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3indexinst_make(arg0, arg1); + } + + /** MEOS {@code th3indexseq_in} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3indexseq_in(java.lang.String arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3indexseq_in requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3indexseq_in(arg0, arg1); + } + + /** MEOS {@code th3indexseq_make} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3indexseq_make(jnr.ffi.Pointer arg0, jnr.ffi.Pointer arg1, int arg2, boolean arg3, boolean arg4) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3indexseq_make requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3indexseq_make(arg0, arg1, arg2, arg3, arg4); + } + + /** MEOS {@code th3indexseqset_in} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3indexseqset_in(java.lang.String arg0) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3indexseqset_in requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3indexseqset_in(arg0); + } + + /** MEOS {@code th3indexseqset_make} — H3 / th3index family. */ + public static jnr.ffi.Pointer th3indexseqset_make(jnr.ffi.Pointer arg0, int arg1) { + if (!MEOS_AVAILABLE) { + throw new UnsupportedOperationException( + "th3indexseqset_make requires libmeos — set -Dmobilityflink.meos.enabled=true"); + } + return GeneratedFunctions.th3indexseqset_make(arg0, arg1); + } +} diff --git a/flink-processor/tools/codegen/emit_h3_facade.py b/flink-processor/tools/codegen/emit_h3_facade.py new file mode 100644 index 0000000..de5cd6a --- /dev/null +++ b/flink-processor/tools/codegen/emit_h3_facade.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +"""Emit the H3 / th3index family facade (MeosOpsTh3index + MeosOpsFreeH3). + +The unified functions.GeneratedFunctions jar carries the H3 temporal-index +family. This emits its user-facing surface as MeosOps* forwarders, mirroring the +other per-family facade classes: the numerator is the public meos_h3.h externs +intersected with the jar (Datum-bearing dispatchers and internal h3 helpers are +excluded by construction — they are not declared in meos_h3.h). th3index_* go to +the temporal-type class MeosOpsTh3index; the remaining H3 free functions (geo↔H3 +walkers, set ops, ever/always comparisons) go to MeosOpsFreeH3. + +Run from flink-processor/: + MEOS_INCLUDE= python3 tools/codegen/emit_h3_facade.py jar/JMEOS.jar +""" +import re, os, sys, subprocess + +HERE = os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +FACADE = os.path.join(HERE, "src/main/java/org/mobilitydb/flink/meos") +INC = os.environ.get("MEOS_INCLUDE", "/home/esteban/src/MobilityDB/meos/include") +_SIG = re.compile(r'public static (\S+) ([a-z_][A-Za-z0-9_]*)\(([^)]*)\)') +_DECL = re.compile(r'^\s*extern\s+.+?\b([a-z][A-Za-z0-9_]*)\s*\(', re.M) + + +def jar_sigs(jar): + out = subprocess.run(["javap", "-classpath", jar, "-p", "functions.GeneratedFunctions"], + capture_output=True, text=True).stdout + sigs = {} + for line in out.splitlines(): + m = _SIG.search(line) + if m: + sigs[m.group(2)] = (m.group(1), + [a.strip() for a in m.group(3).strip().split(",")] if m.group(3).strip() else []) + return sigs + + +def method(name, sigs): + ret, types = sigs[name] + decl = ", ".join(f"{t} arg{i}" for i, t in enumerate(types)) + call = ", ".join(f"arg{i}" for i in range(len(types))) + retkw = "" if ret == "void" else "return " + return (f"\n /** MEOS {{@code {name}}} — H3 / th3index family. */\n" + f" public static {ret} {name}({decl}) {{\n" + f" if (!MEOS_AVAILABLE) {{\n" + f" throw new UnsupportedOperationException(\n" + f' "{name} requires libmeos — set -Dmobilityflink.meos.enabled=true");\n' + f" }}\n" + f" {retkw}GeneratedFunctions.{name}({call});\n" + f" }}\n") + + +def emit_class(cls, names, sigs): + body = "".join(method(n, sigs) for n in names) + txt = (f"package org.mobilitydb.flink.meos;\n\n" + f"/* AUTO-GENERATED by tools/codegen/emit_h3_facade.py — do not edit by hand.\n" + f" * H3 / th3index family facade over functions.GeneratedFunctions.\n */\n\n" + f"import functions.GeneratedFunctions;\n" + f"import jnr.ffi.Pointer;\n\n" + f"public final class {cls} {{\n\n" + f" public static final boolean MEOS_AVAILABLE = MeosOpsRuntime.MEOS_AVAILABLE;\n\n" + f" private {cls}() {{ /* utility */ }}\n" + f"{body}}}\n") + open(os.path.join(FACADE, f"{cls}.java"), "w").write(txt) + return len(names) + + +def main(): + jar = sys.argv[1] if len(sys.argv) > 1 else os.path.join(HERE, "jar/JMEOS.jar") + sigs = jar_sigs(jar) + public = set(_DECL.findall(open(os.path.join(INC, "meos_h3.h")).read())) + facade = sorted(public & set(sigs)) + th3 = [n for n in facade if n.startswith("th3index")] + free = [n for n in facade if not n.startswith("th3index")] + a = emit_class("MeosOpsTh3index", th3, sigs) + b = emit_class("MeosOpsFreeH3", free, sigs) + print(f"MeosOpsTh3index: {a} methods; MeosOpsFreeH3: {b} methods") + + +if __name__ == "__main__": + main()