mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-15 08:47:14 +02:00
better file structure for better separation
This commit is contained in:
28
include/file_io/FileHandler.hpp
Normal file
28
include/file_io/FileHandler.hpp
Normal 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;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user