mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-14 00:07:13 +02:00
28 lines
689 B
C++
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;
|
|
}
|
|
}; |