BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
jsonitemconverter.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/jsonitemconverter.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_JSONITEMCONVERTER_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMCONVERTER_H
17 
19 
20 namespace ModelView {
21 
22 class ItemFactoryInterface;
23 struct ConverterContext;
24 
25 //! Converter between SessionItem and JSON object.
26 
27 class MVVM_MODEL_EXPORT JsonItemConverter : public JsonItemConverterInterface {
28 public:
29  JsonItemConverter(const ConverterContext& context);
32 
33  ~JsonItemConverter() override;
34 
35  QJsonObject to_json(const SessionItem* item) const override;
36 
37  std::unique_ptr<SessionItem> from_json(const QJsonObject& json) const override;
38 
39 private:
40  struct JsonItemConverterImpl;
41  std::unique_ptr<JsonItemConverterImpl> p_impl;
42 };
43 
44 } // namespace ModelView
45 
46 #endif // BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMCONVERTER_H
Base class for all converters of SessionItem to/from JSON object.
Converter between SessionItem and JSON object.
JsonItemConverter(const JsonItemConverter &)=delete
JsonItemConverter & operator=(const JsonItemConverter &)=delete
std::unique_ptr< JsonItemConverterImpl > p_impl
The main object representing an editable/displayable/serializable entity.
Definition: sessionitem.h:38
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
Collection of input paramters for SessionItemConverter.