Skip to content

Answer a MEOS base value as the class the model gives it - #27

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:feat/value-classes-in-the-object-layer
Sep 3, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:feat/value-classes-in-the-object-layer

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The object layer types a method by the class the catalog assigns each C type,
and the value types had none: a method taking a geometry, a text, a circular
buffer or a network point was deferred to the flat surface however ordinary it
was. The catalog carries a class for each of them now, so those methods reach
the object layer — Cbuffer.Point() answers a Geo, TGeo.AtGeom(Geo)
restricts a trip to a polygon, Text.Upper() answers a Text — and the layer
holds 108 classes and 1122 methods against 94 and 646, with 171 deferrals
against 246.

What a class's instances are a pointer to comes from the catalog as well. The
generator held a map of nine C structs, which is what made a class the model
gains one the binding cannot reach: it reads classes.<Class>.cType instead,
and wraps a pointer in the shallowest class carrying that struct, so a
GSERIALIZED * is a Geo with Geometry and Geography distinct classes
under it. The companion hierarchies are read from the model too, rather than
named, so a hierarchy it gains needs no edit here.

Four tests read the values back: a text upper-cased and title-cased, a
geometry's SRID and text, a circular buffer answering its centre as a geometry,
and a temporal geometry restricted by one, which ends where the trip leaves the
polygon rather than where the trip ends.

The deferrals left name no MEOS class: an Interval *, the uint8_t * WKB
buffers with their size_t * length, the double-pointer out-parameters, and
the vendored JsonPath *, PCSCHEMA * and Match * structs.

The object layer types a method by the class the catalog assigns each C type,
and the value types had none: a method taking a geometry, a text, a circular
buffer or a network point was deferred to the flat surface however ordinary it
was. The catalog carries a class for each of them now, so those methods reach
the object layer — `Cbuffer.Point()` answers a `Geo`, `TGeo.AtGeom(Geo)`
restricts a trip to a polygon, `Text.Upper()` answers a `Text` — and the layer
holds 108 classes and 1122 methods against 94 and 646, with 171 deferrals
against 246.

What a class's instances are a pointer to comes from the catalog as well. The
generator held a map of nine C structs, which is what made a class the model
gains one the binding cannot reach: it reads `classes.<Class>.cType` instead,
and wraps a pointer in the shallowest class carrying that struct, so a
`GSERIALIZED *` is a `Geo` with `Geometry` and `Geography` distinct classes
under it. The companion hierarchies are read from the model too, rather than
named, so a hierarchy it gains needs no edit here.

Four tests read the values back: a text upper-cased and title-cased, a
geometry's SRID and text, a circular buffer answering its centre as a geometry,
and a temporal geometry restricted by one, which ends where the trip leaves the
polygon rather than where the trip ends.

The deferrals left name no MEOS class: an `Interval *`, the `uint8_t *` WKB
buffers with their `size_t *` length, the double-pointer out-parameters, and
the vendored `JsonPath *`, `PCSCHEMA *` and `Match *` structs.
@estebanzimanyi
estebanzimanyi merged commit 25ff7ff into MobilityDB:main Sep 3, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the feat/value-classes-in-the-object-layer branch September 3, 2026 00:36
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