31 return reader->getOutputData();
39 std::unique_ptr<OutputDataReader> reader(
42 return reader->getOutputData();
48 std::unique_ptr<OutputData<double>> data(
readOutputData(file_name));
50 throw std::runtime_error(
"Could not read " + file_name);
55 const std::string& file_name)
58 writer->writeOutputData(data);
63 const std::string& file_name)
70 const std::string& file_name)
72 auto data = result.
data();
Defines namespace FileSystemUtils.
Defines class IHistogram.
Defines class IntensityDataIOFactory.
Defines class OutputDataReadFactory.
Defines class OutputDataWriteFactory.
Defines class SimulationResult.
Base class for 1D and 2D histograms holding values of double type.
OutputData< double > * createOutputData(DataType dataType=DataType::INTEGRAL) const
creates new OutputData with histogram's shape and values corresponding to DataType
static IHistogram * createHistogram(const OutputData< double > &source)
static OutputData< double > * readOutputData(const std::string &file_name)
Reads file and returns newly created OutputData object.
static void writeOutputData(const OutputData< double > &data, const std::string &file_name)
Writes OutputData in file.
static IHistogram * readIntensityData(const std::string &file_name)
Reads file and returns newly created Histogram object.
static void writeIntensityData(const IHistogram &histogram, const std::string &file_name)
Writes histogram in file.
static OutputData< double > * readReflectometryData(const std::string &file_name)
static void writeSimulationResult(const SimulationResult &result, const std::string &file_name)
Writes OutputData contained in the given SimulationResult object.
static OutputDataReader * getReflectometryReader(const std::string &file_name)
static OutputDataReader * getReader(const std::string &file_name)
static OutputDataWriter * getWriter(const std::string &file_name)
Wrapper around OutputData<double> that also provides unit conversions.
std::unique_ptr< OutputData< double > > data(Axes::Units units=Axes::Units::DEFAULT) const
bool IsFileExists(const std::string &str)
Returns true if file with given name exists on disk.