Skip to content

Commit

Permalink
Make buffer pointer recasting take into account schema version
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener committed Aug 30, 2023
1 parent d6e9c8b commit 92eb3a6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions python/templates/macros/collections.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,11 @@ podio::CollectionReadBuffers createBuffersV{{ schemaVersion }}(bool isSubset) {
readBuffers.recast = [](podio::CollectionReadBuffers& buffers) {
// We only have any of these buffers if this is ont a subste collection
if (buffers.data) {
{% if schemaVersion == -1 %}
buffers.data = podio::CollectionWriteBuffers::asVector<{{ class.full_type }}Data>(buffers.data);
{% else %}
buffers.data = podio::CollectionWriteBuffers::asVector<{{ class.full_type }}v{{ schemaVersion }}Data>(buffers.data);
{% endif %}

{% if VectorMembers %}
{% for member in VectorMembers %}
Expand Down

0 comments on commit 92eb3a6

Please sign in to comment.