Skip to content

Generate the enums of jmeos-core from the catalog - #178

Merged
estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/catalog-enums
Oct 12, 2026
Merged

estebanzimanyi merged 1 commit into
MobilityDB:mainfrom
estebanzimanyi:codegen/catalog-enums

Conversation

@estebanzimanyi

Copy link
Copy Markdown
Member

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.

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.
@estebanzimanyi
estebanzimanyi merged commit 7773691 into MobilityDB:main Oct 12, 2026
2 checks passed
@estebanzimanyi
estebanzimanyi deleted the codegen/catalog-enums branch October 12, 2026 19:04
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