Skip to content

Commit

Permalink
fix: enums role
Browse files Browse the repository at this point in the history
  • Loading branch information
guglielmo-boi committed Apr 3, 2024
1 parent 29ecb28 commit aa339f9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/templates/topics.cpp.j2
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ std::vector<TopicMessage> GetSubscribeTopics(Role role

switch(role) {
{%- for role in roles %}
case Role::role{{ role.capitalize() }}:
case Role::{{ utils.role_enum_name(role) }}:
{% for topic in topics -%}
{% if role in topic['subscribe_roles'] -%}
ret.emplace_back(std::move({{ utils.topic_get_name(topic.alias) }}({{ utils.topic_get_variables_values(topic) }})));
Expand All @@ -38,7 +38,7 @@ std::vector<TopicMessage> GetPublishTopics(Role role

switch(role) {
{%- for role in roles %}
case Role::role{{ role.capitalize() }}:
case Role::{{ utils.role_enum_name(role) }}:
{% for topic in topics -%}
{% if role in topic['publish_roles'] -%}
ret.emplace_back(std::move({{ utils.topic_get_name(topic.alias) }}({{ utils.topic_get_variables_values(topic) }})));
Expand All @@ -56,7 +56,7 @@ std::vector<TopicMessage> GetPublishTopics(Role role
bool CanSubscribe(Role role, Topic topic) {
switch(role) {
{%- for role in roles %}
case Role::role{{ role.capitalize() }}:
case Role::{{ utils.role_enum_name(role) }}:
switch(topic) {
{%set ns = namespace(check=0) -%}
{% for topic in topics -%}
Expand Down Expand Up @@ -89,7 +89,7 @@ bool CanSubscribe(Role role, Topic topic) {
bool CanPublish(Role role, Topic topic) {
switch(role) {
{%- for role in roles %}
case Role::role{{ role.capitalize() }}:
case Role::{{ utils.role_enum_name(role) }}:
switch(topic) {
{%set ns = namespace(check=0) -%}
{% for topic in topics -%}
Expand Down

0 comments on commit aa339f9

Please sign in to comment.