better file structure for better separation

This commit is contained in:
Bechir
2024-03-06 21:08:52 +01:00
parent 1b7ea707ae
commit 22fb8763be
24 changed files with 29 additions and 43 deletions

View File

@ -0,0 +1,28 @@
#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;
}
};