Repository navigation
Name each reader and writer of the object layer by its portable format - #65
Merged
estebanzimanyi merged 1 commit intoNov 12, 2026
Conversation
The object layer gives no method the role name In or Out: a reader or writer the object model calls by its role (ooName in or out) is emitted under the portable name of the format the catalog's typeEncodings says it reads or writes, <Class>.From<Format> static and As<Format> instance, or leaves the object layer when typeEncodings names it for no format, its function staying in the flat Meos layer. tools/objectgen.py reads both facts from the catalog in #portable_format and #take_portable_names, which mirror the routines of the same name in GoMEOS's tools/objectgen.py: tgeompoint_in is TGeomPoint.FromText, set_out Set.AsText, temporal_out Temporal.AsText and stbox_out STBox.AsEWKT. The method keeps its body, so the portable reader or writer that forwarded to it is not emitted beside it, and a portable name the class already declares with the same parameters would leave the method out as its duplicate. ToString calls AsText, and for Text, whose text_out serves no format, Meos.TextOut. Why. A binding reads and writes a type through From<Format> and As<Format> alone (rules 1 and 2 of the bindings in the I/O plan, MobilityDB #3353, row IO-B19), so no reader or writer is named by its role beside the portable one it duplicates. Each class carried both: FloatSpan.In beside FloatSpan.FromText, which called it, and Span.Out beside the AsText of every span. Witness. Against the catalog of MobilityDB master c5174b8af1 and MEOS-API master cf4d124e6f, 88 methods were named In or Out. 74 take their portable name: FromText for the 61 readers of the sets, spans, span sets, temporal types, boxes, CBuffer, NPoint, NSegment, PoseChain, H3Index, Quadbin, S2Cell, Jsonb, JsonPath and Numeric; AsText for the 11 writers set_out, span_out, spanset_out, temporal_out, tbox_out, h3index_out, quadbin_out, s2cell_out, jsonb_out, jsonpath_out and numeric_out; AsEWKT for stbox_out and tpcbox_out. 14 leave the object layer, typeEncodings naming them for no format: cbuffer_out, npoint_out, nsegment_out, pose_in, pose_out, posechain_out, trgeometry_out, raquet_in, raquet_out, geo_out, geom_in, geog_in, text_in and text_out. None is a duplicate: Jsonb.FromText(string) over jsonb_in stands beside Jsonb.FromText(Text, bool) over jsonb_from_text. The object layer goes from 5262 to 5158 methods over 155 classes, the 14 left out and 90 forwarding readers and writers, and two runs of the generator write the same tree. Against the libmeos of that master with every family, dotnet build passes with 0 warnings and dotnet test passes 106 of 106 with none skipped, 3 of them reading sets, spans, span sets, temporal values, boxes, Jsonb, JsonPath and Numeric with FromText and writing them back with AsText or AsEWKT; the test floor of the CI goes from 103 to 106. MEOS.NET has no active committer: this needs another committer of the ecosystem to review and merge it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The object layer gives no method the role name In or Out: a reader or
writer the object model calls by its role (ooName in or out) is emitted
under the portable name of the format the catalog's typeEncodings says it
reads or writes, .From static and As instance, or
leaves the object layer when typeEncodings names it for no format, its
function staying in the flat Meos layer. tools/objectgen.py reads both
facts from the catalog in #portable_format and #take_portable_names,
which mirror the routines of the same name in GoMEOS's tools/objectgen.py:
tgeompoint_in is TGeomPoint.FromText, set_out Set.AsText, temporal_out
Temporal.AsText and stbox_out STBox.AsEWKT. The method keeps its body, so
the portable reader or writer that forwarded to it is not emitted beside
it, and a portable name the class already declares with the same
parameters would leave the method out as its duplicate. ToString calls
AsText, and for Text, whose text_out serves no format, Meos.TextOut.
Why. A binding reads and writes a type through From and
As alone (rules 1 and 2 of the bindings in the I/O plan,
MobilityDB #3353, row IO-B19), so no reader or writer is named by its
role beside the portable one it duplicates. Each class carried both:
FloatSpan.In beside FloatSpan.FromText, which called it, and Span.Out
beside the AsText of every span.
Witness. Against the catalog of MobilityDB master c5174b8af1 and MEOS-API
master cf4d124e6f, 88 methods were named In or Out. 74 take their portable
name: FromText for the 61 readers of the sets, spans, span sets, temporal
types, boxes, CBuffer, NPoint, NSegment, PoseChain, H3Index, Quadbin,
S2Cell, Jsonb, JsonPath and Numeric; AsText for the 11 writers set_out,
span_out, spanset_out, temporal_out, tbox_out, h3index_out, quadbin_out,
s2cell_out, jsonb_out, jsonpath_out and numeric_out; AsEWKT for stbox_out
and tpcbox_out. 14 leave the object layer, typeEncodings naming them for
no format: cbuffer_out, npoint_out, nsegment_out, pose_in, pose_out,
posechain_out, trgeometry_out, raquet_in, raquet_out, geo_out, geom_in,
geog_in, text_in and text_out. None is a duplicate: Jsonb.FromText(string)
over jsonb_in stands beside Jsonb.FromText(Text, bool) over
jsonb_from_text. The object layer goes from 5262 to 5158 methods over 155
classes, the 14 left out and 90 forwarding readers and writers, and two
runs of the generator write the same tree. Against the libmeos of that
master with every family, dotnet build passes with 0 warnings and dotnet
test passes 106 of 106 with none skipped, 3 of them reading sets, spans,
span sets, temporal values, boxes, Jsonb, JsonPath and Numeric with
FromText and writing them back with AsText or AsEWKT; the test floor of
the CI goes from 103 to 106.
MEOS.NET has no active committer: this needs another committer of the ecosystem to review and merge it.