24 #include "openPMD/config.hpp" 26 #include <nlohmann/json.hpp> 63 inline nlohmann::json &
json()
65 return *m_positionInOriginal;
68 template <
typename Key>
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;
125 void invertShadow(nlohmann::json &result, nlohmann::json
const &shadow);
128 std::shared_ptr<nlohmann::json> originalJSON,
129 std::shared_ptr<nlohmann::json> shadow,
130 nlohmann::json *positionInOriginal,
131 nlohmann::json *positionInShadow,
135 template <
typename Key>
138 nlohmann::json *newPositionInOriginal =
139 &m_positionInOriginal->operator[](key);
142 static nlohmann::json nullvalue;
143 nlohmann::json *newPositionInShadow = &nullvalue;
144 if (m_trace && m_positionInOriginal->is_object())
146 newPositionInShadow = &m_positionInShadow->operator[](key);
148 bool traceFurther = newPositionInOriginal->is_object();
152 newPositionInOriginal,
164 nlohmann::json parseOptions(std::string
const &options);
171 nlohmann::json parseOptions(std::string
const &options, MPI_Comm comm);
nlohmann::json invertShadow()
Invert the "shadow", i.e.
Definition: JSON.cpp:53
nlohmann::json const & getShadow()
Get the "shadow", i.e.
Definition: JSON.cpp:48
Public definitions of openPMD-api.
Definition: Date.cpp:28
void declareFullyRead()
Declare all keys of the current object read.
Definition: JSON.cpp:90
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:63