BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
jsonitemcontainerconverter.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // qt-mvvm: Model-view-view-model framework for large GUI applications
4 //
5 //! @file mvvm/model/mvvm/serialization/jsonitemcontainerconverter.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Gennady Pospelov et al, Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMCONTAINERCONVERTER_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMCONTAINERCONVERTER_H
17 
18 #include "mvvm/model_export.h"
19 #include <functional>
20 #include <memory>
21 
22 class QJsonObject;
23 
24 namespace ModelView {
25 
26 class SessionItem;
27 class SessionItemContainer;
28 struct ConverterCallbacks;
29 
30 //! Converter between SessionItemContainer and JSON object.
31 
32 class MVVM_MODEL_EXPORT JsonItemContainerConverter {
33 public:
36 
37  QJsonObject to_json(const SessionItemContainer& container);
38 
39  void from_json(const QJsonObject& json, SessionItemContainer& container);
40 
41 private:
43  std::unique_ptr<JsonItemContainerConverterImpl> p_impl;
44 };
45 
46 } // namespace ModelView
47 
48 #endif // BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMCONTAINERCONVERTER_H
Converter between SessionItemContainer and JSON object.
std::unique_ptr< JsonItemContainerConverterImpl > p_impl
Holds collection of SessionItem objects related to the same tag.
materialitems.h Collection of materials to populate MaterialModel.
Provides necessary callbacks to convert SessionItem to JSON and back.