Skip to content

Commit

Permalink
Add vector<Data> classes to dictionary generation
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Feb 5, 2024
1 parent 07c5bdf commit 8ac447f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 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 @@ -24,7 +25,7 @@

<!-- 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 8ac447f

Please sign in to comment.