BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
jsondocument.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/jsondocument.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_JSONDOCUMENT_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONDOCUMENT_H
17 
19 #include <memory>
20 #include <vector>
21 
22 namespace ModelView {
23 
24 class SessionModel;
25 
26 //! Saves and restores list of SessionModel's to/from disk using json format.
27 //! Single JsonDocument corresponds to a single file on disk.
28 
29 class MVVM_MODEL_EXPORT JsonDocument : public ModelDocumentInterface {
30 public:
31  JsonDocument(const std::vector<SessionModel*>& models);
32  ~JsonDocument() override;
33 
34  void save(const std::string& file_name) const override;
35  void load(const std::string& file_name) override;
36 
37 private:
38  struct JsonDocumentImpl;
39  std::unique_ptr<JsonDocumentImpl> p_impl;
40 };
41 
42 } // namespace ModelView
43 
44 #endif // BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONDOCUMENT_H
Saves and restores list of SessionModel's to/from disk using json format.
Definition: jsondocument.h:29
std::unique_ptr< JsonDocumentImpl > p_impl
Definition: jsondocument.h:38
Pure virtual interface to save and restore session models to/from disk.
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.