24 #include "openPMD/config.hpp" 26 #include <nlohmann/json.hpp> 59 inline nlohmann::json &
62 return *m_positionInOriginal;
65 template<
typename Key >
74 nlohmann::json
const &
100 std::shared_ptr< nlohmann::json > m_originalJSON;
110 std::shared_ptr< nlohmann::json > m_shadow;
116 nlohmann::json * m_positionInOriginal;
122 nlohmann::json * m_positionInShadow;
126 invertShadow( nlohmann::json & result, nlohmann::json
const & shadow );
129 std::shared_ptr< nlohmann::json > originalJSON,
130 std::shared_ptr< nlohmann::json > shadow,
131 nlohmann::json * positionInOriginal,
132 nlohmann::json * positionInShadow,
136 template<
typename Key >
139 nlohmann::json * newPositionInOriginal =
140 &m_positionInOriginal->operator[]( key );
143 static nlohmann::json nullvalue;
144 nlohmann::json * newPositionInShadow = &nullvalue;
145 if( m_trace && m_positionInOriginal->is_object() )
147 newPositionInShadow = &m_positionInShadow->operator[]( key );
149 bool traceFurther = newPositionInOriginal->is_object();
153 newPositionInOriginal,
nlohmann::json invertShadow()
Invert the "shadow", i.e.
Definition: JSON.cpp:52
nlohmann::json const & getShadow()
Get the "shadow", i.e.
Definition: JSON.cpp:46
Public definitions of openPMD-api.
Definition: Date.cpp:29
void declareFullyRead()
Declare all keys of the current object read.
Definition: JSON.cpp:92
Extend nlohmann::json with tracing of which keys have been accessed by operator[]().
Definition: JSON.hpp:48
nlohmann::json & json()
Access the underlying JSON value.
Definition: JSON.hpp:60