Skip to content

Commit

Permalink
odb codegen: generating enum class in just one line
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe Garay <fgaray@google.com>
  • Loading branch information
fgaray committed Dec 15, 2023
1 parent c52e2b9 commit 8ce511f
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/odb/src/codeGenerator/templates/db.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ class {{klass.name}} : public dbObject
{% endfor %}
{% for _enum in klass.enums %}
{% if _enum.public %}
{% if _enum.class %}
enum class {{ _enum.name }}{% if "type" in _enum %} :{{ _enum.type }}{% endif %}
{% else %}
enum {{ _enum.name }}{% if "type" in _enum %} :{{ _enum.type }}{% endif %}
{% endif %}
enum {% if _enum.class %} class {% endif %} {{ _enum.name }}{% if "type" in _enum %} :{{ _enum.type }}{% endif %}
{
{% for value in _enum["values"]%}
{% if not loop.first %},{%endif%}{{value}}
Expand Down

0 comments on commit 8ce511f

Please sign in to comment.