-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move function implementations into .cc files for Components
- Loading branch information
Showing
4 changed files
with
43 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
{% import "macros/utils.jinja2" as utils %} | ||
// AUTOMATICALLY GENERATED FILE - DO NOT EDIT | ||
|
||
#include "{{ incfolder }}{{ class.bare_type }}.h" | ||
|
||
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) | ||
#include "nlohmann/json.hpp" | ||
#endif | ||
|
||
{{ utils.namespace_open(class.namespace) }} | ||
|
||
std::ostream& operator<<(std::ostream& o, const {{class.full_type}}& value) { | ||
{% for member in Members %} | ||
{% if member.is_array %} | ||
for (int i = 0; i < {{ member.array_size }}; ++i) { | ||
o << value.{{ member.name }}[i] << "|"; | ||
} | ||
o << " "; | ||
{% else %} | ||
o << value.{{ member.name }} << " "; | ||
{% endif %} | ||
{% endfor %} | ||
|
||
return o; | ||
} | ||
|
||
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__) | ||
void to_json(nlohmann::json& j, const {{ class.bare_type }}& value) { | ||
j = nlohmann::json{ | ||
{% set comma = joiner(",") %} | ||
{% for member in Members %} | ||
{{ comma() }}{"{{ member.name }}", value.{{ member.name }}} | ||
{% endfor %} | ||
}; | ||
} | ||
#endif | ||
|
||
{{ utils.namespace_close(class.namespace) }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters