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);
64 Reader<TFile> r(filein);
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 >
106 template <
typename T,
typename TConvertorFamily >
109 , m_filename(filename)
113 template <
typename T,
typename TConvertorFamily >
void registerProcessType(const std::string &objType, const std::string &dataType, ProcFunc procFunc)
Registers the process to call on a given (object type, data type) couple (just fills the map) ...
The class for EcatSino data write operation.
AnyTypeReaderProcess(const T &init)
Initialize result with init.
bool execute(const std::string &filename)
Executes the process on the object / data type found in the given file.
void read(T &out)
read file and get result.
A process to read an object of type T, even if the type on file is different.
AnyTypeReader(std::string filename)
initialize with the name of the file to be read.