Skip to content

Retire the hand-written type layer - #18

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:gen/retire-hand-types
Sep 2, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:gen/retire-hand-types

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

The binding is a projection of the catalog: MEOS.NET/Types holds the 96
generated object-model classes and nothing else, and the three files the
library still writes by hand are the runtime substrate — the MEOS session
lifecycle, the error check every wrapper makes, and the interpolation enum.
The 70 hand-written type files, the helpers only they used
(DateHelper, EnumConverter, AllocHelper, the TimestampTz struct) and
the folder lists naming their directories are gone with them.

Two members carry a value between the two generated surfaces, which is what
lets the object layer be convenience rather than the only way through:
MEOSObject.Ptr hands a MEOS value to any function on
MEOS.NET.Functions.Meos, and MEOSFactory.Wrap* wraps what such a function
answers back into the class the value's own header names. GoMEOS spells the
same pair Inner() and Init() on each of its hand types.

The ExampleApp reads the whole surface that way: TFloat.In over an instant
answers a TFloatInst, Meos.TfloatOut prints it through its pointer,
Meos.AddTfloatFloat answers a pointer MEOSFactory.WrapTemporal turns back
into a temporal value, a float span set reports its two spans, and a malformed
text raises MEOSInternalErrorException. Sixteen tests read the same surface,
including the interpolation and subtype names MEOS lends out of its static
tables.

The binding is a projection of the catalog: `MEOS.NET/Types` holds the 96
generated object-model classes and nothing else, and the three files the
library still writes by hand are the runtime substrate — the MEOS session
lifecycle, the error check every wrapper makes, and the interpolation enum.
The 70 hand-written type files, the helpers only they used
(`DateHelper`, `EnumConverter`, `AllocHelper`, the `TimestampTz` struct) and
the folder lists naming their directories are gone with them.

Two members carry a value between the two generated surfaces, which is what
lets the object layer be convenience rather than the only way through:
`MEOSObject.Ptr` hands a MEOS value to any function on
`MEOS.NET.Functions.Meos`, and `MEOSFactory.Wrap*` wraps what such a function
answers back into the class the value's own header names. GoMEOS spells the
same pair `Inner()` and `Init()` on each of its hand types.

The ExampleApp reads the whole surface that way: `TFloat.In` over an instant
answers a `TFloatInst`, `Meos.TfloatOut` prints it through its pointer,
`Meos.AddTfloatFloat` answers a pointer `MEOSFactory.WrapTemporal` turns back
into a temporal value, a float span set reports its two spans, and a malformed
text raises `MEOSInternalErrorException`. Sixteen tests read the same surface,
including the interpolation and subtype names MEOS lends out of its static
tables.
@estebanzimanyi
estebanzimanyi merged commit 8a9f9a2 into MobilityDB:main Sep 2, 2026
1 check passed
@estebanzimanyi
estebanzimanyi deleted the gen/retire-hand-types branch September 2, 2026 20:45
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