mirror of
https://github.com/slsdetectorgroup/aare.git
synced 2025-06-05 12:30:39 +02:00
added a draft for file interface
This commit is contained in:
parent
e7bf408a21
commit
cffe020a6f
@ -49,7 +49,7 @@ else()
|
||||
aare_compiler_flags
|
||||
INTERFACE
|
||||
-fdiagnostics-parseable-fixits
|
||||
-fdiagnostics-generate-patch
|
||||
# -fdiagnostics-generate-patch
|
||||
-fdiagnostics-show-template-tree
|
||||
-fsanitize=address,undefined,pointer-compare
|
||||
-fno-sanitize-recover
|
||||
@ -62,7 +62,7 @@ else()
|
||||
aare_compiler_flags
|
||||
INTERFACE
|
||||
-fdiagnostics-parseable-fixits
|
||||
-fdiagnostics-generate-patch
|
||||
# -fdiagnostics-generate-patch
|
||||
-fdiagnostics-show-template-tree
|
||||
-fsanitize=address,undefined,pointer-compare
|
||||
-fno-sanitize-recover
|
||||
|
35
file_io/include/aare/FileInterface.h
Normal file
35
file_io/include/aare/FileInterface.h
Normal file
@ -0,0 +1,35 @@
|
||||
#pragma once
|
||||
#include "aare/Frame.hpp"
|
||||
#include <filesystem>
|
||||
namespace aare {
|
||||
class FileInterface {
|
||||
public:
|
||||
FileInterface(std::filesystem::path& fname ){}; //do we need this?
|
||||
|
||||
// read the frame number on position frame_index
|
||||
virtual size_t frame_number(size_t frame_index) = 0;
|
||||
|
||||
// read one frame
|
||||
virtual Frame read() = 0;
|
||||
|
||||
// read n_frames frames
|
||||
virtual std::vector<Frame> read(size_t n_frames) = 0; //Is this the right interface?
|
||||
|
||||
// read one frame into the provided buffer
|
||||
virtual void read_into(std::byte* image_buf) = 0;
|
||||
|
||||
// read n_frames frame into the provided buffer
|
||||
virtual void read_into(std::byte* image_buf, size_t n_frames) = 0;
|
||||
|
||||
// goto frame number
|
||||
virtual void seek(size_t frame_number) = 0;
|
||||
|
||||
// return the position of the file pointer (in number of frames)
|
||||
virtual size_t tell() = 0;
|
||||
|
||||
// total number of frames in the file
|
||||
virtual size_t total_frames() = 0;
|
||||
|
||||
virtual ~FileInterface() = 0;
|
||||
};
|
||||
} // namespace aare
|
Loading…
x
Reference in New Issue
Block a user