3#ifndef __stir_IO_read_from_file_H__
4#define __stir_IO_read_from_file_H__
44template <
class DataT,
class FileT>
45inline unique_ptr<DataT>
48 using hierarchy_base_type =
typename DataT::hierarchy_base_type;
55 auto data_ptr =
dynamic_cast<DataT*
>(uptr.get());
59 error(
"data read from file is an incorrect type");
63 return unique_ptr<DataT>(data_ptr);
84template <
class DataT,
class FileT>
85inline unique_ptr<DataT>
A class to read/store the file signature.
Definition FileSignature.h:35
unique_ptr< DataT > read_from_file(const FileSignature &signature, FileT file)
Function that reads data from file using the default InputFileFormatRegistry, using the provided File...
Definition read_from_file.h:46
void error(const char *const s,...)
Print error with format string a la printf and throw exception.
Definition error.cxx:42
Import of std::unique_ptr into the stir namespace, together with work-arounds for other compilers.