objectbox / objectbox-generator

ObjectBox Generator based on FlatBuffers schema files (fbs) for C and C++ (more languages in the future)
https://objectbox.io
GNU Affero General Public License v3.0
36 stars 11 forks source link

Support enums in .fbs #33

Open vaind opened 3 years ago

vaind commented 3 years ago

Example FBS that should be supported, with appropriate enum generated in c/c++ code:

enum Flags: uint(bit_flags) {
    FlagA = 0,
    FlagB = 1,
}

table Table {
    id: ulong;
    flags: Flags;
}
greenrobot commented 3 years ago

Something to consider (especially for non bit flags): in C++ most people prefer enum classes.