BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
jsonitembackupstrategy.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/jsonitembackupstrategy.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_JSONITEMBACKUPSTRATEGY_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMBACKUPSTRATEGY_H
17 
19 #include <memory>
20 
21 namespace ModelView {
22 
23 class SessionItem;
24 class ItemFactoryInterface;
25 
26 //! Provide backup of SessionItem using json strategy.
27 
28 class MVVM_MODEL_EXPORT JsonItemBackupStrategy : public ItemBackupStrategy {
29 public:
30  JsonItemBackupStrategy(const ItemFactoryInterface* item_factory);
32 
33  std::unique_ptr<SessionItem> restoreItem() const override;
34 
35  void saveItem(const SessionItem* item) override;
36 
37 private:
39  std::unique_ptr<JsonItemBackupStrategyImpl> p_impl;
40 };
41 
42 } // namespace ModelView
43 
44 #endif // BORNAGAIN_MVVM_MODEL_MVVM_SERIALIZATION_JSONITEMBACKUPSTRATEGY_H
Interface to backup items for later restore.
Interface class for all factories capable of producing SessionItem's.
Provide backup of SessionItem using json strategy.
std::unique_ptr< JsonItemBackupStrategyImpl > 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.