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 >
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 );
nlohmann::json invertShadow()
Invert the "shadow", i.e.
Definition: JSON.cpp:57
nlohmann::json const & getShadow()
Get the "shadow", i.e.
Definition: JSON.cpp:51
Public definitions of openPMD-api.
Definition: Date.cpp:29
void declareFullyRead()
Declare all keys of the current object read.
Definition: JSON.cpp:97
Extend nlohmann::json with tracing of which keys have been accessed by operator[]().
Definition: JSON.hpp:52
nlohmann::json & json()
Access the underlying JSON value.
Definition: JSON.hpp:64