forked from AIDASoft/podio
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MutableObject.h.jinja2
63 lines (44 loc) · 2.09 KB
/
MutableObject.h.jinja2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{% import "macros/declarations.jinja2" as macros %}
{% import "macros/utils.jinja2" as utils %}
// AUTOMATICALLY GENERATED FILE - DO NOT EDIT
#ifndef {{ package_name.upper() }}_Mutable{{ class.bare_type }}_H
#define {{ package_name.upper() }}_Mutable{{ class.bare_type }}_H
#include "{{ incfolder }}{{ class.bare_type }}Obj.h"
// Make the immutable class available from its mutable version but not vice versa
#include "{{ incfolder }}{{ class.bare_type }}.h"
{% for include in includes %}
{{ include }}
{% endfor %}
#include "podio/utilities/MaybeSharedPtr.h"
#include <cstdint>
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
#include "nlohmann/json_fwd.hpp"
#endif
{{ utils.forward_decls(forward_declarations) }}
{{ utils.namespace_open(class.namespace) }}
{{ macros.class_description(class.bare_type, Description, Author, prefix='Mutable') }}
class Mutable{{ class.bare_type }} {
friend class {{ class.bare_type }}Collection;
friend class {{ class.bare_type }}MutableCollectionIterator;
friend class {{ class.bare_type }};
public:
using object_type = {{ class.bare_type }};
using collection_type = {{ class.bare_type }}Collection;
{{ macros.constructors_destructors(class.bare_type, Members, prefix='Mutable') }}
public:
{{ macros.member_getters(Members, use_get_syntax) }}
{{ macros.single_relation_getters(OneToOneRelations, use_get_syntax) }}
{{ macros.member_setters(Members, use_get_syntax) }}
{{ macros.single_relation_setters(OneToOneRelations, use_get_syntax) }}
{{ macros.multi_relation_handling(OneToManyRelations + VectorMembers, use_get_syntax, with_adder=True) }}
{{ utils.if_present(ExtraCode, "declaration") }}
{{ utils.if_present(MutableExtraCode, "declaration") }}
{{ macros.common_object_funcs(class.bare_type, prefix='Mutable') }}
private:
/// constructor from existing {{ class.bare_type }}Obj
explicit Mutable{{ class.bare_type }}(podio::utils::MaybeSharedPtr<{{ class.bare_type }}Obj> obj);
podio::utils::MaybeSharedPtr<{{ class.bare_type }}Obj> m_obj{nullptr};
};
{{ macros.json_output(class.bare_type, prefix='Mutable') }}
{{ utils.namespace_close(class.namespace) }}
#endif