BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
OutputDataWriter.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/InputOutput/OutputDataWriter.h
6 //! @brief Defines class OutputDataWriter.
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_CORE_INPUTOUTPUT_OUTPUTDATAWRITER_H
16 #define BORNAGAIN_CORE_INPUTOUTPUT_OUTPUTDATAWRITER_H
17 
19 #include <memory>
20 
21 template <class T> class OutputData;
22 
23 //! Write OutputData to file using different witing strategies.
24 //! @ingroup input_output_internal
25 
27 {
28 public:
29  OutputDataWriter(const std::string& file_name);
30 
31  //! Writes output data to file.
32  void writeOutputData(const OutputData<double>& data);
33 
34  //! Sets concrete writing strategy.
35  void setStrategy(IOutputDataWriteStrategy* write_strategy);
36 
37 private:
38  std::string m_file_name;
39  std::unique_ptr<IOutputDataWriteStrategy> m_write_strategy;
40 };
41 
42 #endif // BORNAGAIN_CORE_INPUTOUTPUT_OUTPUTDATAWRITER_H
Defines classes IOutputDataWriteStrategy and OutputDataWriteStreamIMA.
Strategy interface to write OututData in file.
Write OutputData to file using different witing strategies.
OutputDataWriter(const std::string &file_name)
void setStrategy(IOutputDataWriteStrategy *write_strategy)
Sets concrete writing strategy.
void writeOutputData(const OutputData< double > &data)
Writes output data to file.
std::string m_file_name
std::unique_ptr< IOutputDataWriteStrategy > m_write_strategy
Template class to store data of any type in multi-dimensional space.
Definition: OutputData.h:33