Repository navigation
Hold a grid cell MEOS passes by value in a class of its own - #64
Merged
estebanzimanyi merged 1 commit intoNov 12, 2026
Merged
Conversation
The function and object layers are generated from the MEOS-API catalog of MobilityDB c5174b8af1, whose object model gives H3Index, Quadbin and S2Cell a class marked byValue (MEOS-API #273), with cType the typedef MEOS passes the cell as (H3Index, Quadbin, S2CellId, each a uint64_t). The tree also carries what MobilityDB master changed since 78ebe3b7fe, the commit it was generated from, in 37 files. tools/objectgen.py reads byValue and cType from the catalog and nothing else. Such a class is a readonly record struct holding the scalar of its cType, equal where the scalars are equal, with explicit conversions from and to that scalar (#value_head, beside #held_struct_file, which declares a struct of values a record struct). Model.class_for_value answers the class for any slot whose typedef is that cType, as class_for_ctype answers it for a pointer, and the class stays out of wrap_root and of the hierarchy its model parent heads, since a C# value type has no base class. A method of the class receives the value it holds; every parameter, return, out-parameter (#value_out_reader, beside #wrapped_out_reader), counted array and answered array the catalog types with the cType is the class: TH3Index.StartValue answers an H3Index, Geo.ToQuadbinCell a Quadbin, TGeomPoint.S2cellSplit an S2Cell[]. The portable readers and writers come from the catalog's typeEncodings as for every other class, so each cell has AsText, FromText, AsWKB, FromWKB, AsHexWKB and FromHexWKB, and ToString is its text. PortableIoTests reads and writes the three cells through each format, and OutParameterTests and CatalogValueTypeTests read the cells a temporal cell, a cell set and a geometry answer as their classes. Why: the catalog names the cells as classes, and the layer projected them as pointer handles no call ever made, with every member static over a ulong, no AsText and no ToString, and a WrapH3Index, WrapQuadbin and WrapS2Cell in MEOSFactory reading a pointer MEOS never answers. Witness: over the catalog with the cell classes the generators before and after the change emit 155 classes each, and 5259 and 5262 methods, the three more being the cells' AsText; the 24 files they differ in differ in the cell classes, in the cells taken and answered elsewhere and in the three removed MEOSFactory wrappers alone, and the gap ledger is the same. Over the catalog without them the two generators write the same tree, and the changed generator run twice writes the same tree. dotnet build reports 0 warnings and 0 errors, and dotnet test passes 103 of 103, none skipped, against libmeos built from MobilityDB c5174b8af1, the floor CI holds the count to being 103; Quadbin 48427fffffffffff writes 01470000FFFFFFFFFF7F4248 as hex WKB, S2Cell 47c3c444c writes 01550000000000C044C4C347, and H3Index 8a2a1072b59ffff reads back from each format as itself.
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 function and object layers are generated from the MEOS-API catalog
of MobilityDB c5174b8af1, whose object model gives H3Index, Quadbin and
S2Cell a class marked byValue (MEOS-API #273), with cType the typedef
MEOS passes the cell as (H3Index, Quadbin, S2CellId, each a uint64_t).
The tree also carries what MobilityDB master changed since 78ebe3b7fe,
the commit it was generated from, in 37 files.
tools/objectgen.py reads byValue and cType from the catalog and nothing
else. Such a class is a readonly record struct holding the scalar of its
cType, equal where the scalars are equal, with explicit conversions from
and to that scalar (#value_head, beside #held_struct_file, which declares
a struct of values a record struct). Model.class_for_value answers the
class for any slot whose typedef is that cType, as class_for_ctype
answers it for a pointer, and the class stays out of wrap_root and of the
hierarchy its model parent heads, since a C# value type has no base
class. A method of the class receives the value it holds; every
parameter, return, out-parameter (#value_out_reader, beside
#wrapped_out_reader), counted array and answered array the catalog types
with the cType is the class: TH3Index.StartValue answers an H3Index,
Geo.ToQuadbinCell a Quadbin, TGeomPoint.S2cellSplit an S2Cell[]. The
portable readers and writers come from the catalog's typeEncodings as
for every other class, so each cell has AsText, FromText, AsWKB,
FromWKB, AsHexWKB and FromHexWKB, and ToString is its text.
PortableIoTests reads and writes the three cells through each format,
and OutParameterTests and CatalogValueTypeTests read the cells a
temporal cell, a cell set and a geometry answer as their classes.
Why: the catalog names the cells as classes, and the layer projected
them as pointer handles no call ever made, with every member static over
a ulong, no AsText and no ToString, and a WrapH3Index, WrapQuadbin and
WrapS2Cell in MEOSFactory reading a pointer MEOS never answers.
Witness: over the catalog with the cell classes the generators before
and after the change emit 155 classes each, and 5259 and 5262 methods,
the three more being the cells' AsText; the 24 files they differ in
differ in the cell classes, in the cells taken and answered elsewhere and
in the three removed MEOSFactory wrappers alone, and the gap ledger is
the same. Over the catalog without them the two generators write the
same tree, and the changed generator run twice writes the same tree.
dotnet build reports 0 warnings and 0 errors, and dotnet test passes 103
of 103, none skipped, against libmeos built from MobilityDB c5174b8af1,
the floor CI holds the count to being 103;
Quadbin 48427fffffffffff writes 01470000FFFFFFFFFF7F4248 as hex WKB,
S2Cell 47c3c444c writes 01550000000000C044C4C347, and H3Index
8a2a1072b59ffff reads back from each format as itself.