BornAgain  1.18.0
Simulate and fit neutron and x-ray scattering at grazing incidence
OutputDataWriteStrategy.h
Go to the documentation of this file.
1 // ************************************************************************** //
2 //
3 // BornAgain: simulate and fit scattering at grazing incidence
4 //
5 //! @file Device/InputOutput/OutputDataWriteStrategy.h
6 //! @brief Defines classes IOutputDataWriteStrategy and OutputDataWriteStreamIMA.
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_OUTPUTDATAWRITESTRATEGY_H
16 #define BORNAGAIN_CORE_INPUTOUTPUT_OUTPUTDATAWRITESTRATEGY_H
17 
18 #include <istream>
19 
20 template <class T> class OutputData;
21 
22 //! Strategy interface to write OututData in file
23 //! @ingroup input_output_internal
24 
26 {
27 public:
29  virtual ~IOutputDataWriteStrategy() {}
30 
31  virtual void writeOutputData(const OutputData<double>& data, std::ostream& output_stream) = 0;
32 };
33 
34 //! Strategy to write OutputData to special BornAgain ASCII format
35 //! @ingroup input_output_internal
36 
38 {
39 public:
40  virtual void writeOutputData(const OutputData<double>& data, std::ostream& output_stream);
41 };
42 
43 //! Strategy to write OutputData to simple ASCII file with the layout as in numpy.savetxt
44 //! @ingroup input_output_internal
45 
47 {
48 public:
49  virtual void writeOutputData(const OutputData<double>& data, std::ostream& output_stream);
50 };
51 
52 #ifdef BORNAGAIN_TIFF_SUPPORT
53 
54 class TiffHandler;
55 
56 //! Strategy to write OutputData to tiff files
57 //! @ingroup input_output_internal
58 
59 class OutputDataWriteTiffStrategy : public IOutputDataWriteStrategy
60 {
61 public:
62  OutputDataWriteTiffStrategy();
63  virtual ~OutputDataWriteTiffStrategy();
64  virtual void writeOutputData(const OutputData<double>& data, std::ostream& output_stream);
65 
66 private:
67  TiffHandler* m_d;
68 };
69 
70 #endif // BORNAGAIN_TIFF_SUPPORT
71 
72 #endif // BORNAGAIN_CORE_INPUTOUTPUT_OUTPUTDATAWRITESTRATEGY_H
Strategy interface to write OututData in file.
Strategy to write OutputData to special BornAgain ASCII format.
Strategy to write OutputData to simple ASCII file with the layout as in numpy.savetxt.
Template class to store data of any type in multi-dimensional space.
Definition: OutputData.h:33