Skip to content

Add the tnpoint typed value accessors to the MEOS public API#1082

Open
estebanzimanyi wants to merge 2 commits into
MobilityDB:masterfrom
estebanzimanyi:feat/meos-tnpoint-value-accessors
Open

Add the tnpoint typed value accessors to the MEOS public API#1082
estebanzimanyi wants to merge 2 commits into
MobilityDB:masterfrom
estebanzimanyi:feat/meos-tnpoint-value-accessors

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

Summary

The temporal network point type exposed no typed value accessors. Callers could only reach the generic Datum-returning temporal_*_value functions and cannot turn a Datum into an Npoint without internal Datum-hiding — unlike tpose/tgeo, which already expose tpose_*/tgeo_* typed accessors.

Adds tnpoint_start_value, tnpoint_end_value, tnpoint_value_n, tnpoint_values, tnpoint_value_at_timestamptz in meos/src/npoint/tnpoint.c and declares them in meos_npoint.h, mirroring the existing tpose_* accessor surface and reusing the same generic temporal_* backing (per-element copies via npoint_make).

Why

Required for 100% ecosystem API parity: every downstream binding needs the typed tnpoint value-accessor surface to make TNpoint concrete, exactly as tpose_*/tgeo_* already allow for the analogous types.

Verification

  • MEOS build (-DMEOS=on default; NPOINT is on by default): green, no new warnings
  • Full-options MEOS build: green; the 5 symbols exported (T in nm -D libmeos.so)
  • MEOS test battery (01_hello_world, setspan_test, temporal_test, geo_test, npoint_test, cbuffer_test): 6/6 pass (no regression)
  • Functional check on {NPoint(1,0.2)@…, NPoint(1,0.6)@…, NPoint(2,0.4)@…}: start=NPoint(1,0.2), end=NPoint(2,0.4), values count=3, value_n(2)=NPoint(1,0.6), value_at_timestamptz=NPoint(1,0.6) — all correct
  • New code is MEOS-only (#if MEOS), thin wrappers over already-tested generic accessors; TSan-neutral by construction

tcbuffer_start_value, tcbuffer_end_value, tcbuffer_value_n,
tcbuffer_values and tcbuffer_value_at_timestamptz are implemented in
meos/src/cbuffer/tcbuffer.c and return the typed Cbuffer value, but were
not declared in meos/include/meos_cbuffer.h.  They were therefore
unreachable from the MEOS C API and from language bindings, which could
only obtain the generic Datum-returning temporal_*_value accessors and
cannot turn a Datum into a Cbuffer without internal Datum-hiding.

Declare the five accessors in the temporal "Accessor functions" section
of meos_cbuffer.h, mirroring the existing tpose_*/tgeo_* typed accessor
surface.  No implementation changes: the exported symbols are the
existing definitions, now visible in nm -D libmeos.so.
The temporal network point type had no typed value accessors: callers
could only reach the generic Datum-returning temporal_*_value functions
and cannot turn a Datum into an Npoint without internal Datum-hiding,
unlike tpose/tgeo which already expose tpose_*/tgeo_* typed accessors.

Add tnpoint_start_value, tnpoint_end_value, tnpoint_value_n,
tnpoint_values and tnpoint_value_at_timestamptz in meos/src/npoint/
tnpoint.c and declare them in meos_npoint.h, mirroring the existing
tpose_* accessor surface and reusing the same generic temporal_*
backing (per-element copies via npoint_make).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant