BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ImportDataInfo.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/Support/IO/ImportDataInfo.h
6 //! @brief Defines ImportDataInfo helper struct
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_SUPPORT_IO_IMPORTDATAINFO_H
16 #define BORNAGAIN_GUI_SUPPORT_IO_IMPORTDATAINFO_H
17 
18 #include "Device/Coord/Tags.h"
19 #include <QString>
20 #include <memory>
21 
22 class Datafield;
23 
24 //! Carries information about loaded data.
25 
27 public:
28  ImportDataInfo(std::unique_ptr<Datafield> data, Coords units);
29  ImportDataInfo(Datafield&& data, Coords units);
30  ImportDataInfo(std::unique_ptr<Datafield> data, const QString& units);
33 
34  //! True if the contained data is not nullptr (no info about empty data)
35  operator bool() const;
36 
37  std::unique_ptr<Datafield> clonedData() const&;
38  std::unique_ptr<Datafield> intensityData() &&;
39 
40  //! Returns number of dimensions.
41  size_t dataRank() const;
42 
43  QString unitsLabel() const;
44  QString axisLabel(size_t axis_index) const;
45 
46 private:
47  void checkValidity();
48 
49 private:
50  std::unique_ptr<Datafield> m_data;
51  const Coords m_coords;
52 };
53 
54 #endif // BORNAGAIN_GUI_SUPPORT_IO_IMPORTDATAINFO_H
@ other
The unit has no enum value defined in here (e.g. when defined as an explicit string)
Carries information about loaded data.
size_t dataRank() const
Returns number of dimensions.
QString unitsLabel() const
std::unique_ptr< Datafield > clonedData() const &
QString axisLabel(size_t axis_index) const
std::unique_ptr< Datafield > m_data
ImportDataInfo(std::unique_ptr< Datafield > data, Coords units)
std::unique_ptr< Datafield > intensityData() &&
const Coords m_coords