BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
jsonmodelconverter.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/jsonmodelconverter.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_JSONMODELCONVERTER_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONMODELCONVERTER_H
17 
19 
20 class QJsonObject;
21 
22 namespace ModelView {
23 
24 class SessionModel;
25 enum class ConverterMode;
26 
27 //! Converter of SessionModel to/from json object with posibility to select one of convertion modes.
28 
29 class MVVM_MODEL_EXPORT JsonModelConverter : public JsonModelConverterInterface {
30 public:
32  ~JsonModelConverter() override;
33 
34  //! Writes content of model into json.
35  QJsonObject to_json(const SessionModel& model) const override;
36 
37  //! Reads json object and build the model.
38  void from_json(const QJsonObject& json, SessionModel& model) const override;
39 
40 private:
42 };
43 
44 } // namespace ModelView
45 
46 #endif // BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONMODELCONVERTER_H
Base class for all converters of SessionModel to/from json object.
Converter of SessionModel to/from json object with posibility to select one of convertion modes.
Main class to hold hierarchy of SessionItem objects.
Definition: sessionmodel.h:37
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
ConverterMode
Flags to define converter behavior on the way from SessionItem to JSON and back.