Files
aare/include/file_io/FileHandler.hpp
2024-03-06 21:08:52 +01:00

28 lines
689 B
C++

#include <filesystem>
#include "file_io/FileFactory.hpp"
#include "file_io/File.hpp"
template <DetectorType detector,typename DataType>
class FileHandler{
private:
std::filesystem::path fpath;
FileFactory<detector,DataType>* fileFactory;
File<detector,DataType>* f;
public:
FileHandler<detector,DataType>(std::filesystem::path fpath){
this->fpath = fpath;
this->fileFactory= FileFactory<detector,DataType>::get_factory(fpath);
this->f= fileFactory->load_file();
delete fileFactory;
}
Frame<DataType>* get_frame(int index){
return f->get_frame(index);
}
~FileHandler(){
delete f;
}
};