BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
sessionitemdata.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/model/sessionitemdata.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_MODEL_SESSIONITEMDATA_H
16 #define BORNAGAIN_MVVM_MODEL_MVVM_MODEL_SESSIONITEMDATA_H
17 
18 #include "mvvm/model/datarole.h"
19 #include "mvvm/model_export.h"
20 #include <vector>
21 
22 namespace ModelView {
23 
24 //! Handles data roles for SessionItem.
25 
26 class MVVM_MODEL_EXPORT SessionItemData {
27 public:
28  using container_type = std::vector<DataRole>;
29  using const_iterator = container_type::const_iterator;
30 
31  std::vector<int> roles() const;
32 
33  Variant data(int role) const;
34 
35  bool setData(const Variant& value, int role);
36 
37  const_iterator begin() const;
38  const_iterator end() const;
39 
40  bool hasData(int role) const;
41 
42 private:
43  void assure_validity(const Variant& variant, int role);
45 };
46 
47 } // namespace ModelView
48 
49 #endif // BORNAGAIN_MVVM_MODEL_MVVM_MODEL_SESSIONITEMDATA_H
Handles data roles for SessionItem.
container_type::const_iterator const_iterator
std::vector< DataRole > container_type
Defines class CLASS?
materialitems.h Collection of materials to populate MaterialModel.
QVariant Variant
Definition: variant.h:23