Skip to content

Commit

Permalink
Hide the JSON output functionality from CLING (AIDASoft#452)
Browse files Browse the repository at this point in the history
  • Loading branch information
tmadlener authored and hegner committed Jul 27, 2023
1 parent d4cf9ef commit 91f7666
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion python/templates/Collection.cc.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ const auto registeredCollection = registerCollection();
} // namespace


#ifdef PODIO_JSON_OUTPUT
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
void to_json(nlohmann::json& j, const {{ collection_type }}& collection) {
j = nlohmann::json::array();
for (auto&& elem : collection) {
Expand Down
4 changes: 2 additions & 2 deletions python/templates/Collection.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#include "podio/CollectionBase.h"
#include "podio/CollectionIDTable.h"

#ifdef PODIO_JSON_OUTPUT
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
#include "nlohmann/json.hpp"
#endif

Expand Down Expand Up @@ -193,7 +193,7 @@ Mutable{{ class.bare_type }} {{ class.bare_type }}Collection::create(Args&&... a
return Mutable{{ class.bare_type }}(obj);
}

#ifdef PODIO_JSON_OUTPUT
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
void to_json(nlohmann::json& j, const {{ class.bare_type }}Collection& collection);
#endif

Expand Down
4 changes: 2 additions & 2 deletions python/templates/Component.h.jinja2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
{% endfor %}
#include <ostream>

#ifdef PODIO_JSON_OUTPUT
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
#include "nlohmann/json.hpp"
#endif

Expand Down Expand Up @@ -40,7 +40,7 @@ inline std::ostream& operator<<(std::ostream& o, const {{class.full_type}}& valu
return o;
}

#ifdef PODIO_JSON_OUTPUT
#if defined(PODIO_JSON_OUTPUT) && !defined(__CLING__)
inline void to_json(nlohmann::json& j, const {{ class.bare_type }}& value) {
j = nlohmann::json{
{% set comma = joiner(",") %}
Expand Down

0 comments on commit 91f7666

Please # to comment.