Skip to content

Commit

Permalink
replaced object conversion function with converting constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
m-fila committed Feb 22, 2024
1 parent 6a14b82 commit df66033
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
1 change: 0 additions & 1 deletion python/templates/MutableObject.cc.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
{{ utils.namespace_open(class.namespace) }}

{{ macros.constructors_destructors(class.bare_type, Members, prefix='Mutable') }}
Mutable{{ class.bare_type }}::operator {{ class.bare_type }}() const { return {{ class.bare_type }}(m_obj); }

{{ macros.member_getters(class, Members, use_get_syntax, prefix='Mutable') }}
{{ macros.single_relation_getters(class, OneToOneRelations, use_get_syntax, prefix='Mutable') }}
Expand Down
3 changes: 0 additions & 3 deletions python/templates/MutableObject.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ public:

{{ macros.constructors_destructors(class.bare_type, Members, prefix='Mutable') }}

/// conversion to const object
operator {{ class.bare_type }}() const;

public:

{{ macros.member_getters(Members, use_get_syntax) }}
Expand Down
2 changes: 2 additions & 0 deletions python/templates/Object.cc.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

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

{{ class.bare_type }}::{{ class.bare_type }}(const Mutable{{ class.bare_type }}& other): {{ class.bare_type }}(other.m_obj) {}

{{ class.bare_type }}::{{ class.bare_type }}({{ class.bare_type }}Obj* obj) : m_obj(podio::utils::MaybeSharedPtr<{{ class.bare_type }}Obj>(obj)) {}

{{ class.bare_type }} {{ class.bare_type }}::makeEmpty() {
Expand Down
2 changes: 2 additions & 0 deletions python/templates/Object.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public:
using collection_type = {{ class.bare_type }}Collection;

{{ macros.constructors_destructors(class.bare_type, Members) }}
/// converting constructor from mutable object
{{ class.bare_type }}(const Mutable{{ class.bare_type }}& other);

static {{ class.bare_type }} makeEmpty();

Expand Down

0 comments on commit df66033

Please sign in to comment.