Repository navigation
Generate the enums of jmeos-core from the catalog - #178
Merged
estebanzimanyi merged 1 commit intoOct 12, 2026
Merged
Conversation
FunctionsGenerator writes one Java enum per enum the catalog states for the public surface, beside GeneratedFunctions: the enums of the public headers of an enabled family, neither those of meos_internal.h nor those of a vendored library. Each keeps its C name and the value MEOS gives each constant, and getValue() answers that value, so a call passing an enum constant to MEOS passes the number MEOS reads. Over the catalog of MobilityDB ebf26ad0da and MEOS-API 9b337a00fe the generator writes 10 of the 14: errorCode, tempSubtype, interpType, IndexSearchOp, SPTreeKind, MeosType, MeosOper, spatialRel, nullHandleType and MeosPixType. The generated IndexSearchOp, with the 21 search operations of the in-memory indexes, takes the place of RTreeSearchOp, which declared 3 of them under the enum's former name, and MeosType and MeosOper take the place of utils.meosCatalog.MeosEnums, whose meosType declared 46 of the 89 values of MeosType, 44 of them with another number (T_DOUBLE2(2) against T_DOUBLE2 = 8), and whose meosOper declared 43 of 45. The catalog structs of jmeos-core hold a MeosType. A C type is an enum when the catalog states it, so the type map carries no list of enum names of its own; FunctionsGeneratorTest checks that a name the catalog states no enum of maps to a pointer, that an enum keeps its names and values, that only the enums of the public surface are written, and that run writes each enum beside the generated functions.
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.
FunctionsGenerator writes one Java enum per enum the catalog states for the public surface,
beside GeneratedFunctions: the enums of the public headers of an enabled family, neither those
of meos_internal.h nor those of a vendored library. Each keeps its C name and the value MEOS
gives each constant, and getValue() answers that value, so a call passing an enum constant to
MEOS passes the number MEOS reads. Over the catalog of MobilityDB ebf26ad0da and MEOS-API
9b337a00fe the generator writes 10 of the 14: errorCode, tempSubtype, interpType,
IndexSearchOp, SPTreeKind, MeosType, MeosOper, spatialRel, nullHandleType and MeosPixType.
The generated IndexSearchOp, with the 21 search operations of the in-memory indexes, takes the
place of RTreeSearchOp, which declared 3 of them under the enum's former name, and MeosType
and MeosOper take the place of utils.meosCatalog.MeosEnums, whose meosType declared 46 of the
89 values of MeosType, 44 of them with another number (T_DOUBLE2(2) against T_DOUBLE2 = 8),
and whose meosOper declared 43 of 45. The catalog structs of jmeos-core hold a MeosType.
A C type is an enum when the catalog states it, so the type map carries no list of enum names
of its own; FunctionsGeneratorTest checks that a name the catalog states no enum of maps to
a pointer, that an enum keeps its names and values, that only the enums of the public surface
are written, and that run writes each enum beside the generated functions.