24 #include "openPMD/config.hpp"
26 #include <nlohmann/json.hpp>
63 inline nlohmann::json &
66 return *m_positionInOriginal;
69 template<
typename Key >
78 nlohmann::json
const &
104 std::shared_ptr< nlohmann::json > m_originalJSON;
114 std::shared_ptr< nlohmann::json > m_shadow;
120 nlohmann::json * m_positionInOriginal;
126 nlohmann::json * m_positionInShadow;
130 invertShadow( nlohmann::json & result, nlohmann::json
const & shadow );
133 std::shared_ptr< nlohmann::json > originalJSON,
134 std::shared_ptr< nlohmann::json > shadow,
135 nlohmann::json * positionInOriginal,
136 nlohmann::json * positionInShadow,
140 template<
typename Key >
141 TracingJSON TracingJSON::operator[]( Key && key )
143 nlohmann::json * newPositionInOriginal =
144 &m_positionInOriginal->operator[]( key );
147 static nlohmann::json nullvalue;
148 nlohmann::json * newPositionInShadow = &nullvalue;
149 if( m_trace && m_positionInOriginal->is_object() )
151 newPositionInShadow = &m_positionInShadow->operator[]( key );
153 bool traceFurther = newPositionInOriginal->is_object();
157 newPositionInOriginal,
169 nlohmann::json parseOptions( std::string
const & options );
176 nlohmann::json parseOptions( std::string
const & options, MPI_Comm comm );