BornAgain  1.19.0
Simulate and fit neutron and x-ray scattering at grazing incidence
datahandler.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file gui2/dataloader/datahandler.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 Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_DATALOADER_DATAHANDLER_H
16 #define BORNAGAIN_GUI2_DATALOADER_DATAHANDLER_H
17 
18 #include "darefl_export.h"
19 #include <map>
20 #include <string>
21 #include <vector>
22 
23 namespace gui2 {
24 
25 //! Handles raw data during the life time of DataHandlerDialog.
26 //! Loads the data from multiple ASCII files and stores in a buffer of strings.
27 
28 class DAREFLCORE_EXPORT DataHandler {
29 public:
30  DataHandler() = default;
31 
32  void updateRawData(const std::vector<std::string>& file_names);
33 
34  std::vector<std::string> textData(const std::string& file_name);
35 
36 private:
37  void loadFile(const std::string& file_name);
38 
39  //!< correspondence of file name to the raw data in the file (i.e. all strings)
40  std::map<std::string, std::vector<std::string>> m_raw_data;
41 };
42 
43 } // namespace gui2
44 
45 #endif // BORNAGAIN_GUI2_DATALOADER_DATAHANDLER_H
Handles raw data during the life time of DataHandlerDialog.
Definition: datahandler.h:28
DataHandler()=default
std::map< std::string, std::vector< std::string > > m_raw_data
Definition: datahandler.h:40
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20