Skip to content

Commit

Permalink
[wip] fix templates to put Wrapped class into namespace
Browse files Browse the repository at this point in the history
Also make sure that using types from different namespaces is possible in
interface types
  • Loading branch information
tmadlener committed Sep 10, 2021
1 parent c15f4b3 commit 6e83818
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion python/templates/ConstWrapped.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -43,5 +43,5 @@ friend std::ostream& operator<<(std::ostream& os, const {{ class_type }}& value)

{% endwith %}

{{ utils.namespace_close(class.namespace )}}
{{ utils.namespace_close(class.namespace) }}
#endif
4 changes: 2 additions & 2 deletions python/templates/Wrapped.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
{{ utils.namespace_open(class.namespace) }}

{{ macros.class_description(class.bare_type, Description, Author )}}

{{ utils.namespace_close(class.namespace )}}
class {{ class.bare_type }} : public podio::GenericWrapper<true, {{ Types | join(', ') }}> {
private:
// The underlying Wrapper type is Mutable
Expand All @@ -40,4 +38,6 @@ public:
{{ macros.member_setters(Members, use_get_syntax) }}
};

{{ utils.namespace_close(class.namespace )}}

#endif
17 changes: 17 additions & 0 deletions tests/datalayout.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -180,8 +180,16 @@ datatypes :
Author: "Thomas Madlener"
OneToOneRelations:
- TypeWithEnergy aSingleEnergyType // single relation
- ex42::AnotherTypeWithEnergy energyRelation // another single relation
OneToManyRelations:
- TypeWithEnergy manyEnergies // multiple relations
- ex42::AnotherTypeWithEnergy moreEnergies // multiple namespace relations

nsp::EnergyInNamespace:
Description: "A type with energy in a namespace"
Author: "Thomas Madlener"
Members:
- double energy // energy

interfaces:
TypeWithEnergy:
Expand All @@ -193,3 +201,12 @@ interfaces:
- ExampleHit
Members:
- double energy // the energy

ex42::AnotherTypeWithEnergy:
Description: "Another interface type for making sure they also work in namespaces"
Author: "Thomas Madlener"
Types:
- ExampleHit
- nsp::EnergyInNamespace
Members:
- double energy // the energy

0 comments on commit 6e83818

Please sign in to comment.