Skip to content

Commit

Permalink
python/templates: add references between Objects and Collection types
Browse files Browse the repository at this point in the history
  • Loading branch information
veprbl committed Aug 14, 2023
1 parent dbf9425 commit a2493cc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions python/templates/Collection.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ A Collection is identified by an ID.
*/
class {{ class.bare_type }}Collection : public podio::CollectionBase {
public:
using object = {{ class.bare_type }};
using const_iterator = {{ class.bare_type }}CollectionIterator;
using iterator = {{ class.bare_type }}MutableCollectionIterator;

Expand Down
4 changes: 4 additions & 0 deletions python/templates/Object.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

{{ utils.namespace_open(class.namespace) }}
class Mutable{{ class.bare_type }};
class {{ class.bare_type }}Collection;

{{ macros.class_description(class.bare_type, Description, Author) }}
class {{ class.bare_type }} {
Expand All @@ -31,6 +32,9 @@ class {{ class.bare_type }} {
friend class {{ class.bare_type }}CollectionIterator;

public:
using mutable_ = Mutable{{ class.bare_type }};
using collection = {{ class.bare_type }}Collection;

{{ macros.constructors_destructors(class.bare_type, Members) }}

public:
Expand Down

0 comments on commit a2493cc

Please sign in to comment.