33#ifndef AIMS_ANYTYPE_READER_DETAILS_H
34#define AIMS_ANYTYPE_READER_DETAILS_H
53 template <
typename TCaller,
typename TFile >
54 bool anytype_reader(
Process & p,
const std::string & filein,
Finder & f)
56 typedef typename TCaller::return_type return_type;
57 typedef typename TCaller::convertor_type::template Type<TFile, return_type>::type convertor_type;
60 TCaller & atr =
dynamic_cast<TCaller &
>(p);
65 std::string format = f.format();
66 r.read(data, 0, &format);
69 convertor_type convert;
70 convert.convert(data, atr.get());
79 template <
typename T,
typename TConvertorFamily >
83 this->registerProcesses();
87 template <
typename T,
typename TConvertorFamily >
88 void AnyTypeReaderProcess<T, TConvertorFamily>::registerProcesses()
99 registerProcessType(
"Volume",
"FLOAT", &anytype_reader<Self,
AimsData< float > >);
106 template <
typename T,
typename TConvertorFamily >
109 , m_filename(filename)
113 template <
typename T,
typename TConvertorFamily >
A process to read an object of type T, even if the type on file is different.
AnyTypeReaderProcess(const T &init)
Initialize result with init.
T & get()
Get data loaded from file.
void read(T &out)
read file and get result.
AnyTypeReader(std::string filename)
initialize with the name of the file to be read.
AnyTypeReaderProcess< T, TConvertorFamily > Base
Generic finder / checker for all data objects and file formats This will replace the old AimsFinder.
Link mechanism between the Finder and a process operating on arbitrary data types.
bool execute(const std::string &filename)
Executes the process on the object / data type found in the given file.
Generic reader for every format of Aims object.
The class for EcatSino data write operation.