Skip to content

Commit

Permalink
Add vector<Data> and vector<Component> classes to dictionary generati…
Browse files Browse the repository at this point in the history
…on (#554)

* Add vector<Data> classes to dictionary generation

* Also add vector<Component> to dicts
  • Loading branch information
tmadlener authored Feb 6, 2024
1 parent 28ef956 commit a25a6f6
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions python/templates/selection.xml.jinja2
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{% macro class_selection(class, prefix='', postfix='') %}
{%- if class.namespace %}
<class name="{{ class.namespace }}::{{ prefix }}{{ class.bare_type }}{{ postfix }}" ClassVersion="{{ version }}"/>
{%- else %}
<class name="{{ prefix }}{{ class.bare_type }}{{ postfix }}" ClassVersion="{{ version }}"/>
{%- endif %}
{% endmacro %}
{%- macro class_selection(class, prefix='', postfix='', vector=False) %}
{% set full_name = prefix + class.bare_type + postfix %}
{% set namespace = class.namespace + '::' if class.namespace else '' %}
<class name="{{ namespace }}{{ full_name }}" ClassVersion="{{ version }}"/>
{% if vector %}
<class name="std::vector<{{ namespace }}{{ full_name }}>" ClassVersion="{{ version }}"/>
{%- endif -%}
{%- endmacro -%}

{% macro ioread(iorule) %}
<ioread sourceClass="{{ iorule.sourceClass }}" targetClass="{{ iorule.targetClass}}" version="[{{ iorule.version }}]" target="{{ iorule.target }}" source="{{ iorule.source }}">
Expand All @@ -19,12 +20,12 @@

<!-- components -->
{% for class in components %}
{{ class_selection(class) }}
{{ class_selection(class, vector=True) }}
{% endfor %}

<!-- datatypes -->
{% for class in datatypes %}
{{ class_selection(class, postfix='Data') }}
{{ class_selection(class, postfix='Data', vector=True) }}
{# We need to also create the collections in the selection xml file. #}
{# Otherwise the python interface does not work in gcc builds #}
{# Additionally, in order to allow "direct" access to the user facing classes #}
Expand Down

0 comments on commit a25a6f6

Please sign in to comment.